PageSourceSearch

https://defade.org/js/vendor/walletconnect-2.23.10.bundle.min.js

js defade.org collected 2026-10-08 12:42:08 UTC 2,083,479 bytes, 6,326 lines download raw bytes

vendor: 2,605 bytes, line 1
1var Tve=Object.create;var K5=Object.defineProperty;var _ve=Object.getOwnPropertyDescriptor;var Pve=Object.getOwnPropertyNames;var Nve=Object.getPrototypeOf,Rve=Object.prototype.hasOwnProperty;var h=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var ot=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ce=(e,t)=>{for(var r in t)K5(e,r,{get:t[r],enumerable:!0})},W5=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Pve(t))!Rve.call(e,o)&&o!==r&&K5(e,o,{get:()=>t[o],enumerable:!(n=_ve(t,o))||n.enumerable});return e},As=(e,t,r)=>(W5(e,t,"default"),r&&W5(r,t,"default")),Lt=(e,t,r)=>(r=e!=null?Tve(Nve(e)):{},W5(t||!e||!e.__esModule?K5(r,"default",{value:e,enumerable:!0}):r,e)),Q6=e=>W5(K5({},"__esModule",{value:!0}),e);var Cs=ot((lJe,uP)=>{"use strict";var v2=typeof Reflect=="object"?Reflect:null,Xz=v2&&typeof v2.apply=="function"?v2.apply:function(t,r,n){return Function.prototype.apply.call(t,r,n)},Z5;v2&&typeof v2.ownKeys=="function"?Z5=v2.ownKeys:Object.getOwnPropertySymbols?Z5=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Z5=function(t){return Object.getOwnPropertyNames(t)};function Ove(e){console&&console.warn&&console.warn(e)}var tj=Number.isNaN||function(t){return t!==t};function wr(){wr.init.call(this)}uP.exports=wr;uP.exports.once=Uve;wr.EventEmitter=wr;wr.prototype._events=void 0;wr.prototype._eventsCount=0;wr.prototype._maxListeners=void 0;var ej=10;function G5(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(wr,"defaultMaxListeners",{enumerable:!0,get:function(){return ej},set:function(e){if(typeof e!="number"||e<0||tj(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");ej=e}});wr.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};wr.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||tj(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function rj(e){return e._maxListeners===void 0?wr.defaultMaxListeners:e._maxListeners}wr.prototype.getMaxListeners=function(){return rj(this)};wr.prototype.emit=function(t){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var o=t==="error",s=this._events;
vendor: 6,220 bytes, line 1
1if(s!==void 0)o=o&&s.error===void 0;else if(!o)return!1;if(o){var i;if(r.length>0&&(i=r[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var c=s[t];if(c===void 0)return!1;if(typeof c=="function")Xz(c,this,r);else for(var l=c.length,u=aj(c,l),n=0;n<l;++n)Xz(u[n],this,r);return!0};function nj(e,t,r,n){var o,s,i;if(G5(r),s=e._events,s===void 0?(s=e._events=Object.create(null),e._eventsCount=0):(s.newListener!==void 0&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),i=s[t]),i===void 0)i=s[t]=r,++e._eventsCount;else if(typeof i=="function"?i=s[t]=n?[r,i]:[i,r]:n?i.unshift(r):i.push(r),o=rj(e),o>0&&i.length>o&&!i.warned){i.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=i.length,Ove(a)}return e}wr.prototype.addListener=function(t,r){return nj(this,t,r,!1)};wr.prototype.on=wr.prototype.addListener;wr.prototype.prependListener=function(t,r){return nj(this,t,r,!0)};function Bve(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function oj(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=Bve.bind(n);return o.listener=r,n.wrapFn=o,o}wr.prototype.once=function(t,r){return G5(r),this.on(t,oj(this,t,r)),this};wr.prototype.prependOnceListener=function(t,r){return G5(r),this.prependListener(t,oj(this,t,r)),this};wr.prototype.removeListener=function(t,r){var n,o,s,i,a;if(G5(r),o=this._events,o===void 0)return this;if(n=o[t],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[t],o.removeListener&&this.emit("removeListener",t,n.listener||r));else if(typeof n!="function"){for(s=-1,i=n.length-1;i>=0;i--)if(n[i]===r||n[i].listener===r){a=n[i].listener,s=i;break}if(s<0)return this;s===0?n.shift():kve(n,s),n.length===1&&(o[t]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",t,a||r)}return this};wr.prototype.off=wr.prototype.removeListener;wr.prototype.removeAllListeners=function(t){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var s=Object.keys(n),i;for(o=0;o<s.length;++o)i=s[o],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[t],typeof r=="function")this.removeListener(t,r);else if(r!==void 0)for(o=r.length-1;o>=0;o--)this.removeListener(t,r[o]);return this};function sj(e,t,r){var n=e._events;if(n===void 0)return[];var o=n[t];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?Dve(o):aj(o,o.length)}wr.prototype.listeners=function(t){return sj(this,t,!0)};wr.prototype.rawListeners=function(t){return sj(this,t,!1)};wr.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):ij.call(e,t)};wr.prototype.listenerCount=ij;function ij(e){var t=this._events;if(t!==void 0){var r=t[e];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}wr.prototype.eventNames=function(){return this._eventsCount>0?Z5(this._events):[]};function aj(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function kve(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function Dve(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function Uve(e,t){return new Promise(function(r,n){function o(i){e.removeListener(t,s),n(i)}function s(){typeof e.removeListener=="function"&&e.removeListener("error",o),r([].slice.call(arguments))}cj(e,t,s,{once:!0}),t!=="error"&&Lve(e,o,{once:!0})})}function Lve(e,t,r){typeof e.on=="function"&&cj(e,"error",t,r)}function cj(e,t,r,n){if(typeof e.on=="function")n.once?e.once(t,r):e.on(t,r);else if(typeof e.addEventListener=="function")e.addEventListener(t,function o(s){n.once&&e.removeEventListener(t,o),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}});function Y5(e){return e?pj(e):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Vve:typeof navigator<"u"?pj(navigator.userAgent):Zve()}function Wve(e){return e!==""&&qve.reduce(function(t,r){var n=r[0],o=r[1];if(t)return t;var s=o.exec(e);return!!s&&[n,s]},!1)}function pj(e){var t=Wve(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new Fve;var o=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);o?o.length<uj&&(o=lj(lj([],o,!0),Gve(uj-o.length),!0)):o=[];var s=o.join("."),i=Kve(e),a=jve.exec(e);return a&&a[1]?new $ve(r,s,i,a[1]):new Mve(r,s,i)}function Kve(e){for(var t=0,r=dj.length;t<r;t++){var n=dj[t],o=n[0],s=n[1],i=s.exec(e);if(i)return o}return null}function Zve(){var e=typeof process<"u"&&process.version;return e?new Hve(process.version.slice(1)):null}function Gve(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var lj,Mve,Hve,$ve,Fve,Vve,zve,jve,uj,qve,dj,dP=h(()=>{lj=function(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,s;n<o;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},Mve=(function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e})(),Hve=(function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=process.platform}return e})(),$ve=(function(){function e(t,r,n,o){this.name=t,this.version=r,this.os=n,this.bot=o,this.type="bot-device"}return e})(),Fve=(function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e})(),Vve=(function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e})(),zve=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yaho
1o!|yandex/,jve=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,uj=3,qve=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",zve]],dj=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]]});var E2={};Ce(E2,{__assign:()=>fP,__asyncDelegator:()=>c5e,__asyncGenerator:()=>a5e,__asyncValues:()=>l5e,__await:()=>X6,__awaiter:()=>t5e,__classPrivateFieldGet:()=>f5e,__classPrivateFieldSet:()=>h5e,__createBinding:()=>n5e,__decorate:()=>Qve,__exportStar:()=>o5e,__extends:()=>Yve,__generator:()=>r5e,__importDefault:()=>p5e,__importStar:()=>
vendor: 5,685 bytes, line 1
1d5e,__makeTemplateObject:()=>u5e,__metadata:()=>e5e,__param:()=>Xve,__read:()=>fj,__rest:()=>Jve,__spread:()=>s5e,__spreadArrays:()=>i5e,__values:()=>hP});function Yve(e,t){pP(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function Jve(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Qve(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function Xve(e,t){return function(r,n){t(r,n,e)}}function e5e(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function t5e(e,t,r,n){function o(s){return s instanceof r?s:new r(function(i){i(s)})}return new(r||(r=Promise))(function(s,i){function a(u){try{l(n.next(u))}catch(d){i(d)}}function c(u){try{l(n.throw(u))}catch(d){i(d)}}function l(u){u.done?s(u.value):o(u.value).then(a,c)}l((n=n.apply(e,t||[])).next())})}function r5e(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(l){return function(u){return c([l,u])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(s=l[0]&2?o.return:l[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,l[1])).done)return s;switch(o=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(u){l=[6,u],o=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function n5e(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function o5e(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function hP(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function fj(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,s=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)s.push(o.value)}catch(a){i={error:a}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return s}function s5e(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(fj(arguments[t]));return e}function i5e(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),o=0,t=0;t<r;t++)for(var s=arguments[t],i=0,a=s.length;i<a;i++,o++)n[o]=s[i];return n}function X6(e){return this instanceof X6?(this.v=e,this):new X6(e)}function a5e(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,s=[];return o={},i("next"),i("throw"),i("return"),o[Symbol.asyncIterator]=function(){return this},o;function i(p){n[p]&&(o[p]=function(f){return new Promise(function(m,g){s.push([p,f,m,g])>1||a(p,f)})})}function a(p,f){try{c(n[p](f))}catch(m){d(s[0][3],m)}}function c(p){p.value instanceof X6?Promise.resolve(p.value.v).then(l,u):d(s[0][2],p)}function l(p){a("next",p)}function u(p){a("throw",p)}function d(p,f){p(f),s.shift(),s.length&&a(s[0][0],s[0][1])}}function c5e(e){var t,r;return t={},n("next"),n("throw",function(o){throw o}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(o,s){t[o]=e[o]?function(i){return(r=!r)?{value:X6(e[o](i)),done:o==="return"}:s?s(i):i}:s}}function l5e(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof hP=="function"?hP(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(i){return new Promise(function(a,c){i=e[s](i),o(a,c,i.done,i.value)})}}function o(s,i,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},i)}}function u5e(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function d5e(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function p5e(e){return e&&e.__esModule?e:{default:e}}function f5e(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function h5e(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}var pP,fP,A2=h(()=>{pP=function(e,t){return pP=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)n.hasOwnProperty(o)&&(r[o]=n[o])},pP(e,t)};fP=function(){return fP=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];
1for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},fP.apply(this,arguments)}});var hj=ot(J5=>{"use strict";Object.defineProperty(J5,"__esModule",{value:!0});J5.delay=void 0;function m5e(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}J5.delay=m5e});var mj=ot(C2=>{"use strict";Object.defineProperty(C2,"__esModule",{value:!0});C2.ONE_THOUSAND=C2.ONE_HUNDRED=void 0;C2.ONE_HUNDRED=100;C2.ONE_THOUSAND=1e3});var gj=ot(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.ONE_YEAR=Re.FOUR_WEEKS=Re.THREE_WEEKS=Re.TWO_WEEKS=Re.ONE_WEEK=Re.THIRTY_DAYS=Re.SEVEN_DAYS=Re.FIVE_DAYS=Re.THREE_DAYS=Re.ONE_DAY=Re.TWENTY_FOUR_HOURS=Re.TWELVE_HOURS=Re.SIX_HOURS=Re.THREE_HOURS=Re.ONE_HOUR=Re.SIXTY_MINUTES=Re.THIRTY_MINUTES=Re.TEN_MINUTES=Re.FIVE_MINUTES=Re.ONE_MINUTE=Re.SIXTY_SECONDS=Re.THIRTY_SECONDS=Re.TEN_SECONDS=Re.FIVE_SECONDS=Re.ONE_SECOND=void 0;Re.ONE_SECOND=1;Re.FIVE_SECONDS=5;Re.TEN_SECONDS=10;Re.THIRTY_SECONDS=30;Re.SIXTY_SECONDS=60;Re.ONE_MINUTE=Re.SIXTY_SECONDS;Re.FIVE_MINUTES=Re.ONE_MINUTE*5;Re.TEN_MINUTES=Re.ONE_MINUTE*10;Re.THIRTY_MINUTES=Re.ONE_MINUTE*30;Re.SIXTY_MINUTES=Re.ONE_MINUTE*60;Re.ONE_HOUR=Re.SIXTY_MINUTES;Re.THREE_HOURS=Re.ONE_HOUR*3;Re.SIX_HOURS=Re.ONE_HOUR*6;Re.TWELVE_HOURS=Re.ONE_HOUR*12;Re.TWENTY_FOUR_HOURS=Re.ONE_HOUR*24;Re.ONE_DAY=Re.TWENTY_FOUR_HOURS;Re.THREE_DAYS=Re.ONE_DAY*3;Re.FIVE_DAYS=Re.ONE_DAY*5;Re.SEVEN_DAYS=Re.ONE_DAY*7;Re.THIRTY_DAYS=Re.ONE_DAY*30;Re.ONE_WEEK=Re.SEVEN_DAYS;Re.TWO_WEEKS=Re.ONE_WEEK*2;Re.THREE_WEEKS=Re.ONE_WEEK*3;Re.FOUR_WEEKS=Re.ONE_WEEK*4;Re.ONE_YEAR=Re.ONE_DAY*365});var mP=ot(Q5=>{"use strict";Object.defineProperty(Q5,"__esModule",{value:!0});var yj=(A2(),Q6(E2));yj.__exportStar(mj(),Q5);yj.__exportStar(gj(),Q5)});var bj=ot(S2=>{"use strict";Object.defineProperty(S2,"__esModule",{value:!0});S2.fromMiliseconds=S2.toMiliseconds=void 0;var wj=mP();function g5e(e){return e*wj.ONE_THOUSAND}S2.toMiliseconds=g5e;function y5e(e){return Math.floor(e/wj.ONE_THOUSAND)}S2.fromMiliseconds=y5e});var vj=ot(X5=>{"use strict";Object.defineProperty(X5,"__esModule",{value:!0});var xj=(A2(),Q6(E2));xj.__exportStar(hj(),X5);xj.__exportStar(bj(),X5)});var Ej=ot(ex=>{"use strict";Object.defineProperty(ex,"__esModule",{value:!0});ex.Watch=void 0;var eE=class{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){let r=this.get(t);if(typeof r.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);let n=Date.now()-r.started;this.timestamps.set(t,{started:r.started,elapsed:n})}get(t){let r=this.timestamps.get(t);if(typeof r>"u")throw new Error(`No timestamp found for label: ${t}`);return r}elapsed(t){let r=this.get(t);return r.elapsed||Date.now()-r.started}};ex.Watch=eE;ex.default=eE});var Aj=ot(tE=>{"use strict";Object.defineProperty(tE,"__esModule",{value:!0});tE.IWatch=void 0;var gP=class{};tE.IWatch=gP});var Cj=ot(yP=>{"use strict";Object.defineProperty(yP,"__esModule",{value:!0});var w5e=(A2(),Q6(E2));w5e.__exportStar(Aj(),yP)});var Sd=ot(I2=>{"use strict";
1Object.defineProperty(I2,"__esModule",{value:!0});var rE=(A2(),Q6(E2));rE.__exportStar(vj(),I2);rE.__exportStar(Ej(),I2);rE.__exportStar(Cj(),I2);rE.__exportStar(mP(),I2)});var _2=ot(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.getLocalStorage=Nr.getLocalStorageOrThrow=Nr.getCrypto=Nr.getCryptoOrThrow=Nr.getLocation=Nr.getLocationOrThrow=Nr.getNavigator=Nr.getNavigatorOrThrow=Nr.getDocument=Nr.getDocumentOrThrow=Nr.getFromWindowOrThrow=Nr.getFromWindow=void 0;function Cm(e){let t;return typeof window<"u"&&typeof window[e]<"u"&&(t=window[e]),t}Nr.getFromWindow=Cm;function T2(e){let t=Cm(e);if(!t)throw new Error(`${e} is not defined in Window`);return t}Nr.getFromWindowOrThrow=T2;function b5e(){return T2("document")}Nr.getDocumentOrThrow=b5e;function x5e(){return Cm("document")}Nr.getDocument=x5e;function v5e(){return T2("navigator")}Nr.getNavigatorOrThrow=v5e;function E5e(){return Cm("navigator")}Nr.getNavigator=E5e;function A5e(){return T2("location")}Nr.getLocationOrThrow=A5e;function C5e(){return Cm("location")}Nr.getLocation=C5e;function S5e(){return T2("crypto")}Nr.getCryptoOrThrow=S5e;function I5e(){return Cm("crypto")}Nr.getCrypto=I5e;function T5e(){return T2("localStorage")}Nr.getLocalStorageOrThrow=T5e;function _5e(){return Cm("localStorage")}Nr.getLocalStorage=_5e});var wP=ot(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.getWindowMetadata=void 0;var Sj=_2();function P5e(){let e,t;try{e=Sj.getDocumentOrThrow(),t=Sj.getLocationOrThrow()}catch{return null}function r(){let d=e.getElementsByTagName("link"),p=[];for(let f=0;f<d.length;f++){let m=d[f],g=m.getAttribute("rel");if(g&&g.toLowerCase().indexOf("icon")>-1){let y=m.getAttribute("href");if(y)if(y.toLowerCase().indexOf("https:")===-1&&y.toLowerCase().indexOf("http:")===-1&&y.indexOf("//")!==0){let b=t.protocol+"//"+t.host;if(y.indexOf("/")===0)b+=y;else{let C=t.pathname.split("/");C.pop();let w=C.join("/");b+=w+"/"+y}p.push(b)}else if(y.indexOf("//")===0){let b=t.protocol+y;p.push(b)}else p.push(y)}}return p}function n(...d){let p=e.getElementsByTagName("meta");for(let f=0;f<p.length;f++){let m=p[f],g=["itemprop","property","name"].map(y=>m.getAttribute(y)).filter(y=>y?d.includes(y):!1);if(g.length&&g){let y=m.getAttribute("content");if(y)return y}}return""}function o(){let d=n("name","og:site_name","og:title","twitter:title");return d||(d=e.title),d}function s(){return n("description","og:description","twitter:description","keywords")}let i=o(),a=s(),c=t.origin,l=r();return{description:a,url:c,icons:l,name:i}}nE.getWindowMetadata=P5e});var BEe,kEe,DEe,UEe,Xq,eW,tW,LEe,MEe,get,yet,wet,bet,rW=h(()=>{BEe=44032,kEe=4352,DEe=4449,UEe=4519,Xq=19,eW=21,tW=28,LEe=eW*tW,MEe=Xq*LEe,get=BEe+MEe,yet=kEe+Xq,wet=DEe+eW,bet=UEe+tW});function sW(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function iW(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(r=>typeof r=="string"):t.every(r=>Number.isSafeInteger(r)):!1}function BE(e,t){if(typeof t!="string")throw new Error(`${e}: string expected`);return!0}function mx(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function kE(e){if(!Array.isArray(e))throw new Error("array expected")}function DE(e,t){if(!iW(!0,t))throw new Error(`${e}: array of strings expected`)}function aW(e,t){if(!iW(!1,t))throw new Error(`${e}: array of numbers expected`)}function cW(...e){let t=s=>s,r=(s,i)=>a=>s(i(a)),n=e.map(s=>s.encode).reduceRight(r,t),o=e.map(s=>s.decode).reduce(r,t);return{encode:n,decode:o}}function lW(e){let t=typeof e=="string"?e.split(""):e,r=t.length;DE("alphabet",t);let n=new Map(t.map((o,s)=>[o,s]));return{encode:o=>(kE(o),o.map(s=>{if(!Number.isSafeInteger(s)||s<0||s>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${s}". Allowed: ${e}`);return t[s]})),decode:o=>(kE(o),o.map(s=>{BE("alphabet.decode",s);let i=n.get(s);if(i===void 0)throw new Error(`Unknown letter: "${s}". Allowed: ${e}`);return i}))}}function uW(e=""){return BE("join",e),{encode:t=>(DE("join.decode",t),t.join(e)),decode:t=>(BE("join.decode",t),t.split(e))}}function HEe(e,t="="){return mx(e),BE("padding",t),{encode(r){for(DE("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){DE("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8===0)throw new Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}
vendor: 4,913 bytes, line 1
1function nW(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(kE(e),!e.length)return[];let n=0,o=[],s=Array.from(e,a=>{if(mx(a),a<0||a>=t)throw new Error(`invalid integer: ${a}`);return a}),i=s.length;for(;;){let a=0,c=!0;for(let l=n;l<i;l++){let u=s[l],d=t*a,p=d+u;if(!Number.isSafeInteger(p)||d/t!==a||p-u!==d)throw new Error("convertRadix: carry overflow");let f=p/r;a=p%r;let m=Math.floor(f);if(s[l]=m,!Number.isSafeInteger(m)||m*r+a!==p)throw new Error("convertRadix: carry overflow");if(c)m?c=!1:n=l;else continue}if(o.push(a),c)break}for(let a=0;a<e.length-1&&e[a]===0;a++)o.push(0);return o.reverse()}function oW(e,t,r,n){if(kE(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(UE(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${UE(t,r)}`);let o=0,s=0,i=yN[t],a=yN[r]-1,c=[];for(let l of e){if(mx(l),l>=i)throw new Error(`convertRadix2: invalid data word=${l} from=${t}`);if(o=o<<t|l,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=r;s-=r)c.push((o>>s-r&a)>>>0);let u=yN[s];if(u===void 0)throw new Error("invalid carry");o&=u-1}if(o=o<<r-s&a,!n&&s>=t)throw new Error("Excess padding");if(!n&&o>0)throw new Error(`Non-zero padding: ${o}`);return n&&s>0&&c.push(o>>>0),c}function $Ee(e){mx(e);let t=2**8;return{encode:r=>{if(!sW(r))throw new Error("radix.encode input should be Uint8Array");return nW(Array.from(r),t,e)},decode:r=>(aW("radix.decode",r),Uint8Array.from(nW(r,e,t)))}}function FEe(e,t=!1){if(mx(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(UE(8,e)>32||UE(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!sW(r))throw new Error("radix2.encode input should be Uint8Array");return oW(Array.from(r),8,e,!t)},decode:r=>(aW("radix2.decode",r),Uint8Array.from(oW(r,e,8,t)))}}var dW,UE,yN,LE,VEe,Na,wN=h(()=>{dW=(e,t)=>t===0?e:dW(t,e%t),UE=(e,t)=>e+(t-dW(e,t)),yN=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();LE=cW(FEe(5),lW("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),HEe(5),uW("")),VEe=e=>cW($Ee(58),lW(e),uW("")),Na=VEe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")});function wW(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function HE(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function $E(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Vo(e,...t){if(!wW(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function bN(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function bW(e,t){Vo(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Dd(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ud(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function GEe(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function JEe(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function FE(e){if(typeof e=="string")e=JEe(e);else if(wW(e))e=VE(e);else throw new Error("Uint8Array expected, got "+typeof e);return e}function xW(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function vW(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}function vN(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!QEe(t))throw new Error("invalid output, must be aligned");return t}function yW(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function EW(e,t,r){HE(r);let n=new Uint8Array(16),o=GEe(n);return yW(o,0,BigInt(t),r),yW(o,8,BigInt(e),r),n}function QEe(e){return e.byteOffset%4===0}function VE(e){return Uint8Array.from(e)}var YEe,xN,zE=h(()=>{YEe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;xN=(e,t)=>{function r(n,...o){if(Vo(n),!YEe)throw new Error("Non little-endian hardware is not yet supported");if(e.nonceLength!==void 0){let u=o[0];if(!u)throw new Error("nonce / iv required");e.varSizeNonce?Vo(u):Vo(u,e.nonceLength)}let s=e.tagLength;s&&o[1]!==void 0&&Vo(o[1]);let i=t(n,...o),a=(u,d)=>{if(d!==void 0){if(u!==2)throw new Error("cipher output not supported");Vo(d)}},c=!1;
1return{encrypt(u,d){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Vo(u),a(i.encrypt.length,d),i.encrypt(u,d)},decrypt(u,d){if(Vo(u),s&&u.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(i.decrypt.length,d),i.decrypt(u,d)}}}return Object.assign(r,e),r}});var AW=h(()=>{});var SW=ot((Iet,EN)=>{"use strict";var XEe=Object.prototype.hasOwnProperty,Ts="~";function gx(){}Object.create&&(gx.prototype=Object.create(null),new gx().__proto__||(Ts=!1));function eAe(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function CW(e,t,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new eAe(r,n||e,o),i=Ts?Ts+t:t;return e._events[i]?e._events[i].fn?e._events[i]=[e._events[i],s]:e._events[i].push(s):(e._events[i]=s,e._eventsCount++),e}function jE(e,t){--e._eventsCount===0?e._events=new gx:delete e._events[t]}function zo(){this._events=new gx,this._eventsCount=0}zo.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)XEe.call(r,n)&&t.push(Ts?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};zo.prototype.listeners=function(t){var r=Ts?Ts+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,s=n.length,i=new Array(s);o<s;o++)i[o]=n[o].fn;return i};zo.prototype.listenerCount=function(t){var r=Ts?Ts+t:t,n=this._events[r];return n?n.fn?1:n.length:0};zo.prototype.emit=function(t,r,n,o,s,i){var a=Ts?Ts+t:t;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,r),!0;case 3:return c.fn.call(c.context,r,n),!0;case 4:return c.fn.call(c.context,r,n,o),!0;case 5:return c.fn.call(c.context,r,n,o,s),!0;case 6:return c.fn.call(c.context,r,n,o,s,i),!0}for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var p=c.length,f;for(d=0;d<p;d++)switch(c[d].once&&this.removeListener(t,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,r);break;case 3:c[d].fn.call(c[d].context,r,n);break;case 4:c[d].fn.call(c[d].context,r,n,o);break;default:if(!u)for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c[d].fn.apply(c[d].context,u)}}return!0};zo.prototype.on=function(t,r,n){return CW(this,t,r,n,!1)};zo.prototype.once=function(t,r,n){return CW(this,t,r,n,!0)};zo.prototype.removeListener=function(t,r,n,o){var s=Ts?Ts+t:t;if(!this._events[s])return this;if(!r)return jE(this,s),this;var i=this._events[s];if(i.fn)i.fn===r&&(!o||i.once)&&(!n||i.context===n)&&jE(this,s);else{for(var a=0,c=[],l=i.length;a<l;a++)(i[a].fn!==r||o&&!i[a].once||n&&i[a].context!==n)&&c.push(i[a]);c.length?this._events[s]=c.length===1?c[0]:c:jE(this,s)}return this};zo.prototype.removeAllListeners=function(t){var r;return t?(r=Ts?Ts+t:t,this._events[r]&&jE(this,r)):(this._events=new gx,this._eventsCount=0),this};zo.prototype.off=zo.prototype.removeListener;zo.prototype.addListener=zo.prototype.on;zo.prefixed=Ts;zo.EventEmitter=zo;typeof EN<"u"&&(EN.exports=zo)});var IW,TW=h(()=>{IW=Lt(SW(),1)});function _W(e){let t=e.length,r=0,n=0;for(;n<t;){let o=e.charCodeAt(n++);if((o&4294967168)===0){r++;continue}else if((o&4294965248)===0)r+=2;else{if(o>=55296&&o<=56319&&n<t){let s=e.charCodeAt(n);(s&64512)===56320&&(++n,o=((o&1023)<<10)+(s&1023)+65536)}(o&4294901760)===0?r+=3:r+=4}}return r}function tAe(e,t,r){let n=e.length,o=r,s=0;for(;s<n;){let i=e.charCodeAt(s++);if((i&4294967168)===0){t[o++]=i;continue}else if((i&4294965248)===0)t[o++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&s<n){let a=e.charCodeAt(s);(a&64512)===56320&&(++s,i=((i&1023)<<10)+(a&1023)+65536)}(i&4294901760)===0?(t[o++]=i>>12&15|224,t[o++]=i>>6&63|128):(t[o++]=i>>18&7|240,t[o++]=i>>12&63|128,t[o++]=i>>6&63|128)}t[o++]=i&63|128}}function oAe(e,t,r){rAe.encodeInto(e,t.subarray(r))}function PW(e,t,r){e.length>nAe?oAe(e,t,r):tAe(e,t,r)}function AN(e,t,r){let n=t,o=n+r,s=[],i="";for(;n<o;){let a=e[n++];if((a&128)===0)s.push(a);else if((a&224)===192){let c=e[n++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){let c=e[n++]&63,l=e[n++]&63;s.push((a&31)<<12|c<<6|l)}else if((a&248)===240){let c=e[n++]&63,l=e[n++]&63,u=e[n++]&63,d=(a&7)<<18|c<<12|l<<6|u;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=sAe&&(i+=String.fromCharCode(...s),s.length=0)}return s.length>0&&(i+=String.fromCharCode(...s)),i}function cAe(e,t,r){let n=e.subarray(t,t+r);return iAe.decode(n)}function NW(e,t,r){return r>aAe?cAe(e,t,r):AN(e,t,r)}var rAe,nAe,sAe,iAe,aAe,qE=h(()=>{rAe=new TextEncoder,nAe=50;sAe=4096;iAe=new TextDecoder,aAe=200});var $m,RW=h(()=>{$m=class{type;data;constructor(t,r){this.type=t,this.data=r}}});var oi,CN=h(()=>
1{oi=class e extends Error{constructor(t){super(t);let r=Object.create(e.prototype);Object.setPrototypeOf(this,r),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:e.name})}}});function OW(e,t,r){let n=r/4294967296,o=r;e.setUint32(t,n),e.setUint32(t+4,o)}function WE(e,t,r){let n=Math.floor(r/4294967296),o=r;e.setUint32(t,n),e.setUint32(t+4,o)}function KE(e,t){let r=e.getInt32(t),n=e.getUint32(t+4);return r*4294967296+n}function BW(e,t){let r=e.getUint32(t),n=e.getUint32(t+4);return r*4294967296+n}var ZE=h(()=>{});function pAe({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=dAe)if(t===0&&e<=uAe){let r=new Uint8Array(4);return new DataView(r.buffer).setUint32(0,e),r}else{let r=e/4294967296,n=e&4294967295,o=new Uint8Array(8),s=new DataView(o.buffer);return s.setUint32(0,t<<2|r&3),s.setUint32(4,n),o}else{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,t),WE(n,4,e),r}}function fAe(e){let t=e.getTime(),r=Math.floor(t/1e3),n=(t-r*1e3)*1e6,o=Math.floor(n/1e9);return{sec:r+o,nsec:n-o*1e9}}function hAe(e){if(e instanceof Date){let t=fAe(e);return pAe(t)}else return null}function mAe(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let r=t.getUint32(0),n=t.getUint32(4),o=(r&3)*4294967296+n,s=r>>>2;return{sec:o,nsec:s}}case 12:{let r=KE(t,4),n=t.getUint32(0);return{sec:r,nsec:n}}default:throw new oi(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}function gAe(e){let t=mAe(e);return new Date(t.sec*1e3+t.nsec/1e6)}var lAe,uAe,dAe,kW,DW=h(()=>{CN();ZE();lAe=-1,uAe=4294967296-1,dAe=17179869184-1;kW={type:lAe,encode:hAe,decode:gAe}});var L2,SN=h(()=>{RW();DW();L2=class e{static defaultCodec=new e;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(kW)}register({type:t,encode:r,decode:n}){if(t>=0)this.encoders[t]=r,this.decoders[t]=n;else{let o=-1-t;this.builtInEncoders[o]=r,this.builtInDecoders[o]=n}}tryToEncode(t,r){for(let n=0;n<this.builtInEncoders.length;n++){let o=this.builtInEncoders[n];if(o!=null){let s=o(t,r);if(s!=null){let i=-1-n;return new $m(i,s)}}}for(let n=0;n<this.encoders.length;n++){let o=this.encoders[n];if(o!=null){let s=o(t,r);if(s!=null){let i=n;return new $m(i,s)}}}return t instanceof $m?t:null}decode(t,r,n){let o=r<0?this.builtInDecoders[-1-r]:this.decoders[r];return o?o(t,r,n):new $m(r,t)}}});function yAe(e){return e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer}function yx(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):yAe(e)?new Uint8Array(e):Uint8Array.from(e)}var IN=h(()=>{});var wAe,bAe,GE,UW=h(()=>{qE();SN();ZE();IN();wAe=100,bAe=2048,GE=class e{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(t){this.extensionCodec=t?.extensionCodec??L2.defaultCodec,this.context=t?.context,this.useBigInt64=t?.useBigInt64??!1,this.maxDepth=t?.maxDepth??wAe,this.initialBufferSize=t?.initialBufferSize??bAe,this.sortKeys=t?.sortKeys??!1,this.forceFloat32=t?.forceFloat32??!1,this.ignoreUndefined=t?.ignoreUndefined??!1,this.forceIntegerToFloat=t?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(t){if(this.entered)return this.clone().encodeSharedRef(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(t){if(this.entered)return this.clone().encode(t);try{return this.entered=!0,this.reinitializeState(),this.doEncode(t,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(t,r){if(r>this.maxDepth)throw new Error(`Too deep objects in depth ${r}`);t==null?this.encodeNil():typeof t=="boolean"?this.encodeBoolean(t):typeof t=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(t):this.encodeNumber(t):typeof t=="string"?this.encodeString(t):this.useBigInt64&&typeof t=="bigint"?this.encodeBigInt64(t):this.encodeObject(t,r)}ensureBufferSizeToWrite(t){let r=this.pos+t;this.view.byteLength<r&&this.resizeBuffer(r*2)}resizeBuffer(t){let r=new ArrayBuffer(t),n=new Uint8Array(r),o=new DataView(r);n.set(this.bytes),this.view=o,this.bytes=n}encodeNil(){this.writeU8(192)}encodeBoolean(t){t===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(t){!this.forceIntegerToFloat&&Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>
1=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):this.useBigInt64?this.encodeNumberAsFloat(t):(this.writeU8(211),this.writeI64(t)):this.encodeNumberAsFloat(t)}encodeNumberAsFloat(t){this.forceFloat32?(this.writeU8(202),this.writeF32(t)):(this.writeU8(203),this.writeF64(t))}encodeBigInt64(t){t>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(t)):(this.writeU8(211),this.writeBigInt64(t))}writeStringHeader(t){if(t<32)this.writeU8(160+t);else if(t<256)this.writeU8(217),this.writeU8(t);else if(t<65536)this.writeU8(218),this.writeU16(t);else if(t<4294967296)this.writeU8(219),this.writeU32(t);else throw new Error(`Too long string: ${t} bytes in UTF-8`)}encodeString(t){let n=_W(t);this.ensureBufferSizeToWrite(5+n),this.writeStringHeader(n),PW(t,this.bytes,this.pos),this.pos+=n}encodeObject(t,r){let n=this.extensionCodec.tryToEncode(t,this.context);if(n!=null)this.encodeExtension(n);else if(Array.isArray(t))this.encodeArray(t,r);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if(typeof t=="object")this.encodeMap(t,r);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(t)}`)}encodeBinary(t){let r=t.byteLength;if(r<256)this.writeU8(196),this.writeU8(r);else if(r<65536)this.writeU8(197),this.writeU16(r);else if(r<4294967296)this.writeU8(198),this.writeU32(r);else throw new Error(`Too large binary: ${r}`);let n=yx(t);this.writeU8a(n)}encodeArray(t,r){let n=t.length;if(n<16)this.writeU8(144+n);else if(n<65536)this.writeU8(220),this.writeU16(n);else if(n<4294967296)this.writeU8(221),this.writeU32(n);else throw new Error(`Too large array: ${n}`);for(let o of t)this.doEncode(o,r+1)}countWithoutUndefined(t,r){let n=0;for(let o of r)t[o]!==void 0&&n++;return n}encodeMap(t,r){let n=Object.keys(t);this.sortKeys&&n.sort();let o=this.ignoreUndefined?this.countWithoutUndefined(t,n):n.length;if(o<16)this.writeU8(128+o);else if(o<65536)this.writeU8(222),this.writeU16(o);else if(o<4294967296)this.writeU8(223),this.writeU32(o);else throw new Error(`Too large map object: ${o}`);for(let s of n){let i=t[s];this.ignoreUndefined&&i===void 0||(this.encodeString(s),this.doEncode(i,r+1))}}encodeExtension(t){if(typeof t.data=="function"){let n=t.data(this.pos+6),o=n.length;if(o>=4294967296)throw new Error(`Too large extension object: ${o}`);this.writeU8(201),this.writeU32(o),this.writeI8(t.type),this.writeU8a(n);return}let r=t.data.length;if(r===1)this.writeU8(212);else if(r===2)this.writeU8(213);else if(r===4)this.writeU8(214);else if(r===8)this.writeU8(215);else if(r===16)this.writeU8(216);else if(r<256)this.writeU8(199),this.writeU8(r);else if(r<65536)this.writeU8(200),this.writeU16(r);else if(r<4294967296)this.writeU8(201),this.writeU32(r);else throw new Error(`Too large extension object: ${r}`);this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){let r=t.length;this.ensureBufferSizeToWrite(r),this.bytes.set(t,this.pos),this.pos+=r}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),OW(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),WE(this.view,this.pos,t),this.pos+=8}writeBigUint64(t){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,t),this.pos+=8}writeBigInt64(t){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,t),this.pos+=8}}});function wx(e,t){return new GE(t).encodeSharedRef(e)}var LW=h(()=>{UW()});function YE(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}var MW=h(()=>{});var xAe,vAe,JE,HW=h(()=>{qE();xAe=16,vAe=16,JE=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(t=xAe,r=vAe){this.maxKeyLength=t,this.maxLengthPerKey=r,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(t){return t>0&&t<=this.maxKeyLength}find(t,r,n){let o=this.caches[n-1];e:for(let s of o){let i=s.bytes;for(let a=0;a<n;a++)if(i[a]!==t[r+a])continue e;return s.str}return null}store(t,r){let n=this.caches[t.length-1],o={bytes:t,str:r};n.length>=this.maxLengthPerKey?n[Math.random()*n.length|0]=o:n.push(o)}decode(t,r,n){let o=this.find(t,r,n);if(o!=null)return this.hit++,o;this.miss++;let s=AN(t,r,n),i=Uint8Array.prototype.slice.call(t,r,r+n);return this.store(i,s),s}}});var TN,vx,FW,EAe,_N,xx,PN,AAe,$W,CAe,QE,VW=h(()=>{MW();SN();ZE();qE();IN();HW();CN();TN="array",vx="map_key",FW="map_value",EAe=e=>{if(typeof e=="string"||typeof e=="number")return e;throw new oi("The type of key must be string or number but "+typeof e)},_N=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(t){let r=this.getUninitializedStateFromPool();r.type=TN,r.position=0,r.size=t,r.array=new Array(t)}pushMapState(t){let r=this.getUninitializedStateFromPool();r.type=vx,r.readCount=0,r.size=t,r.map={}}
vendor: 6,753 bytes, line 1
1getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let t={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(t)}return this.stack[this.stackHeadPosition]}release(t){if(this.stack[this.stackHeadPosition]!==t)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(t.type===TN){let n=t;n.size=0,n.array=void 0,n.position=0,n.type=void 0}if(t.type===vx||t.type===FW){let n=t;n.size=0,n.map=void 0,n.readCount=0,n.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}},xx=-1,PN=new DataView(new ArrayBuffer(0)),AAe=new Uint8Array(PN.buffer);try{PN.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}$W=new RangeError("Insufficient data"),CAe=new JE,QE=class e{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=PN;bytes=AAe;headByte=xx;stack=new _N;entered=!1;constructor(t){this.extensionCodec=t?.extensionCodec??L2.defaultCodec,this.context=t?.context,this.useBigInt64=t?.useBigInt64??!1,this.rawStrings=t?.rawStrings??!1,this.maxStrLength=t?.maxStrLength??4294967295,this.maxBinLength=t?.maxBinLength??4294967295,this.maxArrayLength=t?.maxArrayLength??4294967295,this.maxMapLength=t?.maxMapLength??4294967295,this.maxExtLength=t?.maxExtLength??4294967295,this.keyDecoder=t?.keyDecoder!==void 0?t.keyDecoder:CAe,this.mapKeyConverter=t?.mapKeyConverter??EAe}clone(){return new e({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=xx,this.stack.reset()}setBuffer(t){let r=yx(t);this.bytes=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength),this.pos=0}appendBuffer(t){if(this.headByte===xx&&!this.hasRemaining(1))this.setBuffer(t);else{let r=this.bytes.subarray(this.pos),n=yx(t),o=new Uint8Array(r.length+n.length);o.set(r),o.set(n,r.length),this.setBuffer(o)}}hasRemaining(t){return this.view.byteLength-this.pos>=t}createExtraByteError(t){let{view:r,pos:n}=this;return new RangeError(`Extra ${r.byteLength-n} of ${r.byteLength} byte(s) found at buffer[${t}]`)}decode(t){if(this.entered)return this.clone().decode(t);try{this.entered=!0,this.reinitializeState(),this.setBuffer(t);let r=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return r}finally{this.entered=!1}}*decodeMulti(t){if(this.entered){yield*this.clone().decodeMulti(t);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(t);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(t){if(this.entered)return this.clone().decodeAsync(t);try{this.entered=!0;let r=!1,n;for await(let a of t){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{n=this.doDecodeSync(),r=!0}catch(c){if(!(c instanceof RangeError))throw c}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return n}let{headByte:o,pos:s,totalPos:i}=this;throw new RangeError(`Insufficient data in parsing ${YE(o)} at ${i} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(t){return this.decodeMultiAsync(t,!0)}decodeStream(t){return this.decodeMultiAsync(t,!1)}async*decodeMultiAsync(t,r){if(this.entered){yield*this.clone().decodeMultiAsync(t,r);return}try{this.entered=!0;let n=r,o=-1;for await(let s of t){if(r&&o===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),n&&(o=this.readArraySize(),n=!1,this.complete());try{for(;yield this.doDecodeSync(),--o!==0;);}catch(i){if(!(i instanceof RangeError))throw i}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){e:for(;;){let t=this.readHeadByte(),r;if(t>=224)r=t-256;else if(t<192)if(t<128)r=t;else if(t<144){let o=t-128;if(o!==0){this.pushMapState(o),this.complete();continue e}else r={}}else if(t<160){let o=t-144;if(o!==0){this.pushArrayState(o),this.complete();continue e}else r=[]}else{let o=t-160;r=this.decodeString(o,0)}else if(t===192)r=null;else if(t===194)r=!1;else if(t===195)r=!0;else if(t===202)r=this.readF32();else if(t===203)r=this.readF64();else if(t===204)r=this.readU8();else if(t===205)r=this.readU16();else if(t===206)r=this.readU32();else if(t===207)this.useBigInt64?r=this.readU64AsBigInt():r=this.readU64();else if(t===208)r=this.readI8();else if(t===209)r=this.readI16();else if(t===210)r=this.readI32();else if(t===211)this.useBigInt64?r=this.readI64AsBigInt():r=this.readI64();else if(t===217){let o=this.lookU8();r=this.decodeString(o,1)}else if(t===218){let o=this.lookU16();r=this.decodeString(o,2)}else if(t===219){let o=this.lookU32();r=this.decodeString(o,4)}else if(t===220){let o=this.readU16();if(o!==0){this.pushArrayState(o),this.complete();continue e}else r=[]}else if(t===221){let o=this.readU32();if(o!==0){this.pushArrayState(o),this.complete();continue e}else r=[]}else if(t===222){let o=this.readU16();if(o!==0){this.pushMapState(o),this.complete();continue e}else r={}}else if(t===223){let o=this.readU32();if(o!==0){this.pushMapState(o),this.complete();continue e}else r={}}else if(t===196){let o=this.lookU8();r=this.decodeBinary(o,1)}else if(t===197){let o=this.lookU16();r=this.decodeBinary(o,2)}else if(t===198){let o=this.lookU32();r=this.decodeBinary(o,4)}else if(t===212)r=this.decodeExtension(1,0);else if(t===213)r=this.decodeExtension(2,0);else if(t===214)r=this.decodeExtension(4,0);else if(t===215)r=this.decodeExtension(8,0);else if(t===216)r=this.decodeExtension(16,0);else if(t===199){let o=this.lookU8();r=this.decodeExtension(o,1)}else if(t===200){let o=this.lookU16();r=this.decodeExtension(o,2)}else if(t===201){let o=this.lookU32();r=this.decodeExtension(o,4)}else throw new oi(`Unrecognized type byte: ${YE(t)}`);this.complete();let n=this.stack;for(;n.length>0;){let o=n.top();if(o.type===TN)if(o.array[o.position]=r,o.position++,o.position===o.size)r=o.array,n.release(o);else continue e;else if(o.type===vx){if(r==="__proto__")throw new oi("The key __proto__ is not allowed");o.key=this.mapKeyConverter(r),o.type=FW;continue e}else if(o.map[o.key]=r,o.readCount++,o.readCount===o.size)r=o.map,n.release(o);else{o.key=null,o.type=vx;continue e}}return r}}readHeadByte(){return this.headByte===xx&&(this.headByte=this.readU8()),this.headByte}
1complete(){this.headByte=xx}readArraySize(){let t=this.readHeadByte();switch(t){case 220:return this.readU16();case 221:return this.readU32();default:{if(t<160)return t-144;throw new oi(`Unrecognized array type byte: ${YE(t)}`)}}}pushMapState(t){if(t>this.maxMapLength)throw new oi(`Max length exceeded: map length (${t}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(t)}pushArrayState(t){if(t>this.maxArrayLength)throw new oi(`Max length exceeded: array length (${t}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(t)}decodeString(t,r){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(t,r):this.decodeBinary(t,r)}decodeUtf8String(t,r){if(t>this.maxStrLength)throw new oi(`Max length exceeded: UTF-8 byte length (${t}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+r+t)throw $W;let n=this.pos+r,o;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(t)?o=this.keyDecoder.decode(this.bytes,n,t):o=NW(this.bytes,n,t),this.pos+=r+t,o}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===vx:!1}decodeBinary(t,r){if(t>this.maxBinLength)throw new oi(`Max length exceeded: bin length (${t}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(t+r))throw $W;let n=this.pos+r,o=this.bytes.subarray(n,n+t);return this.pos+=r+t,o}decodeExtension(t,r){if(t>this.maxExtLength)throw new oi(`Max length exceeded: ext length (${t}) > maxExtLength (${this.maxExtLength})`);let n=this.view.getInt8(this.pos+r),o=this.decodeBinary(t,r+1);return this.extensionCodec.decode(o,n,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let t=this.view.getUint8(this.pos);return this.pos++,t}readI8(){let t=this.view.getInt8(this.pos);return this.pos++,t}readU16(){let t=this.view.getUint16(this.pos);return this.pos+=2,t}readI16(){let t=this.view.getInt16(this.pos);return this.pos+=2,t}readU32(){let t=this.view.getUint32(this.pos);return this.pos+=4,t}readI32(){let t=this.view.getInt32(this.pos);return this.pos+=4,t}readU64(){let t=BW(this.view,this.pos);return this.pos+=8,t}readI64(){let t=KE(this.view,this.pos);return this.pos+=8,t}readU64AsBigInt(){let t=this.view.getBigUint64(this.pos);return this.pos+=8,t}readI64AsBigInt(){let t=this.view.getBigInt64(this.pos);return this.pos+=8,t}readF32(){let t=this.view.getFloat32(this.pos);return this.pos+=4,t}readF64(){let t=this.view.getFloat64(this.pos);return this.pos+=8,t}}});function Ex(e,t){return new QE(t).decode(e)}var zW=h(()=>{VW()});var NN=h(()=>{LW();zW()});var jW=h(()=>{});function Fm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}var Ax=h(()=>{});function Cx(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Fm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}var XE=h(()=>{Ax()});function _s(e,t){t||(t=e.reduce((o,s)=>o+s.length,0));let r=Cx(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return Fm(r)}var qW=h(()=>{XE();Ax()});var WW=h(()=>{});function SAe(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var g=0,y=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,g++;for(var w=(C-b)*u+1>>>0,x=new Uint8Array(w);b!==C;){for(var S=m[b],P=0,D=w-1;(S!==0||P<y)&&D!==-1;D--,P++)S+=256*x[D]>>>0,x[D]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,b++}for(var U=w-y;U!==w&&x[U]===0;)U++;for(var N=c.repeat(g);U<w;++U)N+=e.charAt(x[U]);return N}function p(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var g=0;if(m[g]!==" "){for(var y=0,b=0;m[g]===c;)y++,g++;for(var C=(m.length-g)*l+1>>>0,w=new Uint8Array(C);m[g];){var x=r[m.charCodeAt(g)];if(x===255)return;for(var S=0,P=C-1;(x!==0||S<b)&&P!==-1;P--,S++)x+=a*w[P]>>>0,w[P]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");b=S,g++}if(m[g]!==" "){for(var D=C-b;D!==C&&w[D]===0;)D++;for(var U=new Uint8Array(y+(C-D)),N=y;D!==C;)U[N++]=w[D++];return U}}}function f(m){var g=p(m);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:p,decode:f}}var IAe,TAe,KW,ZW=h(()=>{IAe=SAe,TAe=IAe,KW=TAe});var vrt,GW,Ld,YW,JW,Nf=h(()=>{vrt=new Uint8Array(0),GW=(e,t)=>{if(e===t)return!0;
1if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},Ld=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},YW=e=>new TextEncoder().encode(e),JW=e=>new TextDecoder().decode(e)});var RN,ON,BN,XW,kN,M2,Rf,_Ae,PAe,cn,wc=h(()=>{ZW();Nf();RN=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},ON=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return XW(this,t)}},BN=class{constructor(t){this.decoders=t}or(t){return XW(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},XW=(e,t)=>new BN({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),kN=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new RN(t,r,n),this.decoder=new ON(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},M2=({name:e,prefix:t,encode:r,decode:n})=>new kN(e,t,r,n),Rf=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=KW(r,t);return M2({prefix:e,name:t,encode:n,decode:s=>Ld(o(s))})},_Ae=(e,t,r,n)=>{let o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let s=e.length;for(;e[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),a=0,c=0,l=0;for(let u=0;u<s;++u){let d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,i[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i},PAe=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,s="",i=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],i+=8;i>r;)i-=r,s+=t[o&a>>i];if(i&&(s+=t[o&a<<r-i]),n)for(;s.length*r&7;)s+="=";return s},cn=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>M2({prefix:t,name:e,encode(o){return PAe(o,n,r)},decode(o){return _Ae(o,n,r,e)}})});var DN={};Ce(DN,{identity:()=>NAe});var NAe,eK=h(()=>{wc();Nf();NAe=M2({prefix:"\0",name:"identity",encode:e=>JW(e),decode:e=>YW(e)})});var UN={};Ce(UN,{base2:()=>RAe});var RAe,tK=h(()=>{wc();RAe=cn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})});var LN={};Ce(LN,{base8:()=>OAe});var OAe,rK=h(()=>{wc();OAe=cn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})});var MN={};Ce(MN,{base10:()=>BAe});var BAe,nK=h(()=>{wc();BAe=Rf({prefix:"9",name:"base10",alphabet:"0123456789"})});var HN={};Ce(HN,{base16:()=>kAe,base16upper:()=>DAe});var kAe,DAe,oK=h(()=>{wc();kAe=cn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),DAe=cn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});var $N={};Ce($N,{base32:()=>H2,base32hex:()=>HAe,base32hexpad:()=>FAe,base32hexpadupper:()=>VAe,base32hexupper:()=>$Ae,base32pad:()=>LAe,base32padupper:()=>MAe,base32upper:()=>UAe,base32z:()=>zAe});var H2,UAe,LAe,MAe,HAe,$Ae,FAe,VAe,zAe,FN=h(()=>{wc();H2=cn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),UAe=cn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),LAe=cn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),MAe=cn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),HAe=cn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),$Ae=cn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),FAe=cn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),VAe=cn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),zAe=cn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})});var VN={};Ce(VN,{base36:()=>jAe,base36upper:()=>qAe});var jAe,qAe,sK=h(()=>{wc();jAe=Rf({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),qAe=Rf({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})});var zN={};Ce(zN,{base58btc:()=>xl,base58flickr:()=>WAe});var xl,WAe,jN=h(()=>{wc();
1xl=Rf({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),WAe=Rf({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});var qN={};Ce(qN,{base64:()=>KAe,base64pad:()=>ZAe,base64url:()=>GAe,base64urlpad:()=>YAe});var KAe,ZAe,GAe,YAe,iK=h(()=>{wc();KAe=cn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ZAe=cn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),GAe=cn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),YAe=cn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});var WN={};Ce(WN,{base256emoji:()=>tCe});function XAe(e){return e.reduce((t,r)=>(t+=JAe[r],t),"")}function eCe(e){let t=[];for(let r of e){let n=QAe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}var aK,JAe,QAe,tCe,cK=h(()=>{wc();aK
vendor: 2,242 bytes, line 1
1=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),
1JAe=aK.reduce((e,t,r)=>(e[r]=t,e),[]),QAe=aK.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);tCe=M2({prefix:"\u{1F680}",name:"base256emoji",encode:XAe,decode:eCe})});function dK(e,t,r){t=t||[],r=r||0;for(var n=r;e>=sCe;)t[r++]=e&255|lK,e/=128;for(;e&oCe;)t[r++]=e&255|lK,e>>>=7;return t[r]=e|0,dK.bytes=r-n+1,t}function KN(e,n){var r=0,n=n||0,o=0,s=n,i,a=e.length;do{if(s>=a)throw KN.bytes=0,new RangeError("Could not decode varint");i=e[s++],r+=o<28?(i&uK)<<o:(i&uK)*Math.pow(2,o),o+=7}while(i>=aCe);return KN.bytes=s-n,r}var rCe,lK,nCe,oCe,sCe,iCe,aCe,uK,cCe,lCe,uCe,dCe,pCe,fCe,hCe,mCe,gCe,yCe,wCe,bCe,Sx,pK=h(()=>{rCe=dK,lK=128,nCe=127,oCe=~nCe,sCe=Math.pow(2,31);iCe=KN,aCe=128,uK=127;cCe=Math.pow(2,7),lCe=Math.pow(2,14),uCe=Math.pow(2,21),dCe=Math.pow(2,28),pCe=Math.pow(2,35),fCe=Math.pow(2,42),hCe=Math.pow(2,49),mCe=Math.pow(2,56),gCe=Math.pow(2,63),yCe=function(e){return e<cCe?1:e<lCe?2:e<uCe?3:e<dCe?4:e<pCe?5:e<fCe?6:e<hCe?7:e<mCe?8:e<gCe?9:10},wCe={encode:rCe,decode:iCe,encodingLength:yCe},bCe=wCe,Sx=bCe});var Ix,$2,F2,tA=h(()=>{pK();Ix=(e,t=0)=>[Sx.decode(e,t),Sx.decode.bytes],$2=(e,t,r=0)=>(Sx.encode(e,t,r),t),F2=e=>Sx.encodingLength(e)});var Vm,fK,hK,V2,_x=h(()=>{Nf();tA();Vm=(e,t)=>{let r=t.byteLength,n=F2(e),o=n+F2(r),s=new Uint8Array(o+r);return $2(e,s,0),$2(r,s,n),s.set(t,o),new V2(e,r,t,s)},fK=e=>{let t=Ld(e),[r,n]=Ix(t),[o,s]=Ix(t.subarray(n)),i=t.subarray(n+s);if(i.byteLength!==o)throw new Error("Incorrect length");return new V2(r,o,i,t)},hK=(e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&GW(e.bytes,t.bytes),V2=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}}});var GN,ZN,YN=h(()=>{_x();GN=({name:e,code:t,encode:r})=>new ZN(e,t,r),ZN=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?Vm(this.code,r):r.then(n=>Vm(this.code,n))}else throw Error("Unknown type, must be binary type")}}});var JN={};Ce(JN,{sha256:()=>xCe,sha512:()=>vCe});var gK,xCe,vCe,yK=h(()=>{YN();gK=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),xCe=GN({name:"sha2-256",code:18,encode:gK("SHA-256")}),vCe=GN({name:"sha2-512",code:19,encode:gK("SHA-512")})});var QN={};Ce(QN,{identity:()=>CCe});var wK,ECe,bK,ACe,CCe,xK=h(()=>{Nf();_x();wK=0,ECe="identity",bK=Ld,ACe=e=>Vm(wK,bK(e)),CCe={code:wK,name:ECe,encode:bK,digest:ACe}});var vK=h(()=>{Nf()});var Vrt,zrt,EK=h(()=>{Vrt=new TextEncoder,zrt=new TextDecoder});var oA,TCe,_Ce,PCe,Px,NCe,AK,CK,rA,nA,RCe,OCe,BCe,SK=h(()=>{tA();_x();jN();FN();Nf();oA=class e{constructor(t,r,n,o){this.code=r,this.version=t,this.multihash=n,this.bytes=o,this.byteOffset=o.byteOffset,this.byteLength=o.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:nA,byteLength:nA,code:rA,version:rA,multihash:rA,bytes:rA,_baseCache:nA,asCID:nA})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:r}=this;if(t!==Px)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==NCe)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return e.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Vm(t,r);return e.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(t){return t&&this.code===t.code&&this.version===t.version&&hK(this.multihash,t.multihash)}toString(t){let{bytes:r,version:n,_baseCache:o}=this;return n===0?_Ce(r,o,t||xl.encoder):PCe(r,o,t||H2.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(t){return OCe(/^0\.0/,BCe),!!(t&&(t[CK]||t.asCID===t))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(t){if(t instanceof e)return t;if(t!=null&&t.asCID===t){let{version:r,code:n,multihash:o,bytes:s}=t;return new e(r,n,o,s||AK(r,n,o.bytes))}else if(t!=null&&t[CK]===!0){let{version:r,multihash:n,code:o}=t,s=fK(n);return e.create(r,o,s)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(t){case 0:{if(r!==Px)throw new Error(`Version 0 CID must use dag-pb (code: ${Px}) block encoding`);return new e(t,r,n,n.bytes)}
1case 1:{let o=AK(t,r,n.bytes);return new e(t,r,n,o)}default:throw new Error("Invalid version")}}static createV0(t){return e.create(0,Px,t)}static createV1(t,r){return e.create(1,t,r)}static decode(t){let[r,n]=e.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=e.inspectBytes(t),n=r.size-r.multihashSize,o=Ld(t.subarray(n,n+r.multihashSize));if(o.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=o.subarray(r.multihashSize-r.digestSize),i=new V2(r.multihashCode,r.digestSize,s,o);return[r.version===0?e.createV0(i):e.createV1(r.codec,i),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[d,p]=Ix(t.subarray(r));return r+=p,d},o=n(),s=Px;if(o===18?(o=0,r=0):o===1&&(s=n()),o!==0&&o!==1)throw new RangeError(`Invalid CID version ${o}`);let i=r,a=n(),c=n(),l=r+c,u=l-i;return{version:o,codec:s,multihashCode:a,digestSize:c,multihashSize:u,size:l}}static parse(t,r){let[n,o]=TCe(t,r),s=e.decode(o);return s._baseCache.set(n,t),s}},TCe=(e,t)=>{switch(e[0]){case"Q":{let r=t||xl;return[xl.prefix,r.decode(`${xl.prefix}${e}`)]}case xl.prefix:{let r=t||xl;return[xl.prefix,r.decode(e)]}case H2.prefix:{let r=t||H2;return[H2.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},_Ce=(e,t,r)=>{let{prefix:n}=r;if(n!==xl.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let o=t.get(n);if(o==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return o},PCe=(e,t,r)=>{let{prefix:n}=r,o=t.get(n);if(o==null){let s=r.encode(e);return t.set(n,s),s}else return o},Px=112,NCe=18,AK=(e,t,r)=>{let n=F2(e),o=n+F2(t),s=new Uint8Array(o+r.byteLength);return $2(e,s,0),$2(t,s,n),s.set(r,o),s},CK=Symbol.for("@ipld/js-cid/CID"),rA={writable:!1,configurable:!1,enumerable:!0},nA={writable:!1,enumerable:!1,configurable:!1},RCe="0.0.0-dev",OCe=(e,t)=>{if(e.test(RCe))console.warn(t);else throw new Error(t)},BCe=`CID.isCID(v) is deprecated and will be removed in the next major release.
2Following code pattern:
3
4if (CID.isCID(value)) {
5  doSomethingWithCID(value)
6}
7
8Is replaced with:
9
10const cid = CID.asCID(value)
11if (cid) {
12  // Make sure to use cid instead of value
13  doSomethingWithCID(cid)
14}
15`});var IK=h(()=>{SK();tA();Nf();YN();_x()});var XN,Jrt,TK=h(()=>{eK();tK();rK();nK();oK();FN();sK();jN();iK();cK();yK();xK();vK();EK();IK();XN={...DN,...UN,...LN,...MN,...HN,...$N,...VN,...zN,...qN,...WN},Jrt={...JN,...QN}});function PK(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var _K,eR,kCe,sA,tR=h(()=>{TK();XE();_K=PK("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),eR=PK("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=Cx(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),kCe={utf8:_K,"utf-8":_K,hex:XN.base16,latin1:eR,ascii:eR,binary:eR,...XN},sA=kCe});function Yt(e,t="utf8"){let r=sA[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Fm(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}var rR=h(()=>{tR();Ax()});function Rt(e,t="utf8"){let r=sA[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}var NK=h(()=>{tR()});var RK=h(()=>{XE();Ax()});var Nx=h(()=>{jW();qW();WW();rR();NK();RK()});function Rs(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return DSe(e)}catch{return e}}function si(e){return typeof e=="string"?e:kSe(e)||""}var kSe,DSe,Wm=h(()=>{kSe=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),DSe=e=>{let t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,o)=>
vendor: 13,493 bytes, line 15
15typeof o=="string"&&o.match(/^\d+n$/)?BigInt(o.substring(0,o.length-1)):o)}});function USe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function qZ(e,...t){if(!USe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function IZ(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function LSe(e,t){qZ(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function MSe(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function WZ(e){return typeof e=="string"&&(e=MSe(e)),qZ(e),e}function HSe(e){let t=n=>e().update(WZ(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function KZ(e=32){if(Q2&&typeof Q2.getRandomValues=="function")return Q2.getRandomValues(new Uint8Array(e));if(Q2&&typeof Q2.randomBytes=="function")return Q2.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function $Se(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function ZZ(e,t=!1){return t?{h:Number(e&gA),l:Number(e>>LR&gA)}:{h:Number(e>>LR&gA)|0,l:Number(e&gA)|0}}function FSe(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:s,l:i}=ZZ(e[o],t);[r[o],n[o]]=[s,i]}return[r,n]}function tIe(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}function YR(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function JR(e){if(!YR(e))throw new Error("Uint8Array expected")}function _R(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function QR(e){JR(e);let t="";for(let r=0;r<e.length;r++)t+=pIe[e[r]];return t}function YZ(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?GR:BigInt("0x"+e)}function TZ(e){if(e>=Wd._0&&e<=Wd._9)return e-Wd._0;if(e>=Wd.A&&e<=Wd.F)return e-(Wd.A-10);if(e>=Wd.a&&e<=Wd.f)return e-(Wd.a-10)}function JZ(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=TZ(e.charCodeAt(s)),a=TZ(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function fIe(e){return YZ(QR(e))}function bA(e){return JR(e),YZ(QR(Uint8Array.from(e).reverse()))}function QZ(e,t){return JZ(e.toString(16).padStart(t*2,"0"))}function HR(e,t){return QZ(e,t).reverse()}function Kd(e,t,r){let n;if(typeof t=="string")try{n=JZ(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(YR(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function _Z(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];JR(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function hIe(e,t,r){return PR(e)&&PR(t)&&PR(r)&&t<=e&&e<r}function Lx(e,t,r,n){if(!hIe(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function mIe(e){let t;for(t=0;e>GR;e>>=GZ,t+=1);return t}function XR(e,t,r={}){let n=(o,s,i)=>{let a=yIe[s];if(typeof a!="function")throw new Error("invalid validator function");let c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+c)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(r))n(o,s,!0);return e}function PZ(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}function zn(e,t){let r=e%t;return r>=ro?r:t+r}function bIe(e,t,r){if(t<ro)throw new Error("invalid exponent, negatives unsupported");if(r<=ro)throw new Error("invalid modulus");if(r===gn)return ro;let n=gn;for(;t>ro;)t&gn&&(n=n*e%r),e=e*e%r,t>>=gn;return n}function El(e,t,r){let n=e;for(;t-- >ro;)n*=n,n%=r;return n}function OZ(e,t){if(e===ro)throw new Error("invert: expected non-zero number");if(t<=ro)throw new Error("invert: expected positive modulus, got "+t);let r=zn(e,t),n=t,o=ro,s=gn;for(;r!==ro;){let i=n/r,a=n%r,c=o-s*i;n=r,r=a,o=s,s=c}if(n!==gn)throw new Error("invert: does not exist");return zn(o,t)}function xIe(e){let t=(e-gn)/Km,r,n,o;for(r=e-gn,n=0;r%Km===ro;r/=Km,n++);for(o=Km;o<e&&bIe(o,t,e)!==e-gn;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){let i=(e+gn)/$R;return function(a,c){let l=a.pow(c,i);if(!a.eql(a.sqr(l),c))throw new Error("Cannot find square root");return l}}let s=(r+gn)/Km;return function(i,a){if(i.pow(a,t)===i.neg(i.ONE))throw new Error("Cannot find square root");let c=n,l=i.pow(i.mul(i.ONE,o),r),u=i.pow(a,s),d=i.pow(a,r);for(;!i.eql(d,i.ONE);){if(i.eql(d,i.ZERO))return i.ZERO;let p=1;for(let m=i.sqr(d);p<c&&!i.eql(m,i.ONE);p++)m=i.sqr(m);let f=i.pow(l,gn<<BigInt(c-p-1));l=i.sqr(f),u=i.mul(u,f),d=i.mul(d,l),c=p}return u}}function vIe(e){if(e%$R===wIe){let t=(e+gn)/$R;return function(r,n){let o=r.pow(n,t);if(!r.eql(r.sqr(o),n))throw new Error("Cannot find square root");return o}}if(e%RZ===NZ){let t=(e-NZ)/RZ;return function(r,n){let o=r.mul(n,Km),s=r.pow(o,t),i=r.mul(n,s),a=r.mul(r.mul(i,Km),s),c=r.mul(i,r.sub(a,r.ONE));if(!r.eql(r.sqr(c),n))throw new Error("Cannot find square root");return c}}return xIe(e)}function CIe(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=AIe.reduce((n,o)=>(n[o]="function",n),t);return XR(e,r)}function SIe(e,t,r){if(r<ro)throw new Error("invalid exponent, negatives unsupported");if(r===ro)return e.ONE;if(r===gn)return t;let n=e.ONE,o=t;for(;r>ro;)r&gn&&(n=e.mul(n,o)),o=e.sqr(o),r>>=gn;return n}function IIe(e,t){let r=new Array(t.length),n=t.reduce((s,i,a)=>e.is0(i)?s:(r[a]=s,e.mul(s,i)),e.ONE),o=e.inv(n);return t.reduceRight((s,i,a)=>e.is0(i)?s:(r[a]=e.mul(s,r[a]),e.mul(s,i)),o),r}function XZ(e,t){let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function eG(e,t,r=!1,n={}){if(e<=ro)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=XZ(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i,a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:gIe(o),ZERO:ro,ONE:gn,create:c=>zn(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return ro<=c&&c<e},is0:c=>c===ro,isOdd:c=>(c&gn)===gn,neg:c=>zn(-c,e),eql:(c,l)=>c===l,sqr:c=>zn(c*c,e),add:(c,l)=>zn(c+l,e),sub:(c,l)=>zn(c-l,e),mul:(c,l)=>zn(c*l,e),pow:(c,l)=>SIe(a,c,l),div:(c,l)=>zn(c*OZ(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>OZ(c,e),sqrt:n.sqrt||(c=>(i||(i=vIe(e)),i(a,c))),invertBatch:c=>IIe(a,c),cmov:(c,l,u)=>u?l:c,toBytes:c=>r?HR(c,s):QZ(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?bA(c):fIe(c)}});return Object.freeze(a)}function NR(e,t){let r=t.negate();return e?r:t}function tG(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function RR(e,t){tG(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function TIe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function _Ie(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}function BR(e){return rG.get(e)||1}function PIe(e,t){return{constTimeNegate:NR,hasPrecomputes(r){return BR(r)!==1},unsafeLadder(r,n,o=e.ZERO){let s=r;for(;n>BZ;)n&yA&&(o=o.add(s)),s=s.double(),n>>=yA;return o},precomputeWindow(r,n){let{windows:o,windowSize:s}=RR(n,t),i=[],a=r,c=a;for(let l=0;l<o;l++){c=a,i.push(c);for(let u=1;u<s;u++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(r,n,o){let{windows:s,windowSize:i}=RR(r,t),a=e.ZERO,c=e.BASE,l=BigInt(2**r-1),u=2**r,d=BigInt(r);for(let p=0;p<s;p++){let f=p*i,m=Number(o&l);o>>=d,m>i&&(m-=u,o+=yA);let g=f,y=f+Math.abs(m)-1,b=p%2!==0,C=m<0;m===0?c=c.add(NR(b,n[g])):a=a.add(NR(C,n[y]))}return{p:a,f:c}},wNAFUnsafe(r,n,o,s=e.ZERO){let{windows:i,windowSize:a}=RR(r,t),c=BigInt(2**r-1),l=2**r,u=BigInt(r);for(let d=0;d<i;d++){let p=d*a;if(o===BZ)break;let f=Number(o&c);if(o>>=u,f>a&&(f-=l,o+=yA),f===0)continue;let m=n[p+Math.abs(f)-1];f<0&&(m=m.negate()),s=s.add(m)}return s},getPrecomputes(r,n,o){let s=OR.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&OR.set(n,o(s))),s},wNAFCached(r,n,o){let s=BR(r);return this.wNAF(s,this.getPrecomputes(s,r,o),n)},wNAFCachedUnsafe(r,n,o,s){let i=BR(r);return i===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,r,o),n,s)},setWindowSize(r,n){tG(n,t),rG.set(r,n),OR.delete(r)}}}function NIe(e,t,r,n){if(TIe(r,e),_Ie(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");let o=e.ZERO,s=mIe(BigInt(r.length)),i=s>12?s-3:s>4?s-2:s?2:1,a=(1<<i)-1,c=new Array(a+1).fill(o),l=Math.floor((t.BITS-1)/i)*i,u=o;for(let d=l;d>=0;d-=i){c.fill(o);for(let f=0;f<n.length;f++){let m=n[f],g=Number(m>>BigInt(d)&BigInt(a));c[g]=c[g].add(r[f])}let p=o;for(let f=c.length-1,m=o;f>0;f--)m=m.add(c[f]),p=p.add(m);if(u=u.add(p),d!==0)for(let f=0;f<i;f++)u=u.double()}return u}function RIe(e){return CIe(e.Fp),XR(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XZ(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function kIe(e){let t=RIe(e);return XR(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function DIe(e){let t=kIe(e),{Fp:r,n,prehash:o,hash:s,randomBytes:i,nByteLength:a,h:c}=t,l=wA<<BigInt(a*8)-ii,u=r.create,d=eG(t.n,t.nBitLength),p=t.uvRatio||((v,E)=>{try{return{isValid:!0,value:r.sqrt(v*r.inv(E))}}catch{return{isValid:!1,value:bc}}}),f=t.adjustScalarBytes||(v=>v),m=t.domain||((v,E,O)=>{if(_R("phflag",O),E.length||O)throw new Error("Contexts/pre-hash are not supported");return v});function g(v,E){Lx("coordinate "+v,E,bc,l)}function y(v){if(!(v instanceof w))throw new Error("ExtendedPoint expected")}let b=PZ((v,E)=>{let{ex:O,ey:B,ez:_}=v,M=v.is0();E==null&&(E=M?OIe:r.inv(_));let F=u(O*E),q=u(B*E),oe=u(_*E);if(M)return{x:bc,y:ii};if(oe!==ii)throw new Error("invZ was invalid");return{x:F,y:q}}),C=PZ(v=>{let{a:E,d:O}=t;if(v.is0())throw new Error("bad point: ZERO");let{ex:B,ey:_,ez:M,et:F}=v,q=u(B*B),oe=u(_*_),Q=u(M*M),Y=u(Q*Q),pe=u(q*E),he=u(Q*u(pe+oe)),Te=u(Y+u(O*u(q*oe)));if(he!==Te)throw new Error("bad point: equation left != right (1)");let me=u(B*_),_e=u(M*F);if(me!==_e)throw new Error("bad point: equation left != right (2)");return!0});class w{constructor(E,O,B,_){this.ex=E,this.ey=O,this.ez=B,this.et=_,g("x",E),g("y",O),g("z",B),g("t",_),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(E){if(E instanceof w)throw new Error("extended point not allowed");let{x:O,y:B}=E||{};return g("x",O),g("y",B),new w(O,B,ii,u(O*B))}static normalizeZ(E){let O=r.invertBatch(E.map(B=>B.ez));return E.map((B,_)=>B.toAffine(O[_])).map(w.fromAffine)}static msm(E,O){return NIe(w,d,E,O)}_setWindowSize(E){P.setWindowSize(this,E)}assertValidity(){C(this)}equals(E){y(E);let{ex:O,ey:B,ez:_}=this,{ex:M,ey:F,ez:q}=E,oe=u(O*q),Q=u(M*_),Y=u(B*q),pe=u(F*_);return oe===Q&&Y===pe}is0(){return this.equals(w.ZERO)}negate(){return new w(u(-this.ex),this.ey,this.ez,u(-this.et))}double(){let{a:E}=t,{ex:O,ey:B,ez:_}=this,M=u(O*O),F=u(B*B),q=u(wA*u(_*_)),oe=u(E*M),Q=O+B,Y=u(u(Q*Q)-M-F),pe=oe+F,he=pe-q,Te=oe-F,me=u(Y*he),_e=u(pe*Te),wt=u(Y*Te),Nt=u(he*pe);return new w(me,_e,Nt,wt)}add(E){y(E);let{a:O,d:B}=t,{ex:_,ey:M,ez:F,et:q}=this,{ex:oe,ey:Q,ez:Y,et:pe}=E;if(O===BigInt(-1)){let Wz=u((M-_)*(Q+oe)),Kz=u((M+_)*(Q-oe)),lP=u(Kz-Wz);if(lP===bc)return this.double();let Zz=u(F*wA*pe),Gz=u(q*wA*Y),Yz=Gz+Zz,Jz=Kz+Wz,Qz=Gz-Zz,Ave=u(Yz*lP),Cve=u(Jz*Qz),Sve=u(Yz*Qz),Ive=u(lP*Jz);return new w(Ave,Cve,Ive,Sve)}let he=u(_*oe),Te=u(M*Q),me=u(q*B*pe),_e=u(F*Y),wt=u((_+M)*(oe+Q)-he-Te),Nt=_e-me,bt=_e+me,ar=u(Te-O*he),Ar=u(wt*Nt),fl=u(bt*ar),vve=u(wt*ar),Eve=u(Nt*bt);return new w(Ar,fl,Eve,vve)}subtract(E){return this.add(E.negate())}wNAF(E){return P.wNAFCached(this,E,w.normalizeZ)}multiply(E){let O=E;Lx("scalar",O,ii,n);let{p:B,f:_}=this.wNAF(O);return w.normalizeZ([B,_])[0]}multiplyUnsafe(E,O=w.ZERO){let B=E;return Lx("scalar",B,bc,n),B===bc?S:this.is0()||B===ii?this:P.wNAFCachedUnsafe(this,B,w.normalizeZ,O)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return P.unsafeLadder(this,n).is0()}toAffine(E){return b(this,E)}clearCofactor(){let{h:E}=t;return E===ii?this:this.multiplyUnsafe(E)}static fromHex(E,O=!1){let{d:B,a:_}=t,M=r.BYTES;
vendor: 7,258 bytes, line 15
15E=Kd("pointHex",E,M),_R("zip215",O);let F=E.slice(),q=E[M-1];F[M-1]=q&-129;let oe=bA(F),Q=O?l:r.ORDER;Lx("pointHex.y",oe,bc,Q);let Y=u(oe*oe),pe=u(Y-ii),he=u(B*Y-_),{isValid:Te,value:me}=p(pe,he);if(!Te)throw new Error("Point.fromHex: invalid y coordinate");let _e=(me&ii)===ii,wt=(q&128)!==0;if(!O&&me===bc&&wt)throw new Error("Point.fromHex: x=0 and x_0=1");return wt!==_e&&(me=u(-me)),w.fromAffine({x:me,y:oe})}static fromPrivateKey(E){return N(E).point}toRawBytes(){let{x:E,y:O}=this.toAffine(),B=HR(O,r.BYTES);return B[B.length-1]|=E&ii?128:0,B}toHex(){return QR(this.toRawBytes())}}w.BASE=new w(t.Gx,t.Gy,ii,u(t.Gx*t.Gy)),w.ZERO=new w(bc,ii,ii,bc);let{BASE:x,ZERO:S}=w,P=PIe(w,a*8);function D(v){return zn(v,n)}function U(v){return D(bA(v))}function N(v){let E=r.BYTES;v=Kd("private key",v,E);let O=Kd("hashed private key",s(v),2*E),B=f(O.slice(0,E)),_=O.slice(E,2*E),M=U(B),F=x.multiply(M),q=F.toRawBytes();return{head:B,prefix:_,scalar:M,point:F,pointBytes:q}}function L(v){return N(v).pointBytes}function I(v=new Uint8Array,...E){let O=_Z(...E);return U(s(m(O,Kd("context",v),!!o)))}function R(v,E,O={}){v=Kd("message",v),o&&(v=o(v));let{prefix:B,scalar:_,pointBytes:M}=N(E),F=I(O.context,B,v),q=x.multiply(F).toRawBytes(),oe=I(O.context,q,M,v),Q=D(F+oe*_);Lx("signature.s",Q,bc,n);let Y=_Z(q,HR(Q,r.BYTES));return Kd("result",Y,r.BYTES*2)}let A=BIe;function T(v,E,O,B=A){let{context:_,zip215:M}=B,F=r.BYTES;v=Kd("signature",v,2*F),E=Kd("message",E),O=Kd("publicKey",O,F),M!==void 0&&_R("zip215",M),o&&(E=o(E));let q=bA(v.slice(F,2*F)),oe,Q,Y;try{oe=w.fromHex(O,M),Q=w.fromHex(v.slice(0,F),M),Y=x.multiplyUnsafe(q)}catch{return!1}if(!M&&oe.isSmallOrder())return!1;let pe=I(_,Q.toRawBytes(),oe.toRawBytes(),E);return Q.add(oe.multiplyUnsafe(pe)).subtract(Y).clearCofactor().equals(w.ZERO)}return x._setWindowSize(8),{CURVE:t,getPublicKey:L,sign:R,verify:T,ExtendedPoint:w,utils:{getExtendedPublicKey:N,randomPrivateKey:()=>i(r.BYTES),precompute(v=8,E=w.BASE){return E._setWindowSize(v),E.multiply(BigInt(3)),E}}}}function HIe(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=eO,i=e*e%s*e%s,a=El(i,DZ,s)*i%s,c=El(a,UIe,s)*e%s,l=El(c,LIe,s)*c%s,u=El(l,t,s)*l%s,d=El(u,r,s)*u%s,p=El(d,n,s)*d%s,f=El(p,o,s)*p%s,m=El(f,o,s)*p%s,g=El(m,t,s)*l%s;return{pow_p_5_8:El(g,DZ,s)*e%s,b2:i}}function $Ie(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function FIe(e,t){let r=eO,n=zn(t*t*t,r),o=zn(n*n*t,r),s=HIe(e*o).pow_p_5_8,i=zn(e*n*s,r),a=zn(t*i*i,r),c=i,l=zn(i*kZ,r),u=a===e,d=a===zn(-e,r),p=a===zn(-e*kZ,r);return u&&(i=c),(d||p)&&(i=l),EIe(i,r)&&(i=zn(-i,r)),{isValid:u||d,value:i}}function tO(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function iG(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?tO(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function aG(e,t){t||(t=e.reduce((o,s)=>o+s.length,0));let r=iG(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return tO(r)}function QIe(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var g=0,y=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,g++;for(var w=(C-b)*u+1>>>0,x=new Uint8Array(w);b!==C;){for(var S=m[b],P=0,D=w-1;(S!==0||P<y)&&D!==-1;D--,P++)S+=256*x[D]>>>0,x[D]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,b++}for(var U=w-y;U!==w&&x[U]===0;)U++;for(var N=c.repeat(g);U<w;++U)N+=e.charAt(x[U]);return N}function p(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var g=0;if(m[g]!==" "){for(var y=0,b=0;m[g]===c;)y++,g++;for(var C=(m.length-g)*l+1>>>0,w=new Uint8Array(C);m[g];){var x=r[m.charCodeAt(g)];if(x===255)return;for(var S=0,P=C-1;(x!==0||S<b)&&P!==-1;P--,S++)x+=a*w[P]>>>0,w[P]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");b=S,g++}if(m[g]!==" "){for(var D=C-b;D!==C&&w[D]===0;)D++;for(var U=new Uint8Array(y+(C-D)),N=y;D!==C;)U[N++]=w[D++];return U}}}function f(m){var g=p(m);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:p,decode:f}}function H9e(e){return e.reduce((t,r)=>(t+=L9e[r],t),"")}function $9e(e){let t=[];for(let r of e){let n=M9e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}function dG(e,t,r){t=t||[],r=r||0;for(var n=r;e>=W9e;)t[r++]=e&255|LZ,e/=128;for(;e&q9e;)t[r++]=e&255|LZ,e>>>=7;return t[r]=e|0,dG.bytes=r-n+1,t}function qR(e,n){var r=0,n=n||0,o=0,s=n,i,a=e.length;do{if(s>=a)throw qR.bytes=0,new RangeError("Could not decode varint");i=e[s++],r+=o<28?(i&MZ)<<o:(i&MZ)*Math.pow(2,o),o+=7}while(i>=Z9e);return qR.bytes=s-n,r}function yG(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}function CA(e,t="utf8"){let r=wG[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function X2(e,t="utf8"){let r=wG[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?tO(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function zZ(e){return Rs(CA(X2(e,EA),oG))}function vA(e){return CA(X2(si(e),oG),EA)}function Hx(e){let t=X2(YIe,UZ),r=GIe+CA(aG([t,e]),UZ);return[KIe,ZIe,r].join(WIe)}function fTe(e){return CA(e,EA)}function hTe(e){return X2(e,EA)}function mTe(e){return X2([vA(e.header),vA(e.payload)].join(xA),sG)}function gTe(e){return[vA(e.header),vA(e.payload),fTe(e.signature)].join(xA)}function Al(e){let t=e.split(xA),r=zZ(t[0]),n=zZ(t[1]),o=hTe(t[2]),s=X2(t.slice(0,2).join(xA),sG);return{header:r,payload:n,signature:o,data:s}}function ey(e=KZ(JIe)){let t=nG.getPublicKey(e);return{secretKey:aG([e,t]),publicKey:t}}async function SA(e,t,r,n,o=(0,jZ.fromMiliseconds)(Date.now())){let s={alg:jIe,typ:qIe},i=Hx(n.publicKey),a=o+r,c={iss:i,sub:e,aud:t,iat:o,exp:a},l=mTe({header:s,payload:c}),u=nG.sign(l,n.secretKey.slice(0,32));return gTe({header:s,payload:c,signature:u})}var jZ,Q2,TR,DR,UR,gA,LR,VSe,zSe,jSe,qSe,WSe,KSe,ZSe,GSe,YSe,JSe,QSe,XSe,eIe,rIe,nIe,oIe,sIe,iIe,aIe,xt,cIe,lIe,Df,Uf,MR,uIe,GR,GZ,dIe,pIe,Wd,PR,gIe,yIe,ro,gn,Km,wIe,$R,NZ,RZ,EIe,AIe,BZ,yA,OR,rG,bc,ii,wA,OIe,BIe,eO,kZ,UIe,DZ,LIe,MIe,VIe,zIe,nG,jIe,qIe,xA,EA,oG,sG,WIe,KIe,ZIe,UZ,GIe,YIe,JIe,XIe,e9e,cG,t9e,r9e,FR,VR,zR,lG,jR,AA,Mx,n9e,o9e,Ao,s9e,i9e,a9e,c9e,l9e,u9e,d9e,p9e,f9e,h9e,m9e,g9e,y9e,w9e,b9e,x9e,v9e,E9e,A9e,C9e,S9e,I9e,T9e,_9e,P9e,N9e,R9e,O9e,B9e,k9e,D9e,U9e,uG,L9e,M9e,F9e,V9e,z9e,LZ,j9e,q9e,W9e,K9e,Z9e,MZ,G9e,Y9e,J9e,Q9e,X9e,eTe,tTe,rTe,nTe,oTe,sTe,pG,HZ,$Z,WR,KR,fG,ZR,hG,iTe,aTe,cTe,mG,lTe,gG,uTe,dTe,pTe,FZ,VZ,kR,wG,Zm
vendor: 3,460 bytes, line 15
15=h(()=>{jZ=Lt(Sd());Wm();Q2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;TR=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);DR=class{clone(){return this._cloneInto()}};UR=class extends DR{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=TR(this.buffer)}update(t){IZ(this);let{view:r,buffer:n,blockLen:o}=this;t=WZ(t);let s=t.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=TR(t);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){IZ(this),LSe(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;r[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>o-i&&(this.process(n,0),i=0);for(let d=i;d<o;d++)r[d]=0;$Se(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=TR(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return t.length=o,t.pos=a,t.finished=s,t.destroyed=i,o%r&&t.buffer.set(n),t}},gA=BigInt(2**32-1),LR=BigInt(32);VSe=(e,t)=>BigInt(e>>>0)<<LR|BigInt(t>>>0),zSe=(e,t,r)=>e>>>r,jSe=(e,t,r)=>e<<32-r|t>>>r,qSe=(e,t,r)=>e>>>r|t<<32-r,WSe=(e,t,r)=>e<<32-r|t>>>r,KSe=(e,t,r)=>e<<64-r|t>>>r-32,ZSe=(e,t,r)=>e>>>r-32|t<<64-r,GSe=(e,t)=>t,YSe=(e,t)=>e,JSe=(e,t,r)=>e<<r|t>>>32-r,QSe=(e,t,r)=>t<<r|e>>>32-r,XSe=(e,t,r)=>t<<r-32|e>>>64-r,eIe=(e,t,r)=>e<<r-32|t>>>64-r;rIe=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),nIe=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,oIe=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),sIe=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,iIe=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),aIe=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0,xt={fromBig:ZZ,split:FSe,toBig:VSe,shrSH:zSe,shrSL:jSe,rotrSH:qSe,rotrSL:WSe,rotrBH:KSe,rotrBL:ZSe,rotr32H:GSe,rotr32L:YSe,rotlSH:JSe,rotlSL:QSe,rotlBH:XSe,rotlBL:eIe,add:tIe,add3L:rIe,add3H:nIe,add4L:oIe,add4H:sIe,add5H:aIe,add5L:iIe},[cIe,lIe]=xt.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
155771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),Df=new Uint32Array(80),Uf=new Uint32Array(80),MR=class extends UR{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(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:p,Gh:f,Gl:m,Hh:g,Hl:y}=this;return[t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y]}set(t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=p|0,this.Gh=f|0,this.Gl=m|0,this.Hh=g|0,this.Hl=y|0}process(t,r){for(let w=0;w<16;w++,r+=4)Df[w]=t.getUint32(r),Uf[w]=t.getUint32(r+=4);for(let w=16;w<80;w++){let x=Df[w-15]|0,S=Uf[w-15]|0,P=xt.rotrSH(x,S,1)^xt.rotrSH(x,S,8)^xt.shrSH(x,S,7),D=xt.rotrSL(x,S,1)^xt.rotrSL(x,S,8)^xt.shrSL(x,S,7),U=Df[w-2]|0,N=Uf[w-2]|0,L=xt.rotrSH(U,N,19)^xt.rotrB
15H(U,N,61)^xt.shrSH(U,N,6),I=xt.rotrSL(U,N,19)^xt.rotrBL(U,N,61)^xt.shrSL(U,N,6),R=xt.add4L(D,I,Uf[w-7],Uf[w-16]),A=xt.add4H(R,P,L,Df[w-7],Df[w-16]);Df[w]=A|0,Uf[w]=R|0}let{Ah:n,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:p,Fh:f,Fl:m,Gh:g,Gl:y,Hh:b,Hl:C}=this;for(let w=0;w<80;w++){let x=xt.rotrSH(d,p,14)^xt.rotrSH(d,p,18)^xt.rotrBH(d,p,41),S=xt.rotrSL(d,p,14)^xt.rotrSL(d,p,18)^xt.rotrBL(d,p,41),P=d&f^~d&g,D=p&m^~p&y,U=xt.add5L(C,S,D,lIe[w],Uf[w]),N=xt.add5H(U,b,x,P,cIe[w],Df[w]),L=U|0,I=xt.rotrSH(n,o,28)^xt.rotrBH(n,o,34)^xt.rotrBH(n,o,39),R=xt.rotrSL(n,o,28)^xt.rotrBL(n,o,34)^xt.rotrBL(n,o,39),A=n&s^n&a^s&a,T=o&i^o&c^i&c;b=g|0,C=y|0,g=f|0,y=m|0,f=d|0,m=p|0,{h:d,l:p}=xt.add(l|0,u|0,N|0,L|0),l=a|0,u=c|0,a=s|0,c=i|0,s=n|0,i=o|0;let v=xt.add3L(L,R,T);n=xt.add3H(v,N,I,A),o=v|0}({h:n,l:o}=xt.add(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:i}=xt.add(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=xt.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=xt.add(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:p}=xt.add(this.Eh|0,this.El|0,d|0,p|0),{h:f,l:m}=xt.add(this.Fh|0,this.Fl|0,f|0,m|0),{h:g,l:y}=xt.add(this.Gh|0,this.Gl|0,g|0,y|0),{h:b,l:C}=xt.add(this.Hh|0,this.Hl|0,b|0,C|0),this.set(n,o,s,i,a,c,l,u,d,p,f,m,g,y,b,C)}roundClean(){Df.fill(0),Uf.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)}},uIe=HSe(()=>new MR);GR=BigInt(0),GZ=BigInt(1),dIe=BigInt(2);pIe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Wd={_0:48,_9:57,A:65,F:70,a:97,f:102};PR=e=>typeof e=="bigint"&&GR<=e;gIe=e=>(dIe<<BigInt(e-1))-GZ,yIe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||YR(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};ro=BigInt(0),gn=BigInt(1),Km=BigInt(2),wIe=BigInt(3),$R=BigInt(4),NZ=BigInt(5),RZ=BigInt(8);EIe=(e,t)=>(zn(e,t)&gn)===gn,AIe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];BZ=BigInt(0),yA=BigInt(1);OR=new WeakMap,rG=new WeakMap;bc=BigInt(0),ii=BigInt(1),wA=BigInt(2),OIe=BigInt(8),BIe={zip215:!0};BigInt(0),BigInt(1);eO=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),kZ=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);UIe=BigInt(1),DZ=BigInt(2);BigInt(3);LIe=BigInt(5),MIe=BigInt(8);VIe=eG(eO,void 0,!0),zIe={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:VIe,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:MIe,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:uIe,randomBytes:KZ,adjustScalarBytes:$Ie,uvRatio:FIe},nG=DIe(zIe),jIe="EdDSA",qIe="JWT",xA=".",EA="base64url",oG="utf8",sG="utf8",WIe=":",KIe="did",ZIe="key",UZ="base58btc",GIe="z",YIe="K36",JIe=32;XIe=QIe,e9e=XIe,cG=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},t9e=e=>new TextEncoder().encode(e),r9e=e=>new TextDecoder().decode(e),FR=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},VR=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return lG(this,t)}},zR=class{constructor(t){this.decoders=t}or(t){return lG(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}
15, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},lG=(e,t)=>new zR({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),jR=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new FR(t,r,n),this.decoder=new VR(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},AA=({name:e,prefix:t,encode:r,decode:n})=>new jR(e,t,r,n),Mx=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=e9e(r,t);return AA({prefix:e,name:t,encode:n,decode:s=>cG(o(s))})},n9e=(e,t,r,n)=>{let o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let s=e.length;for(;e[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),a=0,c=0,l=0;for(let u=0;u<s;++u){let d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,i[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i},o9e=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,s="",i=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],i+=8;i>r;)i-=r,s+=t[o&a>>i];if(i&&(s+=t[o&a<<r-i]),n)for(;s.length*r&7;)s+="=";return s},Ao=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>AA({prefix:t,name:e,encode(o){return o9e(o,n,r)},decode(o){return n9e(o,n,r,e)}}),s9e=AA({prefix:"\0",name:"identity",encode:e=>r9e(e),decode:e=>t9e(e)}),i9e=Object.freeze({__proto__:null,identity:s9e}),a9e=Ao({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),c9e=Object.freeze({__proto__:null,base2:a9e}),l9e=Ao({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),u9e=Object.freeze({__proto__:null,base8:l9e}),d9e=Mx({prefix:"9",name:"base10",alphabet:"0123456789"}),p9e=Object.freeze({__proto__:null,base10:d9e}),f9e=Ao({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),h9e=Ao({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),m9e=Object.freeze({__proto__:null,base16:f9e,base16upper:h9e}),g9e=Ao({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),y9e=Ao({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),w9e=Ao({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),b9e=Ao({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),x9e=Ao({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),v9e=Ao({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),E9e=Ao({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),A9e=Ao({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),C9e=Ao({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),S9e=Object.freeze({__proto__:null,base32:g9e,base32upper:y9e,base32pad:w9e,base32padupper:b9e,base32hex:x9e,base32hexupper:v9e,base32hexpad:E9e,base32hexpadupper:A9e,base32z:C9e}),I9e=Mx({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),T9e=Mx({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),_9e=Object.freeze({__proto__:null,base36:I9e,base36upper:T9e}),P9e=Mx({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),N9e=Mx({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),R9e=Object.freeze({__proto__:null,base58btc:P9e,base58flickr:N9e}),O9e=Ao({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),B9e=Ao({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),k9e=Ao({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),D9e=Ao({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),U9e=Object.freeze({__proto__:null,base64:O9e,base64pad:B9e,base64url:k9e,base64urlpad:D9e}),uG
vendor: 2,242 bytes, line 15
15=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),
15L9e=uG.reduce((e,t,r)=>(e[r]=t,e),[]),M9e=uG.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);F9e=AA({prefix:"\u{1F680}",name:"base256emoji",encode:H9e,decode:$9e}),V9e=Object.freeze({__proto__:null,base256emoji:F9e}),z9e=dG,LZ=128,j9e=127,q9e=~j9e,W9e=Math.pow(2,31);K9e=qR,Z9e=128,MZ=127;G9e=Math.pow(2,7),Y9e=Math.pow(2,14),J9e=Math.pow(2,21),Q9e=Math.pow(2,28),X9e=Math.pow(2,35),eTe=Math.pow(2,42),tTe=Math.pow(2,49),rTe=Math.pow(2,56),nTe=Math.pow(2,63),oTe=function(e){return e<G9e?1:e<Y9e?2:e<J9e?3:e<Q9e?4:e<X9e?5:e<eTe?6:e<tTe?7:e<rTe?8:e<nTe?9:10},sTe={encode:z9e,decode:K9e,encodingLength:oTe},pG=sTe,HZ=(e,t,r=0)=>(pG.encode(e,t,r),t),$Z=e=>pG.encodingLength(e),WR=(e,t)=>{let r=t.byteLength,n=$Z(e),o=n+$Z(r),s=new Uint8Array(o+r);return HZ(e,s,0),HZ(r,s,n),s.set(t,o),new KR(e,r,t,s)},KR=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}},fG=({name:e,code:t,encode:r})=>new ZR(e,t,r),ZR=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?WR(this.code,r):r.then(n=>WR(this.code,n))}else throw Error("Unknown type, must be binary type")}},hG=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),iTe=fG({name:"sha2-256",code:18,encode:hG("SHA-256")}),aTe=fG({name:"sha2-512",code:19,encode:hG("SHA-512")}),cTe=Object.freeze({__proto__:null,sha256:iTe,sha512:aTe}),mG=0,lTe="identity",gG=cG,uTe=e=>WR(mG,gG(e)),dTe={code:mG,name:lTe,encode:gG,digest:uTe},pTe=Object.freeze({__proto__:null,identity:dTe});new TextEncoder,new TextDecoder;FZ={...i9e,...c9e,...u9e,...p9e,...m9e,...S9e,..._9e,...R9e,...U9e,...V9e};({...cTe,...pTe});VZ=yG("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),kR=yG("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=iG(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),wG={utf8:VZ,"utf-8":VZ,hex:FZ.base16,latin1:kR,ascii:kR,binary:kR,...FZ}});var IA,rO=h(()=>{IA={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}});var nO=ot((Sot,xG)=>{var yTe="Input must be an string, Buffer or Uint8Array";function wTe(e){let t;if(e instanceof Uint8Array)t=e;else if(typeof e=="string")t=new TextEncoder().encode(e);else throw new Error(yTe);return t}function bTe(e){return Array.prototype.map.call(e,function(t){return(t<16?"0":"")+t.toString(16)}).join("")}function TA(e){return(4294967296+e).toString(16).substring(1)}function xTe(e,t,r){let n=`
16`+e+" = ";for(let o=0;o<t.length;o+=2){if(r===32)n+=TA(t[o]).toUpperCase(),n+=" ",n+=TA(t[o+1]).toUpperCase();else if(r===64)n+=TA(t[o+1]).toUpperCase(),n+=TA(t[o]).toUpperCase();else throw new Error("Invalid size "+r);o%6===4?n+=`
17`+new Array(e.length+4).join(" "):o<t.length-2&&(n+=" ")}console.log(n)}function vTe(e,t,r){let n=new Date().getTime(),o=new Uint8Array(t);for(let i=0;i<t;i++)o[i]=i%256;let s=new Date().getTime();console.log("Generated random input in "+(s-n)+"ms"),n=s;for(let i=0;i<r;i++){let a=e(o),c=new Date().getTime(),l=c-n;n=c,console.log("Hashed in "+l+"ms: "+a.substring(0,20)+"..."),console.log(Math.round(t/(1<<20)
vendor: 8,414 bytes, line 17
17/(l/1e3)*100)/100+" MB PER SECOND")}}xG.exports={normalizeInput:wTe,toHex:bTe,debugPrint:xTe,testSpeed:vTe}});var PG=ot((Iot,_G)=>{var PA=nO();function _A(e,t,r){let n=e[t]+e[r],o=e[t+1]+e[r+1];n>=4294967296&&o++,e[t]=n,e[t+1]=o}function vG(e,t,r,n){let o=e[t]+r;r<0&&(o+=4294967296);let s=e[t+1]+n;o>=4294967296&&s++,e[t]=o,e[t+1]=s}function EG(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function Lf(e,t,r,n,o,s){let i=$x[o],a=$x[o+1],c=$x[s],l=$x[s+1];_A(gt,e,t),vG(gt,e,i,a);let u=gt[n]^gt[e],d=gt[n+1]^gt[e+1];gt[n]=d,gt[n+1]=u,_A(gt,r,n),u=gt[t]^gt[r],d=gt[t+1]^gt[r+1],gt[t]=u>>>24^d<<8,gt[t+1]=d>>>24^u<<8,_A(gt,e,t),vG(gt,e,c,l),u=gt[n]^gt[e],d=gt[n+1]^gt[e+1],gt[n]=u>>>16^d<<16,gt[n+1]=d>>>16^u<<16,_A(gt,r,n),u=gt[t]^gt[r],d=gt[t+1]^gt[r+1],gt[t]=d>>>31^u<<1,gt[t+1]=u>>>31^d<<1}var AG=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),ETe=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],jo=new Uint8Array(ETe.map(function(e){return e*2})),gt=new Uint32Array(32),$x=new Uint32Array(32);function CG(e,t){let r=0;for(r=0;r<16;r++)gt[r]=e.h[r],gt[r+16]=AG[r];for(gt[24]=gt[24]^e.t,gt[25]=gt[25]^e.t/4294967296,t&&(gt[28]=~gt[28],gt[29]=~gt[29]),r=0;r<32;r++)$x[r]=EG(e.b,4*r);for(r=0;r<12;r++)Lf(0,8,16,24,jo[r*16+0],jo[r*16+1]),Lf(2,10,18,26,jo[r*16+2],jo[r*16+3]),Lf(4,12,20,28,jo[r*16+4],jo[r*16+5]),Lf(6,14,22,30,jo[r*16+6],jo[r*16+7]),Lf(0,10,20,30,jo[r*16+8],jo[r*16+9]),Lf(2,12,22,24,jo[r*16+10],jo[r*16+11]),Lf(4,14,16,26,jo[r*16+12],jo[r*16+13]),Lf(6,8,18,28,jo[r*16+14],jo[r*16+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^gt[r]^gt[r+16]}var Mf=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function SG(e,t,r,n){if(e===0||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&r.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(n&&n.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");let o={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};Mf.fill(0),Mf[0]=e,t&&(Mf[1]=t.length),Mf[2]=1,Mf[3]=1,r&&Mf.set(r,32),n&&Mf.set(n,48);for(let s=0;s<16;s++)o.h[s]=AG[s]^EG(Mf,s*4);return t&&(oO(o,t),o.c=128),o}function oO(e,t){for(let r=0;r<t.length;r++)e.c===128&&(e.t+=e.c,CG(e,!1),e.c=0),e.b[e.c++]=t[r]}function IG(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;CG(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(r&3);return t}function TG(e,t,r,n,o){r=r||64,e=PA.normalizeInput(e),n&&(n=PA.normalizeInput(n)),o&&(o=PA.normalizeInput(o));let s=SG(r,t,n,o);return oO(s,e),IG(s)}function ATe(e,t,r,n,o){let s=TG(e,t,r,n,o);return PA.toHex(s)}_G.exports={blake2b:TG,blake2bHex:ATe,blake2bInit:SG,blake2bUpdate:oO,blake2bFinal:IG}});var LG=ot((Tot,UG)=>{var NG=nO();function CTe(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function Hf(e,t,r,n,o,s){Jt[e]=Jt[e]+Jt[t]+o,Jt[n]=NA(Jt[n]^Jt[e],16),Jt[r]=Jt[r]+Jt[n],Jt[t]=NA(Jt[t]^Jt[r],12),Jt[e]=Jt[e]+Jt[t]+s,Jt[n]=NA(Jt[n]^Jt[e],8),Jt[r]=Jt[r]+Jt[n],Jt[t]=NA(Jt[t]^Jt[r],7)}function NA(e,t){return e>>>t^e<<32-t}var RG=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qo=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),Jt=new Uint32Array(16),Co=new Uint32Array(16);function OG(e,t){let r=0;for(r=0;r<8;r++)Jt[r]=e.h[r],Jt[r+8]=RG[r];for(Jt[12]^=e.t,Jt[13]^=e.t/4294967296,t&&(Jt[14]=~Jt[14]),r=0;r<16;r++)Co[r]=CTe(e.b,4*r);for(r=0;r<10;r++)Hf(0,4,8,12,Co[qo[r*16+0]],Co[qo[r*16+1]]),Hf(1,5,9,13,Co[qo[r*16+2]],Co[qo[r*16+3]]),Hf(2,6,10,14,Co[qo[r*16+4]],Co[qo[r*16+5]]),Hf(3,7,11,15,Co[qo[r*16+6]],Co[qo[r*16+7]]),Hf(0,5,10,15,Co[qo[r*16+8]],Co[qo[r*16+9]]),Hf(1,6,11,12,Co[qo[r*16+10]],Co[qo[r*16+11]]),Hf(2,7,8,13,Co[qo[r*16+12]],Co[qo[r*16+13]]),Hf(3,4,9,14,Co[qo[r*16+14]],Co[qo[r*16+15]]);for(r=0;r<8;r++)e.h[r]^=Jt[r]^Jt[r+8]}function BG(e,t){if(!(e>0&&e<=32))throw new Error("Incorrect output length, should be in [1, 32]");let r=t?t.length:0;if(t&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");let n={h:new Uint32Array(RG),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=16842752^r<<8^e,r>0&&(sO(n,t),n.c=64),n}function sO(e,t){for(let r=0;r<t.length;r++)e.c===64&&(e.t+=e.c,OG(e,!1),e.c=0),e.b[e.c++]=t[r]}function kG(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;OG(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(r&3)&255;return t}function DG(e,t,r){r=r||32,e=NG.normalizeInput(e);let n=BG(r,t);return sO(n,e),kG(n)}function STe(e,t,r){let n=DG(e,t,r);return NG.toHex(n)}UG.exports={blake2s:DG,blake2sHex:STe,blake2sInit:BG,blake2sUpdate:sO,blake2sFinal:kG}});var iO=ot((_ot,MG)=>{var Fx=PG(),Vx=LG();MG.exports={blake2b:Fx.blake2b,blake2bHex:Fx.blake2bHex,blake2bInit:Fx.blake2bInit,blake2bUpdate:Fx.blake2bUpdate,blake2bFinal:Fx.blake2bFinal,blake2s:Vx.blake2s,blake2sHex:Vx.blake2sHex,blake2sInit:Vx.blake2sInit,blake2sUpdate:Vx.blake2sUpdate,blake2sFinal:Vx.blake2sFinal}});function ITe(e){try{return JSON.stringify(e)}catch{return'"[Circular]"'}}function _Te(e,t,r){var n=r&&r.stringify||ITe,o=1;if(typeof e=="object"&&e!==null){var s=t.length+o;if(s===1)return e;var i=new Array(s);i[0]=n(e);for(var a=1;a<s;a++)i[a]=n(t[a]);return i.join(" ")}if(typeof e!="string")return e;var c=t.length;if(c===0)return e;for(var l="",u=1-o,d=-1,p=e&&e.length||0,f=0;f<p;){if(e.charCodeAt(f)===37&&f+1<p){switch(d=d>-1?d:0,e.charCodeAt(f+1)){case 100:case 102:if(u>=c||t[u]==null)break;d<f&&(l+=e.slice(d,f)),l+=Number(t[u]),d=f+2,f++;break;case 105:if(u>=c||t[u]==null)break;d<f&&(l+=e.slice(d,f)),l+=Math.floor(Number(t[u])),d=f+2,f++;break;case 79:case 111:case 106:if(u>=c||t[u]===void 0)break;d<f&&(l+=e.slice(d,f));var m=typeof t[u];if(m==="string"){l+="'"+t[u]+"'",d=f+2,f++;break}if(m==="function"){l+=t[u].name||"<anonymous>",d=f+2,f++;break}l+=n(t[u]),d=f+2,f++;break;case 115:if(u>=c)break;d<f&&(l+=e.slice(d,f)),l+=String(t[u]),d=f+2,f++;break;case 37:d<f&&(l+=e.slice(d,f)),l+="%",d=f+2,f++,u--;break}++u}++f}return d===-1?e:(d<p&&(l+=e.slice(d)),l)}function Ff(e,t){return e==="silent"?1/0:t.levels.values[e]}function $G(e,t){let r={logger:t,parent:e[cO]};t[cO]=r}function RTe(e,t,r){let n={};t.forEach(o=>{n[o]=r[o]?r[o]:zx[o]||zx[NTe[o]||"log"]||ty}),e[fO]=n}function OTe(e,t){return Array.isArray(e)?e.filter(function(r){return r!=="!stdSerializers.err"}):e===!0?Object.keys(t):!1}function Zd(e){e=e||{},e.browser=e.browser||{};let t=e.browser.transmit;if(t&&typeof t.send!="function")throw Error("pino: transmit option must have a send function");let r=e.browser.write||zx;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=OTe(e.browser.serialize,n),s=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);let i=Object.keys(e.customLevels||{}),a=["error","fatal","warn","info","debug","trace"].concat(i);typeof r=="function"&&a.forEach(function(g){r[g]=r}),(e.enabled===!1||e.browser.disabled)&&(e.level="silent");let c=e.level||"info",l=Object.create(r);l.log||(l.log=ty),RTe(l,a,r),$G({},l),Object.defineProperty(l,"levelVal",{get:d}),Object.defineProperty(l,"level",{get:p,set:f});let u={transmit:t,serialize:o,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,levels:a,timestamp:$Te(e),messageKey:e.messageKey||"msg",onChild:e.onChild||t
vendor: 4,218 bytes, line 17
17y};l.levels=BTe(e),l.level=c,l.isLevelEnabled=function(g){return this.levels.values[g]?this.levels.values[g]>=this.levels.values[this.level]:!1},l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=ty,l.serializers=n,l._serialize=o,l._stdErrSerialize=s,l.child=function(...g){return m.call(this,u,...g)},t&&(l._logEvent=lO());function d(){return Ff(this.level,this)}function p(){return this._level}function f(g){if(g!=="silent"&&!this.levels.values[g])throw Error("unknown level "+g);this._level=g,Gm(this,u,l,"error"),Gm(this,u,l,"fatal"),Gm(this,u,l,"warn"),Gm(this,u,l,"info"),Gm(this,u,l,"debug"),Gm(this,u,l,"trace"),i.forEach(y=>{Gm(this,u,l,y)})}function m(g,y,b){if(!y)throw new Error("missing bindings for child Pino");b=b||{},o&&y.serializers&&(b.serializers=y.serializers);let C=b.serializers;if(o&&C){var w=Object.assign({},n,C),x=e.browser.serialize===!0?Object.keys(w):o;delete y.serializers,hO([y],x,w,this._stdErrSerialize)}function S(D){this._childLevel=(D._childLevel|0)+1,this.bindings=y,w&&(this.serializers=w,this._serialize=x),t&&(this._logEvent=lO([].concat(D._logEvent.bindings,y)))}S.prototype=this;let P=new S(this);return $G(this,P),P.child=function(...D){return m.call(this,g,...D)},P.level=b.level||this.level,g.onChild(P),P}return l}function BTe(e){let t=e.customLevels||{},r=Object.assign({},Zd.levels.values,t),n=Object.assign({},Zd.levels.labels,kTe(t));return{values:r,labels:n}}function kTe(e){let t={};return Object.keys(e).forEach(function(r){t[e[r]]=r}),t}function DTe(e){let t=[];e.bindings&&t.push(e.bindings);let r=e[cO];for(;r.parent;)r=r.parent,r.logger.bindings&&t.push(r.logger.bindings);return t.reverse()}function Gm(e,t,r,n){if(Object.defineProperty(e,n,{value:Ff(e.level,r)>Ff(n,r)?ty:r[fO][n],writable:!0,enumerable:!0,configurable:!0}),e[n]===ty){if(!t.transmit)return;let s=t.transmit.level||e.level,i=Ff(s,r);if(Ff(n,r)<i)return}e[n]=LTe(e,t,r,n);let o=DTe(e);o.length!==0&&(e[n]=UTe(o,e[n]))}function UTe(e,t){return function(){return t.apply(this,[...e,...arguments])}}function LTe(e,t,r,n){return(function(o){return function(){let s=t.timestamp(),i=new Array(arguments.length),a=Object.getPrototypeOf&&Object.getPrototypeOf(this)===zx?zx:this;for(var c=0;c<i.length;c++)i[c]=arguments[c];var l=!1;if(t.serialize&&(hO(i,this._serialize,this.serializers,this._stdErrSerialize),l=!0),t.asObject||t.formatters?o.call(a,...MTe(this,n,i,s,t)):o.apply(a,i),t.transmit){let u=t.transmit.level||e._level,d=Ff(u,r),p=Ff(n,r);if(p<d)return;HTe(this,{ts:s,methodLevel:n,methodValue:p,transmitLevel:u,transmitValue:r.levels.values[t.transmit.level||e._level],send:t.transmit.send,val:Ff(e._level,r)},i,l)}}})(e[fO][n])}function MTe(e,t,r,n,o){let{level:s,log:i=d=>d}=o.formatters||{},a=r.slice(),c=a[0],l={},u=(e._childLevel|0)+1;if(u<1&&(u=1),n&&(l.time=n),s){let d=s(t,e.levels.values[t]);Object.assign(l,d)}else l.level=e.levels.values[t];if(o.asObjectBindingsOnly){if(c!==null&&typeof c=="object")for(;u--&&typeof a[0]=="object";)Object.assign(l,a.shift());return[i(l),...a]}else{if(c!==null&&typeof c=="object"){for(;u--&&typeof a[0]=="object";)Object.assign(l,a.shift());c=a.length?HG(a.shift(),a):void 0}else typeof c=="string"&&(c=HG(a.shift(),a));return c!==void 0&&(l[o.messageKey]=c),[i(l)]}}function hO(e,t,r,n){for(let o in e)if(n&&e[o]instanceof Error)e[o]=Zd.stdSerializers.err(e[o]);else if(typeof e[o]=="object"&&!Array.isArray(e[o])&&t)for(let s in e[o])t.indexOf(s)>-1&&s in r&&(e[o][s]=r[s](e[o][s]))}function HTe(e,t,r,n=!1){let o=t.send,s=t.ts,i=t.methodLevel,a=t.methodValue,c=t.val,l=e._logEvent.bindings;n||hO(r,e._serialize||Object.keys(e.serializers),e.serializers,e._stdErrSerialize===void 0?!0:e._stdErrSerialize),e._logEvent.ts=s,e._logEvent.messages=r.filter(function(u){return l.indexOf(u)===-1}),e._logEvent.level.label=i,e._logEvent.level.value=a,o(i,e._logEvent,c),e._logEvent=lO(l)}function lO(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function FG(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)t[r]===void 0&&(t[r]=e[r]);return t}
17function $Te(e){return typeof e.timestamp=="function"?e.timestamp:e.timestamp===!1?qG:WG}function RA(){return{}}function aO(e){return e}function ty(){}function qG(){return!1}function WG(){return Date.now()}function FTe(){return Math.round(Date.now()/1e3)}function VTe(){return new Date(Date.now()).toISOString()}function zTe(){function e(t){return typeof t<"u"&&t}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return e(self)||e(window)||e(this)||{}}}function VG(e){return typeof e=="string"?e:KTe(e)||""}function ry(e){return zf(Vf({},e),{level:e?.level||jTe.level})}function a_e(e,t,r=DA){return e[r]=t,e}function rr(e,t=DA){return e[t]||""}function c_e(e,t,r=DA){let n=rr(e,r);return n.trim()?`${n}/${t}`:t}function br(e,t,r=DA){let n=c_e(e,t,r),o=e.child({context:n});return a_e(o,n,r)}function l_e(e){var t,r;let n=new dO((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Cl.exports(zf(Vf({},e.opts),{level:"trace",browser:zf(Vf({},(r=e.opts)==null?void 0:r.browser),{write:o=>n.write(o)})})),chunkLoggerController:n}}function u_e(e){var t,r;let n=new pO((t=e.opts)==null?void 0:t.level,e.maxSizeInBytes);return{logger:Cl.exports(zf(Vf({},e.opts),{level:"trace",browser:zf(Vf({},(r=e.opts)==null?void 0:r.browser),{write:o=>n.write(o)})}),n),chunkLoggerController:n}}function Sl(e){var t;if(typeof e.loggerOverride<"u"&&typeof e.loggerOverride!="string")return{logger:e.loggerOverride,chunkLoggerController:null};let r=zf(Vf({},e.opts),{level:typeof e.loggerOverride=="string"?e.loggerOverride:(t=e.opts)==null?void 0:t.level});return typeof window<"u"?l_e(zf(Vf({},e),{opts:r})):u_e(zf(Vf({},e),{opts:r}))}var Cl,TTe,HG,zx,PTe,fO,cO,NTe,Pot,jTe,DA,mO,qTe,WTe,$f,uO,BA,KTe,ZTe,GTe,OA,kA,YTe,JTe,QTe,dO,XTe,e_e,t_e,pO,r_e,n_e,o_e,zG,s_e,i_e,jG,Vf,zf,jf=h(()=>{Cl={exports:{}};TTe=_Te;HG=TTe;Cl.exports=Zd;zx=zTe().console||{},PTe={mapHttpRequest:RA,mapHttpResponse:RA,wrapRequestSerializer:aO,wrapResponseSerializer:aO,wrapErrorSerializer:aO,req:RA,res:RA,err:FG,errWithCause:FG};fO=Symbol("pino.logFuncs"),cO=Symbol("pino.hierarchy"),NTe={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};Zd.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},Zd.stdSerializers=PTe,Zd.stdTimeFunctions=Object.assign({},{nullTime:qG,epochTime:WG,unixTime:FTe,isoTime:VTe});Cl.exports.default=Zd;Pot=Cl.exports.pino=Zd,jTe={level:"info"},DA="custom_context",mO=1e3*1024,qTe=Object.defineProperty,WTe=(e,t,r)=>t in e?qTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$f=(e,t,r)=>WTe(e,typeof t!="symbol"?t+"":t,r),uO=class{constructor(t){$f(this,"nodeValue"),$f(this,"sizeInBytes"),$f(this,"next"),this.nodeValue=t,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}},BA=class{constructor(t){$f(this,"lengthInNodes"),$f(this,"sizeInBytes"),$f(this,"head"),$f(this,"tail"),$f(this,"maxSizeInBytes"),this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=t,this.sizeInBytes=0}append(t){let r=new uO(t);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${t} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;let t=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=t.size}toArray(){let t=[],r=this.head;for(;r!==null;)t.push(r.value),r=r.next;return t}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let t=this.head;return{next:()=>{if(!t)return{done:!0,value:null};let r=t.value;return t=t.next,{done:!1,value:r}}}}},KTe=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r);ZTe=Object.defineProperty,GTe=(e,t,r)=>t in e?ZTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OA=(e,t,r)=>GTe(e,typeof t!="symbol"?t+"":t,r),kA=class{constructor(t,r=mO){OA(this,"logs"),OA(this,"level"),OA(this,"levelValue"),OA(this,"MAX_LOG_SIZE_IN_BYTES"),this.level=t??"error",this.levelValue=Cl.exports.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new BA(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(t,r){r===Cl.exports.levels.values.error?console.error(t):r===Cl.exports.levels.values.warn?console.warn(t):r===Cl.exports.levels.values.debug?console.debug(t):r===Cl.exports.levels.values.trace?console.trace(t):console.log(t)}appendToLogs(t){this.logs.append(VG({timestamp:new Date().toISOString(),log:t}));let r=typeof t=="string"?JSON.parse(t).level:t.level;r>=this.levelValue&&this.forwardToConsole(t,r)}getLogs(){return this.logs}clearLogs(){this.logs=new BA(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(t){let r=this.getLogArray();return r.push(VG({extraMetadata:t})),new Blob(r,{type:"application/json"})}},YTe=Object.defineProperty,JTe=(e,t,r)=>t in e?YTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QTe=(e,t,r)=>JTe(e,typeof t!="symbol"?t+"":t,r),dO=class{constructor(t,r=mO){QTe(this,"baseChunkLogger"),this.baseChunkLogger=new kA(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}downloadLogsBlobInBrowser(t){let r=URL.createObjectURL(this.logsToBlob(t)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},XTe=Object.defineProperty,e_e=(e,t,r)=>t in e?XTe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,t_e=(e,t,r)=>e_e(e,typeof t!="symbol"?t+"":t,r),pO=class{constructor(t,r=mO){t_e(this,"baseChunkLogger"),this.baseChunkLogger=new kA(t,r)}write(t){this.baseChunkLogger.appendToLogs(t)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(t){return this.baseChunkLogger.logsToBlob(t)}},r_e=Object.defineProperty,n_e=Object.defineProperties,o_e=Object.getOwnPropertyDescriptors,zG=Object.getOwnPropertySymbols,s_e=Object.prototype.hasOwnProperty,i_e=Object.prototype.propertyIsEnumerable,jG=(e,t,r)=>t in e?r_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vf=(e,t)=>
17{for(var r in t||(t={}))s_e.call(t,r)&&jG(e,r,t[r]);if(zG)for(var r of zG(t))i_e.call(t,r)&&jG(e,r,t[r]);return e},zf=(e,t)=>n_e(e,o_e(t))});var no,rJ=h(()=>{no=class{}});var KA=h(()=>{rJ()});var oJ,ZA,zO,nJ,Bs,cy,jO=h(()=>{oJ=Lt(Cs()),ZA=Lt(Sd());KA();zO=class extends no{constructor(t){super()}},nJ=ZA.FIVE_SECONDS,Bs={pulse:"heartbeat_pulse"},cy=class e extends zO{constructor(t){super(t),this.events=new oJ.EventEmitter,this.interval=nJ,this.interval=t?.interval||nJ}static async init(t){let r=new e(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,ZA.toMiliseconds)(this.interval))}pulse(){this.events.emit(Bs.pulse)}}});function v7e(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){E7e(e);return}return t}function E7e(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function t8(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!x7e.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(w7e.test(e)||b7e.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,v7e)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}var w7e,b7e,x7e,sJ=h(()=>{w7e=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,b7e=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,x7e=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/});function A7e(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function qn(e,...t){try{return A7e(e(...t))}catch(r){return Promise.reject(r)}}function C7e(e){let t=typeof e;return e===null||t!=="object"&&t!=="function"}function S7e(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function r8(e){if(C7e(e))return String(e);if(S7e(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return r8(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function iJ(e){return typeof e=="string"?e:qO+T7e(e)}function aJ(e){return typeof e!="string"||!e.startsWith(qO)?e:I7e(e.slice(qO.length))}function I7e(e){return globalThis.Buffer?Buffer.from(e,"base64"):Uint8Array.from(globalThis.atob(e),t=>t.codePointAt(0))}function T7e(e){return globalThis.Buffer?Buffer.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function ks(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function cJ(...e){return ks(e.join(":"))}function n8(e){return e=ks(e),e?e+":":""}function lJ(e,t){if(t===void 0)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}function uJ(e,t){return t?e.startsWith(t)&&e[e.length-1]!=="$":e[e.length-1]!=="$"}var qO,dJ=h(()=>{qO="base64:"});function hJ(e={}){let t={mounts:{"":e.driver||P7e()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=l=>{for(let u of t.mountpoints)if(l.startsWith(u))return{base:u,relativeKey:l.slice(u.length),driver:t.mounts[u]};return{base:"",relativeKey:l,driver:t.mounts[""]}},n=(l,u)=>t.mountpoints.filter(d=>d.startsWith(l)||u&&l.startsWith(d)).map(d=>({relativeBase:l.length>d.length?l.slice(d.length):void 0,mountpoint:d,driver:t.mounts[d]})),o=(l,u)=>{if(t.watching){u=ks(u);for(let d of t.watchListeners)d(l,u)}},s=async()=>{if(!t.watching){t.watching=!0;for(let l in t.mounts)t.unwatch[l]=await pJ(t.mounts[l],o,l)}},i=async()=>
vendor: 5,189 bytes, line 17
17{if(t.watching){for(let l in t.unwatch)await t.unwatch[l]();t.unwatch={},t.watching=!1}},a=(l,u,d)=>{let p=new Map,f=m=>{let g=p.get(m.base);return g||(g={driver:m.driver,base:m.base,items:[]},p.set(m.base,g)),g};for(let m of l){let g=typeof m=="string",y=ks(g?m:m.key),b=g?void 0:m.value,C=g||!m.options?u:{...u,...m.options},w=r(y);f(w).items.push({key:y,value:b,relativeKey:w.relativeKey,options:C})}return Promise.all([...p.values()].map(m=>d(m))).then(m=>m.flat())},c={hasItem(l,u={}){l=ks(l);let{relativeKey:d,driver:p}=r(l);return qn(p.hasItem,d,u)},getItem(l,u={}){l=ks(l);let{relativeKey:d,driver:p}=r(l);return qn(p.getItem,d,u).then(f=>t8(f))},getItems(l,u={}){return a(l,u,d=>d.driver.getItems?qn(d.driver.getItems,d.items.map(p=>({key:p.relativeKey,options:p.options})),u).then(p=>p.map(f=>({key:cJ(d.base,f.key),value:t8(f.value)}))):Promise.all(d.items.map(p=>qn(d.driver.getItem,p.relativeKey,p.options).then(f=>({key:p.key,value:t8(f)})))))},getItemRaw(l,u={}){l=ks(l);let{relativeKey:d,driver:p}=r(l);return p.getItemRaw?qn(p.getItemRaw,d,u):qn(p.getItem,d,u).then(f=>aJ(f))},async setItem(l,u,d={}){if(u===void 0)return c.removeItem(l);l=ks(l);let{relativeKey:p,driver:f}=r(l);f.setItem&&(await qn(f.setItem,p,r8(u),d),f.watch||o("update",l))},async setItems(l,u){await a(l,u,async d=>{if(d.driver.setItems)return qn(d.driver.setItems,d.items.map(p=>({key:p.relativeKey,value:r8(p.value),options:p.options})),u);d.driver.setItem&&await Promise.all(d.items.map(p=>qn(d.driver.setItem,p.relativeKey,r8(p.value),p.options)))})},async setItemRaw(l,u,d={}){if(u===void 0)return c.removeItem(l,d);l=ks(l);let{relativeKey:p,driver:f}=r(l);if(f.setItemRaw)await qn(f.setItemRaw,p,u,d);else if(f.setItem)await qn(f.setItem,p,iJ(u),d);else return;f.watch||o("update",l)},async removeItem(l,u={}){typeof u=="boolean"&&(u={removeMeta:u}),l=ks(l);let{relativeKey:d,driver:p}=r(l);p.removeItem&&(await qn(p.removeItem,d,u),(u.removeMeta||u.removeMata)&&await qn(p.removeItem,d+"$",u),p.watch||o("remove",l))},async getMeta(l,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),l=ks(l);let{relativeKey:d,driver:p}=r(l),f=Object.create(null);if(p.getMeta&&Object.assign(f,await qn(p.getMeta,d,u)),!u.nativeOnly){let m=await qn(p.getItem,d+"$",u).then(g=>t8(g));m&&typeof m=="object"&&(typeof m.atime=="string"&&(m.atime=new Date(m.atime)),typeof m.mtime=="string"&&(m.mtime=new Date(m.mtime)),Object.assign(f,m))}return f},setMeta(l,u,d={}){return this.setItem(l+"$",u,d)},removeMeta(l,u={}){return this.removeItem(l+"$",u)},async getKeys(l,u={}){l=n8(l);let d=n(l,!0),p=[],f=[],m=!0;for(let y of d){y.driver.flags?.maxDepth||(m=!1);let b=await qn(y.driver.getKeys,y.relativeBase,u);for(let C of b){let w=y.mountpoint+ks(C);p.some(x=>w.startsWith(x))||f.push(w)}p=[y.mountpoint,...p.filter(C=>!C.startsWith(y.mountpoint))]}let g=u.maxDepth!==void 0&&!m;return f.filter(y=>(!g||lJ(y,u.maxDepth))&&uJ(y,l))},async clear(l,u={}){l=n8(l),await Promise.all(n(l,!1).map(async d=>{if(d.driver.clear)return qn(d.driver.clear,d.relativeBase,u);if(d.driver.removeItem){let p=await d.driver.getKeys(d.relativeBase||"",u);return Promise.all(p.map(f=>d.driver.removeItem(f,u)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(l=>fJ(l)))},async watch(l){return await s(),t.watchListeners.push(l),async()=>{t.watchListeners=t.watchListeners.filter(u=>u!==l),t.watchListeners.length===0&&await i()}},async unwatch(){t.watchListeners=[],await i()},mount(l,u){if(l=n8(l),l&&t.mounts[l])throw new Error(`already mounted at ${l}`);return l&&(t.mountpoints.push(l),t.mountpoints.sort((d,p)=>p.length-d.length)),t.mounts[l]=u,t.watching&&Promise.resolve(pJ(u,o,l)).then(d=>{t.unwatch[l]=d}).catch(console.error),c},async unmount(l,u=!0){l=n8(l),!(!l||!t.mounts[l])&&(t.watching&&l in t.unwatch&&(t.unwatch[l]?.(),delete t.unwatch[l]),u&&await fJ(t.mounts[l]),t.mountpoints=t.mountpoints.filter(d=>d!==l),delete t.mounts[l])},getMount(l=""){l=ks(l)+":";let u=r(l);return{driver:u.driver,base:u.base}},getMounts(l="",u={}){return l=ks(l),n(l,u.parents).map(p=>({driver:p.driver,base:p.mountpoint}))},keys:(l,u={})=>c.getKeys(l,u),get:(l,u={})=>c.getItem(l,u),set:(l,u,d={})=>c.setItem(l,u,d),has:(l,u={})=>c.hasItem(l,u),del:(l,u={})=>c.removeItem(l,u),remove:(l,u={})=>c.removeItem(l,u)};return c}function pJ(e,t,r){return e.watch?e.watch((n,o)=>t(n,r+o)):()=>{}}async function fJ(e){typeof e.dispose=="function"&&await qn(e.dispose)}var _7e,P7e,mJ=h(()=>{sJ();dJ();_7e="memory",P7e=()=>{let e=new Map;return{name:_7e,getInstance:()=>e,hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys(){return[...e.keys()]},clear(){e.clear()},dispose(){e.clear()}}}});function t1(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function KO(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let n=t1(r);return(o,s)=>n.then(i=>s(i.transaction(t,o).objectStore(t)))}function o8(){return WO||(WO=KO("keyval-store","keyval")),WO}function ZO(e,t=o8()){return t("readonly",r=>t1(r.get(e)))}
17function gJ(e,t,r=o8()){return r("readwrite",n=>(n.put(t,e),t1(n.transaction)))}function yJ(e,t=o8()){return t("readwrite",r=>(r.delete(e),t1(r.transaction)))}function wJ(e=o8()){return e("readwrite",t=>(t.clear(),t1(t.transaction)))}function N7e(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},t1(e.transaction)}function bJ(e=o8()){return e("readonly",t=>{if(t.getAllKeys)return t1(t.getAllKeys());let r=[];return N7e(t,n=>r.push(n.key)).then(()=>r)})}var WO,xJ=h(()=>{});function D7e(e){var t;return[e[0],Rs((t=e[1])!=null?t:"")]}var R7e,O7e,B7e,k7e,YO,GO,GA,JO,U7e,vJ,L7e,M7e,ly,QO=h(()=>{mJ();xJ();Wm();R7e="idb-keyval",O7e=(e={})=>{let t=e.base&&e.base.length>0?`${e.base}:`:"",r=o=>t+o,n;return e.dbName&&e.storeName&&(n=KO(e.dbName,e.storeName)),{name:R7e,options:e,async hasItem(o){return!(typeof await ZO(r(o),n)>"u")},async getItem(o){return await ZO(r(o),n)??null},setItem(o,s){return gJ(r(o),s,n)},removeItem(o){return yJ(r(o),n)},getKeys(){return bJ(n)},clear(){return wJ(n)}}},B7e="WALLET_CONNECT_V2_INDEXED_DB",k7e="keyvaluestorage",YO=class{constructor(){this.indexedDb=hJ({driver:O7e({dbName:B7e,storeName:k7e})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(t=>[t.key,t.value])}async getItem(t){let r=await this.indexedDb.getItem(t);if(r!==null)return r}async setItem(t,r){await this.indexedDb.setItem(t,si(r))}async removeItem(t){await this.indexedDb.removeItem(t)}},GO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},GA={exports:{}};(function(){let e;function t(){}e=t,e.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},e.prototype.setItem=function(r,n){this[r]=String(n)},e.prototype.removeItem=function(r){delete this[r]},e.prototype.clear=function(){let r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},e.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof GO<"u"&&GO.localStorage?GA.exports=GO.localStorage:typeof window<"u"&&window.localStorage?GA.exports=window.localStorage:GA.exports=new t})();JO=class{constructor(){this.localStorage=GA.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(D7e)}async getItem(t){let r=this.localStorage.getItem(t);if(r!==null)return Rs(r)}async setItem(t,r){this.localStorage.setItem(t,si(r))}async removeItem(t){this.localStorage.removeItem(t)}},U7e="wc_storage_version",vJ=1,L7e=async(e,t,r)=>{let n=U7e,o=await t.getItem(n);if(o&&o>=vJ){r(t);return}let s=await e.getKeys();if(!s.length){r(t);return}let i=[];for(;s.length;){let a=s.shift();if(!a)continue;let c=a.toLowerCase();if(c.includes("wc@")||c.includes("walletconnect")||c.includes("wc_")||c.includes("wallet_connect")){let l=await e.getItem(a);await t.setItem(a,l),i.push(a)}}await t.setItem(n,vJ),r(t),M7e(e,i)},M7e=async(e,t)=>{t.length&&t.forEach(async r=>{await e.removeItem(r)})},ly=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};let t=new JO;this.storage=t;try{let r=new YO;L7e(t,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(t){return await this.initialize(),this.storage.getItem(t)}async setItem(t,r){return await this.initialize(),this.storage.setItem(t,r)}async removeItem(t){return await this.initialize(),this.storage.removeItem(t)}async initialize(){this.initialized||await new Promise(t=>{let r=setInterval(()=>{this.initialized&&(clearInterval(r),t())},20)})}}});var AJ,CJ,SJ,IJ,lC,s8,XO,uC,Kf,i8,dC=h(()=>{AJ="PARSE_ERROR",CJ="INVALID_REQUEST",SJ="METHOD_NOT_FOUND",IJ="INVALID_PARAMS",lC="INTERNAL_ERROR",s8="SERVER_ERROR",XO=[-32700,-32600,-32601,-32602,-32603],uC=[-32e3,-32099],Kf={[AJ]:{code:-32700,message:"Parse error"},[CJ]:{code:-32600,message:"Invalid Request"},[SJ]:{code:-32601,message:"Method not found"},[IJ]:{code:-32602,message:"Invalid params"},[lC]:{code:-32603,message:"Internal error"},[s8]:{code:-32e3,message:"Server error"}},i8=s8});function H7e(e){return e<=uC[0]&&e>=uC[1]}function pC(e){return XO.includes(e)}function TJ(e){return typeof e=="number"}function fC(e){return Object.keys(Kf).includes(e)?Kf[e]:Kf[i8]}function hC(e){let t=Object.values(Kf).find(r=>r.code===e);return t||Kf[i8]}function $7e(e){if(typeof e.error.code>"u")return{valid:!1,error:"Missing code for JSON-RPC error"};if(typeof e.error.message>"u")return{valid:!1,error:"Missing message for JSON-RPC error"};if(!TJ(e.error.code))return{valid:!1,error:`Invalid error code type for JSON-RPC: ${e.error.code}`};if(pC(e.error.code)){let t=hC(e.error.code);
17if(t.message!==Kf[i8].message&&e.error.message===t.message)return{valid:!1,error:`Invalid error code message for JSON-RPC: ${e.error.code}`}}return{valid:!0}}function a8(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}var eB=h(()=>{dC()});var PJ=ot(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});Zf.isBrowserCryptoAvailable=Zf.getSubtleCrypto=Zf.getBrowerCrypto=void 0;function tB(){return(global==null?void 0:global.crypto)||(global==null?void 0:global.msCrypto)||{}}Zf.getBrowerCrypto=tB;function _J(){let e=tB();return e.subtle||e.webkitSubtle}Zf.getSubtleCrypto=_J;function F7e(){return!!tB()&&!!_J()}Zf.isBrowserCryptoAvailable=F7e});var OJ=ot(Gf=>{"use strict";Object.defineProperty(Gf,"__esModule",{value:!0});Gf.isBrowser=Gf.isNode=Gf.isReactNative=void 0;function NJ(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Gf.isReactNative=NJ;function RJ(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Gf.isNode=RJ;function V7e(){return!NJ()&&!RJ()}Gf.isBrowser=V7e});var rB=ot(mC=>{"use strict";Object.defineProperty(mC,"__esModule",{value:!0});var BJ=(A2(),Q6(E2));BJ.__exportStar(PJ(),mC);BJ.__exportStar(OJ(),mC)});var Zo={};Ce(Zo,{isNodeJs:()=>DJ});var kJ,DJ,UJ=h(()=>{kJ=Lt(rB());As(Zo,Lt(rB()));DJ=kJ.isNode});function wn(e=3){let t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function bn(e=6){return BigInt(wn(e))}function lr(e,t,r){return{id:r||wn(),jsonrpc:"2.0",method:e,params:t}}function oo(e,t){return{id:e,jsonrpc:"2.0",result:t}}function Zi(e,t,r){return{id:e,jsonrpc:"2.0",error:LJ(t,r)}}function LJ(e,t){return typeof e>"u"?fC(lC):(typeof e=="string"&&(e=Object.assign(Object.assign({},fC(s8)),{message:e})),typeof t<"u"&&(e.data=t),pC(e.code)&&(e=hC(e.code)),e)}var MJ=h(()=>{eB();dC()});function z7e(e){return e.includes("*")?yC(e):!/\W/g.test(e)}function gC(e){return e==="*"}function yC(e){return gC(e)?!0:!(!e.includes("*")||e.split("*").length!==2||e.split("*").filter(t=>t.trim()==="").length!==1)}function j7e(e){return!gC(e)&&yC(e)&&!e.split("*")[0].trim()}function q7e(e){return!gC(e)&&yC(e)&&!e.split("*")[1].trim()}var HJ=h(()=>{});var c8,nB,wC,l8,$J=h(()=>{c8=class{},nB=class extends c8{constructor(t){super()}},wC=class extends c8{constructor(){super()}},l8=class extends wC{constructor(t){super()}}});var FJ=h(()=>{$J()});function Z7e(e){let t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function VJ(e,t){let r=Z7e(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function bC(e){return VJ(e,W7e)}function xC(e){return VJ(e,K7e)}function oB(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}var W7e,K7e,zJ=h(()=>{W7e="^https?:",K7e="^wss?:"});function sB(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function Cc(e){return sB(e)&&"method"in e}function Gi(e){return sB(e)&&(Vr(e)||xr(e))}function Vr(e){return"result"in e}function xr(e){return"error"in e}function G7e(e){return"error"in e&&e.valid===!1}var jJ=h(()=>{});var Yi={};Ce(Yi,{DEFAULT_ERROR:()=>i8,IBaseJsonRpcProvider:()=>wC,IEvents:()=>c8,IJsonRpcConnection:()=>nB,IJsonRpcProvider:()=>l8,INTERNAL_ERROR:()=>lC,INVALID_PARAMS:()=>IJ,INVALID_REQUEST:()=>CJ,METHOD_NOT_FOUND:()=>SJ,PARSE_ERROR:()=>AJ,RESERVED_ERROR_CODES:()=>XO,SERVER_ERROR:()=>s8,SERVER_ERROR_CODE_RANGE:()=>uC,STANDARD_ERROR_MAP:()=>Kf,formatErrorMessage:()=>LJ,formatJsonRpcError:()=>Zi,formatJsonRpcRequest:()=>lr,formatJsonRpcResult:()=>oo,getBigIntRpcId:()=>bn,getError:()=>fC,getErrorByCode:()=>hC,isHttpUrl:()=>bC,isJsonRpcError:()=>xr,isJsonRpcPayload:()=>sB,isJsonRpcRequest:()=>Cc,isJsonRpcResponse:()=>Gi,isJsonRpcResult:()=>Vr,isJsonRpcValidationInvalid:()=>G7e,isLocalhostUrl:()=>oB,isNodeJs:()=>DJ,isReservedErrorCode:()=>pC,isServerErrorCode:()=>H7e,isValidDefaultRoute:()=>gC,isValidErrorCode:()=>TJ,isValidLeadingWildcardRoute:()=>j7e,isValidRoute:()=>z7e,isValidTrailingWildcardRoute:()=>q7e,isValidWildcardRoute:()=>yC,isWsUrl:()=>xC,parseConnectionError:()=>a8,payloadId:()=>wn,validateJsonRpcError:()=>$7e});var Sc=h(()=>{dC();eB();UJ();As(Yi,Zo);MJ();HJ();FJ();zJ();jJ()});var qJ,Ji,uy=h(()=>{qJ=Lt(Cs());Sc();Ji=class extends l8{constructor(t){super(t),this.events=new qJ.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(lr(t.method,t.params||[],t.id||bn().toString()),r)}async requestStrict(t,r){return new Promise(async(n,o)=>
vendor: 5,064 bytes, line 17
17{if(!this.connection.connected)try{await this.open()}catch(s){o(s)}this.events.on(`${t.id}`,s=>{xr(s)?o(s.error):n(s.result)});try{await this.connection.send(t,r)}catch(s){o(s)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Gi(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}});var KJ=ot((Mst,WJ)=>{"use strict";WJ.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}});var YJ,Y7e,J7e,ZJ,GJ,Q7e,dy,iB=h(()=>{YJ=Lt(Cs());Wm();Sc();Y7e=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:KJ(),J7e=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",ZJ=e=>e.split("?")[0],GJ=10,Q7e=Y7e(),dy=class{constructor(t){if(this.url=t,this.events=new YJ.EventEmitter,this.registering=!1,!xC(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(si(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!xC(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);if(this.registering){let r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),o(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return o(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{let o=(0,Yi.isReactNative)()?void 0:{rejectUnauthorized:!oB(t)},s=new Q7e(t,[],o);J7e()?s.onerror=i=>{let a=i;n(this.emitError(a.error))}:s.on("error",i=>{n(this.emitError(i))}),s.onopen=()=>{this.onOpen(s),r(s)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;let r=typeof t.data=="string"?Rs(t.data):t.data;this.events.emit("payload",r)}onError(t,r){let n=this.parseError(r),o=n.message||n.toString(),s=Zi(t,o);this.events.emit("payload",s)}parseError(t,r=this.url){return a8(t,ZJ(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>GJ&&this.events.setMaxListeners(GJ)}emitError(t){let r=this.parseError(new Error(t?.message||`WebSocket connection failed for host: ${ZJ(this.url)}`));return this.events.emit("register_error",r),r}}});var _Q=ot((th,TQ)=>{var WC=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,KC=(function(){function e(){this.fetch=!1,this.DOMException=WC.DOMException}return e.prototype=WC,new e})();(function(e){var t=(function(r){var n=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},o={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&(function(){try{return new Blob,!0}catch{return!1}})(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(I){return I&&DataView.prototype.isPrototypeOf(I)}if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array
17]"],a=ArrayBuffer.isView||function(I){return I&&i.indexOf(Object.prototype.toString.call(I))>-1};function c(I){if(typeof I!="string"&&(I=String(I)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(I)||I==="")throw new TypeError('Invalid character in header field name: "'+I+'"');return I.toLowerCase()}function l(I){return typeof I!="string"&&(I=String(I)),I}function u(I){var R={next:function(){var A=I.shift();return{done:A===void 0,value:A}}};return o.iterable&&(R[Symbol.iterator]=function(){return R}),R}function d(I){this.map={},I instanceof d?I.forEach(function(R,A){this.append(A,R)},this):Array.isArray(I)?I.forEach(function(R){if(R.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+R.length);this.append(R[0],R[1])},this):I&&Object.getOwnPropertyNames(I).forEach(function(R){this.append(R,I[R])},this)}d.prototype.append=function(I,R){I=c(I),R=l(R);var A=this.map[I];this.map[I]=A?A+", "+R:R},d.prototype.delete=function(I){delete this.map[c(I)]},d.prototype.get=function(I){return I=c(I),this.has(I)?this.map[I]:null},d.prototype.has=function(I){return this.map.hasOwnProperty(c(I))},d.prototype.set=function(I,R){this.map[c(I)]=l(R)},d.prototype.forEach=function(I,R){for(var A in this.map)this.map.hasOwnProperty(A)&&I.call(R,this.map[A],A,this)},d.prototype.keys=function(){var I=[];return this.forEach(function(R,A){I.push(A)}),u(I)},d.prototype.values=function(){var I=[];return this.forEach(function(R){I.push(R)}),u(I)},d.prototype.entries=function(){var I=[];return this.forEach(function(R,A){I.push([A,R])}),u(I)},o.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function p(I){if(!I._noBody){if(I.bodyUsed)return Promise.reject(new TypeError("Already read"));I.bodyUsed=!0}}function f(I){return new Promise(function(R,A){I.onload=function(){R(I.result)},I.onerror=function(){A(I.error)}})}function m(I){var R=new FileReader,A=f(R);return R.readAsArrayBuffer(I),A}function g(I){var R=new FileReader,A=f(R),T=/charset=([A-Za-z0-9_-]+)/.exec(I.type),v=T?T[1]:"utf-8";return R.readAsText(I,v),A}function y(I){for(var R=new Uint8Array(I),A=new Array(R.length),T=0;T<R.length;T++)A[T]=String.fromCharCode(R[T]);return A.join("")}function b(I){if(I.slice)return I.slice(0);var R=new Uint8Array(I.byteLength);return R.set(new Uint8Array(I)),R.buffer}function C(){return this.bodyUsed=!1,this._initBody=function(I){this.bodyUsed=this.bodyUsed,this._bodyInit=I,I?typeof I=="string"?this._bodyText=I:o.blob&&Blob.prototype.isPrototypeOf(I)?this._bodyBlob=I:o.formData&&FormData.prototype.isPrototypeOf(I)?this._bodyFormData=I:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)?this._bodyText=I.toString():o.arrayBuffer&&o.blob&&s(I)?(this._bodyArrayBuffer=b(I.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(I)||a(I))?this._bodyArrayBuffer=b(I):this._bodyText=I=Object.prototype.toString.call(I):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof I=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(I)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var I=p(this);if(I)return I;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var I=p(this);return I||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(o.blob)return this.blob().then(m);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var I=p(this);if(I)return I;if(this._bodyBlob)return g(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(P)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function x(I){var R=I.toUpperCase();return w.indexOf(R)>-1?R:I}function S(I,R){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object c
17onstructor cannot be called as a function.');R=R||{};var A=R.body;if(I instanceof S){if(I.bodyUsed)throw new TypeError("Already read");this.url=I.url,this.credentials=I.credentials,R.headers||(this.headers=new d(I.headers)),this.method=I.method,this.mode=I.mode,this.signal=I.signal,!A&&I._bodyInit!=null&&(A=I._bodyInit,I.bodyUsed=!0)}else this.url=String(I);if(this.credentials=R.credentials||this.credentials||"same-origin",(R.headers||!this.headers)&&(this.headers=new d(R.headers)),this.method=x(R.method||this.method||"GET"),this.mode=R.mode||this.mode||null,this.signal=R.signal||this.signal||(function(){if("AbortController"in n){var E=new AbortController;return E.signal}})(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&A)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(A),(this.method==="GET"||this.method==="HEAD")&&(R.cache==="no-store"||R.cache==="no-cache")){var T=/([?&])_=[^&]*/;if(T.test(this.url))this.url=this.url.replace(T,"$1_="+new Date().getTime());else{var v=/\?/;this.url+=(v.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})};function P(I){var R=new FormData;return I.trim().split("&").forEach(function(A){if(A){var T=A.split("="),v=T.shift().replace(/\+/g," "),E=T.join("=").replace(/\+/g," ");R.append(decodeURIComponent(v),decodeURIComponent(E))}}),R}function D(I){var R=new d,A=I.replace(/\r?\n[\t ]+/g," ");return A.split("\r").map(function(T){return T.indexOf(`
18`)===0?T.substr(1,T.length):T}).forEach(function(T){var v=T.split(":"),E=v.shift().trim();if(E){var O=v.join(":").trim();try{R.append(E,O)}catch(B){console.warn("Response "+B.message)}}}),R}C.call(S.prototype);function U(I,R){if(!(this instanceof U))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(R||(R={}),this.type="default",this.status=R.status===void 0?200:R.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=R.statusText===void 0?"":""+R.statusText,this.headers=new d(R.headers),this.url=R.url||"",this._initBody(I)}C.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},U.error=function(){var I=new U(null,{status:200,statusText:""});return I.ok=!1,I.status=0,I.type="error",I};var N=[301,302,303,307,308];U.redirect=function(I,R){if(N.indexOf(R)===-1)throw new RangeError("Invalid status code");return new U(null,{status:R,headers:{location:I}})},r.DOMException=n.DOMException;try{new r.DOMException}catch{r.DOMException=function(R,A){this.message=R,this.name=A;var T=Error(R);this.stack=T.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function L(I,R){return new Promise(function(A,T){var v=new S(I,R);if(v.signal&&v.signal.aborted)return T(new r.DOMException("Aborted","AbortError"));var E=new XMLHttpRequest;function O(){E.abort()}E.onload=function(){var M={statusText:E.statusText,headers:D(E.getAllResponseHeaders()||"")};v.url.indexOf("file://")===0&&(E.status<200||E.status>599)?M.status=200:M.status=E.status,M.url="responseURL"in E?E.responseURL:M.headers.get("X-Request-URL");var F="response"in E?E.response:E.responseText;setTimeout(function(){A(new U(F,M))},0)},E.onerror=function(){setTimeout(function(){T(new TypeError("Network request failed"))},0)},E.ontimeout=function(){setTimeout(function(){T(new TypeError("Network request timed out"))},0)},E.onabort=function(){setTimeout(function(){T(new r.DOMException("Aborted","AbortError"))},0)};function B(M){try{return M===""&&n.location.href?n.location.href:M}catch{return M}}if(E.open(v.method,B(v.url),!0),v.credentials==="include"?E.withCredentials=!0:v.credentials==="omit"&&(E.withCredentials=!1),"responseType"in E&&(o.blob?E.responseType="blob":o.arrayBuffer&&(E.responseType="arraybuffer")),R&&typeof R.headers=="object"&&!(R.headers instanceof d||n.Headers&&R.headers instanceof n.Headers)){var _=[];
18Object.getOwnPropertyNames(R.headers).forEach(function(M){_.push(c(M)),E.setRequestHeader(M,l(R.headers[M]))}),v.headers.forEach(function(M,F){_.indexOf(F)===-1&&E.setRequestHeader(F,M)})}else v.headers.forEach(function(M,F){E.setRequestHeader(F,M)});v.signal&&(v.signal.addEventListener("abort",O),E.onreadystatechange=function(){E.readyState===4&&v.signal.removeEventListener("abort",O)}),E.send(typeof v._bodyInit>"u"?null:v._bodyInit)})}return L.polyfill=!0,n.fetch||(n.fetch=L,n.Headers=d,n.Request=S,n.Response=U),r.Headers=d,r.Request=S,r.Response=U,r.fetch=L,Object.defineProperty(r,"__esModule",{value:!0}),r})({})})(KC);KC.fetch.ponyfill=!0;delete KC.fetch.polyfill;var vy=WC.fetch?WC:KC;th=vy.fetch;th.default=vy.fetch;th.fetch=vy.fetch;th.Headers=vy.Headers;th.Request=vy.Request;th.Response=vy.Response;TQ.exports=th});var DQ,MB,KPe,ZPe,GPe,PQ,YPe,JPe,NQ,RQ,OQ,QPe,XPe,BQ,kQ,Ha,ZC=h(()=>{DQ=Lt(Cs()),MB=Lt(_Q());Wm();Sc();KPe=Object.defineProperty,ZPe=Object.defineProperties,GPe=Object.getOwnPropertyDescriptors,PQ=Object.getOwnPropertySymbols,YPe=Object.prototype.hasOwnProperty,JPe=Object.prototype.propertyIsEnumerable,NQ=(e,t,r)=>t in e?KPe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,RQ=(e,t)=>{for(var r in t||(t={}))YPe.call(t,r)&&NQ(e,r,t[r]);if(PQ)for(var r of PQ(t))JPe.call(t,r)&&NQ(e,r,t[r]);return e},OQ=(e,t)=>ZPe(e,GPe(t)),QPe={Accept:"application/json","Content-Type":"application/json"},XPe="POST",BQ={headers:QPe,method:XPe},kQ=10,Ha=class{constructor(t,r=!1){if(this.url=t,this.disableProviderPing=r,this.events=new DQ.EventEmitter,this.isAvailable=!1,this.registering=!1,!bC(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);this.url=t,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(t){this.isAvailable||await this.register();try{let r=si(t),n=await(await(0,MB.default)(this.url,OQ(RQ({},BQ),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(t.id,r)}}async register(t=this.url){if(!bC(t))throw new Error(`Provided URL is not compatible with HTTP connection: ${t}`);if(this.registering){let r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,o)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),o(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return o(new Error("HTTP connection is missing or invalid"));n()})})}this.url=t,this.registering=!0;try{if(!this.disableProviderPing){let r=si({id:1,jsonrpc:"2.0",method:"test",params:[]});await(0,MB.default)(t,OQ(RQ({},BQ),{body:r}))}this.onOpen()}catch(r){let n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(t){if(typeof t.data>"u")return;let r=typeof t.data=="string"?Rs(t.data):t.data;this.events.emit("payload",r)}onError(t,r){let n=this.parseError(r),o=n.message||n.toString(),s=Zi(t,o);this.events.emit("payload",s)}parseError(t,r=this.url){return a8(t,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>kQ&&this.events.setMaxListeners(kQ)}}});var h8,JQ=h(()=>{h8={isLowerCaseMatch(e,t){return e?.toLowerCase()===t?.toLowerCase()}}});var j,m8=h(()=>{j={WC_NAME_SUFFIX:".reown.id",WC_NAME_SUFFIX_LEGACY:".wcn.id",BLOCKCHAIN_API_RPC_URL:"https://rpc.walletconnect.org",PULSE_API_URL:"https://pulse.walletconnect.org",W3M_API_URL:"https://api.web3modal.org",CONNECTOR_ID:{WALLET_CONNECT:"walletConnect",INJECTED:"injected",WALLET_STANDARD:"announced",COINBASE:"coinbaseWallet",COINBASE_SDK:"coinbaseWalletSDK",BASE_ACCOUNT:"baseAccount",SAFE:"safe",LEDGER:"ledger",OKX:"okx",EIP6963:"eip6963",AUTH:"AUTH"},CONNECTOR_NAMES:{AUTH:"Auth"},AUTH_CONNECTOR_SUPPORTED_CHAINS:["eip155","solana"],LIMITS:{PENDING_TRANSACTIONS:99},CHAIN:{EVM:"eip155",SOLANA:"solana",POLKADOT:"polkadot",BITCOIN:"bip122",TON:"ton",TRON:"tron"}
18,CHAIN_NAME_MAP:{eip155:"EVM Networks",solana:"Solana",polkadot:"Polkadot",bip122:"Bitcoin",cosmos:"Cosmos",sui:"Sui",stacks:"Stacks",ton:"TON",tron:"TRON"},ADAPTER_TYPES:{BITCOIN:"bitcoin",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",TON:"ton",TRON:"tron"},USDT_CONTRACT_ADDRESSES:["0xdac17f958d2ee523a2206206994597c13d831ec7","0xc2132d05d31c914a87c6611c10748aeb04b58e8f","0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7","0x919C1c267BC06a7039e03fcc2eF738525769109c","0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e","0x55d398326f99059fF775485246999027B3197955","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"],SOLANA_SPL_TOKEN_ADDRESSES:{SOL:"So11111111111111111111111111111111111111112"},NATIVE_IMAGE_IDS_BY_NAMESPACE:{eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"3e8119e5-2a6f-4818-c50c-1937011d5900",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00"},TOKEN_SYMBOLS_BY_ADDRESS:{"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48":"USDC","0x833589fcd6edb6e08f4c7c32d4f71b54bda02913":"USDC","0x0b2c639c533813f4aa9d7837caf62653d097ff85":"USDC","0xaf88d065e77c8cc2239327c5edb3a432268e5831":"USDC","0x3c499c542cef5e3811e1192ce70d8cc03d5c3359":"USDC","0x2791bca1f2de4661ed88a30c99a7a9449aa84174":"USDC",EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:"USDC","0xdac17f958d2ee523a2206206994597c13d831ec7":"USDT","0x94b008aa00579c1307b0ef2c499ad98a8ce58e58":"USDT","0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9":"USDT","0xc2132d05d31c914a87c6611c10748aeb04b58e8f":"USDT",Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB:"USDT"},HTTP_STATUS_CODES:{SERVER_ERROR:500,TOO_MANY_REQUESTS:429,SERVICE_UNAVAILABLE:503,FORBIDDEN:403},UNSUPPORTED_NETWORK_NAME:"Unknown Network",SECURE_SITE_SDK_ORIGIN:(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",REMOTE_FEATURES_ALERTS:{MULTI_WALLET_NOT_ENABLED:{DEFAULT:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com."},CONNECTIONS_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnections hook."},CONNECTION_HOOK:{displayMessage:"Multi-Wallet Not Enabled",debugMessage:"Multi-wallet support is not enabled. Please enable it in your AppKit configuration at cloud.reown.com to use the useAppKitConnection hook."}},HEADLESS_NOT_ENABLED:{DEFAULT:{displayMessage:"",debugMessage:"Headless support is not enabled. Please enable it with the features.headless option in the AppKit configuration and make sure your current plan supports it."}}},IS_DEVELOPMENT:typeof process<"u"&&!1,DEFAULT_ALLOWED_ANCESTORS:["http://localhost:*","https://localhost:*","http://127.0.0.1:*","https://127.0.0.1:*","https://*.pages.dev","https://*.vercel.app","https://*.ngrok-free.app","https://secure-mobile.walletconnect.com","https://secure-mobile.walletconnect.org"],METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:"eip155",ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH"}});var o1,JC,QQ=h(()=>{m8();o1={caipNetworkIdToNumber(e){return e?Number(e.split(":")[1]):void 0},parseEvmChainId(e){return typeof e=="string"?this.caipNetworkIdToNumber(e):e},getNetworksByNamespace(e,t){return e?.filter(r=>r.chainNamespace===t)||[]},getFirstNetworkByNamespace(e,t){return this.getNetworksByNamespace(e,t)[0]},getNetworkNameByCaipNetworkId(e,t){if(!t)return;let r=e.find(o=>o.caipNetworkId===t);if(r)return r.name;let[n]=t.split(":");return j.CHAIN_NAME_MAP?.[n]||void 0}},JC=["eip155","solana","polkadot","bip122","cosmos","sui","stacks"]});function tX(){function e(t){var r=this;if(!(r instanceof e))return t===Nl?tX():new e(t);if(t instanceof e)r.s=t.s,r.e=t.e,r.c=t.c.slice();else{if(typeof t!="string"){if(e.strict===!0&&typeof t!="bigint")throw TypeError(i1+"value");t=t===0&&1/t<0?"-0":String(t)}CNe(r,t)}r.constructor=e}return e.prototype=hr,e.DP=yNe,e.RM=wNe,e.NE=bNe,e.PE=xNe,e.strict=vNe,e.roundDown=0,e.roundHalfUp=1,e.roundHalfEven=2,e.roundUp=3,e}function CNe(e,t){var r,n,o;if(!ANe.test(t))throw Error(i1+"number");for(e.s=t.charAt(0)=="-"?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),o=t.length,n=0;n<o&&t.charAt(n)=="0";)++n;
vendor: 4,428 bytes, line 18
18if(n==o)e.c=[e.e=0];else{for(;o>0&&t.charAt(--o)=="0";);for(e.e=r-n-1,e.c=[],r=0;n<=o;)e.c[r++]=+t.charAt(n++)}return e}function a1(e,t,r,n){var o=e.c;if(r===Nl&&(r=e.constructor.RM),r!==0&&r!==1&&r!==2&&r!==3)throw Error(ENe);if(t<1)n=r===3&&(n||!!o[0])||t===0&&(r===1&&o[0]>=5||r===2&&(o[0]>5||o[0]===5&&(n||o[1]!==Nl))),o.length=1,n?(e.e=e.e-t+1,o[0]=1):o[0]=e.e=0;else if(t<o.length){if(n=r===1&&o[t]>=5||r===2&&(o[t]>5||o[t]===5&&(n||o[t+1]!==Nl||o[t-1]&1))||r===3&&(n||!!o[0]),o.length=t,n){for(;++o[--t]>9;)if(o[t]=0,t===0){++e.e,o.unshift(1);break}}for(t=o.length;!o[--t];)o.pop()}return e}function c1(e,t,r){var n=e.e,o=e.c.join(""),s=o.length;if(t)o=o.charAt(0)+(s>1?"."+o.slice(1):"")+(n<0?"e":"e+")+n;else if(n<0){for(;++n;)o="0"+o;o="0."+o}else if(n>0)if(++n>s)for(n-=s;n--;)o+="0";else n<s&&(o=o.slice(0,n)+"."+o.slice(n));else s>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&r?"-"+o:o}var yNe,wNe,s1,XQ,bNe,xNe,vNe,g8,i1,QC,ENe,eX,hr,Nl,ANe,SNe,_c,rX=h(()=>{yNe=20,wNe=1,s1=1e6,XQ=1e6,bNe=-7,xNe=21,vNe=!1,g8="[big.js] ",i1=g8+"Invalid ",QC=i1+"decimal places",ENe=i1+"rounding mode",eX=g8+"Division by zero",hr={},Nl=void 0,ANe=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;hr.abs=function(){var e=new this.constructor(this);return e.s=1,e};hr.cmp=function(e){var t,r=this,n=r.c,o=(e=new r.constructor(e)).c,s=r.s,i=e.s,a=r.e,c=e.e;if(!n[0]||!o[0])return n[0]?s:o[0]?-i:0;if(s!=i)return s;if(t=s<0,a!=c)return a>c^t?1:-1;for(i=(a=n.length)<(c=o.length)?a:c,s=-1;++s<i;)if(n[s]!=o[s])return n[s]>o[s]^t?1:-1;return a==c?0:a>c^t?1:-1};hr.div=function(e){var t=this,r=t.constructor,n=t.c,o=(e=new r(e)).c,s=t.s==e.s?1:-1,i=r.DP;if(i!==~~i||i<0||i>s1)throw Error(QC);if(!o[0])throw Error(eX);if(!n[0])return e.s=s,e.c=[e.e=0],e;var a,c,l,u,d,p=o.slice(),f=a=o.length,m=n.length,g=n.slice(0,a),y=g.length,b=e,C=b.c=[],w=0,x=i+(b.e=t.e-e.e)+1;for(b.s=s,s=x<0?0:x,p.unshift(0);y++<a;)g.push(0);do{for(l=0;l<10;l++){if(a!=(y=g.length))u=a>y?1:-1;else for(d=-1,u=0;++d<a;)if(o[d]!=g[d]){u=o[d]>g[d]?1:-1;break}if(u<0){for(c=y==a?o:p;y;){if(g[--y]<c[y]){for(d=y;d&&!g[--d];)g[d]=9;--g[d],g[y]+=10}g[y]-=c[y]}for(;!g[0];)g.shift()}else break}C[w++]=u?l:++l,g[0]&&u?g[y]=n[f]||0:g=[n[f]]}while((f++<m||g[0]!==Nl)&&s--);return!C[0]&&w!=1&&(C.shift(),b.e--,x--),w>x&&a1(b,x,r.RM,g[0]!==Nl),b};hr.eq=function(e){return this.cmp(e)===0};hr.gt=function(e){return this.cmp(e)>0};hr.gte=function(e){return this.cmp(e)>-1};hr.lt=function(e){return this.cmp(e)<0};hr.lte=function(e){return this.cmp(e)<1};hr.minus=hr.sub=function(e){var t,r,n,o,s=this,i=s.constructor,a=s.s,c=(e=new i(e)).s;if(a!=c)return e.s=-c,s.plus(e);var l=s.c.slice(),u=s.e,d=e.c,p=e.e;if(!l[0]||!d[0])return d[0]?e.s=-c:l[0]?e=new i(s):e.s=1,e;if(a=u-p){for((o=a<0)?(a=-a,n=l):(p=u,n=d),n.reverse(),c=a;c--;)n.push(0);n.reverse()}else for(r=((o=l.length<d.length)?l:d).length,a=c=0;c<r;c++)if(l[c]!=d[c]){o=l[c]<d[c];break}if(o&&(n=l,l=d,d=n,e.s=-e.s),(c=(r=d.length)-(t=l.length))>0)for(;c--;)l[t++]=0;for(c=t;r>a;){if(l[--r]<d[r]){for(t=r;t&&!l[--t];)l[t]=9;--l[t],l[r]+=10}l[r]-=d[r]}for(;l[--c]===0;)l.pop();for(;l[0]===0;)l.shift(),--p;return l[0]||(e.s=1,l=[p=0]),e.c=l,e.e=p,e};hr.mod=function(e){var t,r=this,n=r.constructor,o=r.s,s=(e=new n(e)).s;if(!e.c[0])throw Error(eX);return r.s=e.s=1,t=e.cmp(r)==1,r.s=o,e.s=s,t?new n(r):(o=n.DP,s=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=o,n.RM=s,this.minus(r.times(e)))};hr.neg=function(){var e=new this.constructor(this);return e.s=-e.s,e};hr.plus=hr.add=function(e){var t,r,n,o=this,s=o.constructor;if(e=new s(e),o.s!=e.s)return e.s=-e.s,o.minus(e);var i=o.e,a=o.c,c=e.e,l=e.c;if(!a[0]||!l[0])return l[0]||(a[0]?e=new s(o):e.s=o.s),e;if(a=a.slice(),t=i-c){for(t>0?(c=i,n=l):(t=-t,n=a),n.reverse();t--;)n.push(0);n.reverse()}for(a.length-l.length<0&&(n=l,l=a,a=n),t=l.length,r=0;t;a[t]%=10)r=(a[--t]=a[t]+l[t]+r)/10|0;for(r&&(a.unshift(r),++c),t=a.length;a[--t]===0;)a.pop();return e.c=a,e.e=c,e};hr.pow=function(e){var t=this,r=new t.constructor("1"),n=r,o=e<0;if(e!==~~e||e<-XQ||e>XQ)throw Error(i1+"exponent");for(o&&(e=-e);e&1&&(n=n.times(t)),e>>=1,!!e;)t=t.times(t);return o?r.div(n):n};hr.prec=function(e,t){if(e!==~~e||e<1||e>s1)throw Error(i1+"precision");return a1(new this.constructor(this),e,t)};hr.round=function(e,t){if(e===Nl)e=0;else if(e!==~~e||e<-s1||e>s1)throw Error(QC);return a1(new this.constructor(this),e+this.e+1,t)};hr.sqrt=function(){var e,t,r,n=this,o=n.constructor,s=n.s,i=n.e,a=new o("0.5");
18if(!n.c[0])return new o(n);if(s<0)throw Error(g8+"No square root");s=Math.sqrt(+c1(n,!0,!0)),s===0||s===1/0?(t=n.c.join(""),t.length+i&1||(t+="0"),s=Math.sqrt(t),i=((i+1)/2|0)-(i<0||i&1),e=new o((s==1/0?"5e":(s=s.toExponential()).slice(0,s.indexOf("e")+1))+i)):e=new o(s+""),i=e.e+(o.DP+=4);do r=e,e=a.times(r.plus(n.div(r)));while(r.c.slice(0,i).join("")!==e.c.slice(0,i).join(""));return a1(e,(o.DP-=4)+e.e+1,o.RM)};hr.times=hr.mul=function(e){var t,r=this,n=r.constructor,o=r.c,s=(e=new n(e)).c,i=o.length,a=s.length,c=r.e,l=e.e;if(e.s=r.s==e.s?1:-1,!o[0]||!s[0])return e.c=[e.e=0],e;for(e.e=c+l,i<a&&(t=o,o=s,s=t,l=i,i=a,a=l),t=new Array(l=i+a);l--;)t[l]=0;for(c=a;c--;){for(a=0,l=i+c;l>c;)a=t[l]+s[c]*o[l-c-1]+a,t[l--]=a%10,a=a/10|0;t[l]=a}for(a?++e.e:t.shift(),c=t.length;!t[--c];)t.pop();return e.c=t,e};hr.toExponential=function(e,t){var r=this,n=r.c[0];if(e!==Nl){if(e!==~~e||e<0||e>s1)throw Error(QC);for(r=a1(new r.constructor(r),++e,t);r.c.length<e;)r.c.push(0)}return c1(r,!0,!!n)};hr.toFixed=function(e,t){var r=this,n=r.c[0];if(e!==Nl){if(e!==~~e||e<0||e>s1)throw Error(QC);for(r=a1(new r.constructor(r),e+r.e+1,t),e=e+r.e+1;r.c.length<e;)r.c.push(0)}return c1(r,!1,!!n)};hr[Symbol.for("nodejs.util.inspect.custom")]=hr.toJSON=hr.toString=function(){var e=this,t=e.constructor;return c1(e,e.e<=t.NE||e.e>=t.PE,!!e.c[0])};hr.toNumber=function(){var e=+c1(this,!0,!0);if(this.constructor.strict===!0&&!this.eq(e.toString()))throw Error(g8+"Imprecise conversion");return e};hr.toPrecision=function(e,t){var r=this,n=r.constructor,o=r.c[0];if(e!==Nl){if(e!==~~e||e<1||e>s1)throw Error(i1+"precision");for(r=a1(new n(r),e,t);r.c.length<e;)r.c.push(0)}return c1(r,e<=r.e||r.e<=n.NE||r.e>=n.PE,!!o)};hr.valueOf=function(){var e=this,t=e.constructor;if(t.strict===!0)throw Error(g8+"valueOf disallowed");return c1(e,e.e<=t.NE||e.e>=t.PE,!0)};SNe=tX(),_c=SNe});var dt,nX=h(()=>{rX();dt={bigNumber(e,t={safe:!1}){try{return e?new _c(e):new _c(0)}catch(r){if(t.safe)return new _c(0);throw r}},formatNumber(e,t){let{decimals:r,round:n=8,safe:o=!0}=t;return dt.bigNumber(e,{safe:o}).div(new _c(10).pow(r)).round(n)},multiply(e,t){if(e===void 0||t===void 0)return new _c(0);let r=new _c(e),n=new _c(t);return r.times(n)},toFixed(e,t=2){return e===void 0||e===""?new _c(0).toFixed(t):new _c(e).toFixed(t)},formatNumberToLocalString(e,t=2){return e===void 0||e===""?"0.00":typeof e=="number"?e.toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"}):parseFloat(e).toLocaleString("en-US",{maximumFractionDigits:t,minimumFractionDigits:t,roundingMode:"floor"})},parseLocalStringToNumber(e){if(e===void 0||e==="")return 0;let t=e.replace(/,/gu,"");return new _c(t).toNumber()}}});var oX,sX=h(()=>{oX=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_value",type:"uint256"}],outputs:[{name:"",type:"bool"}]}]});var iX,aX=h(()=>{iX=[{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}]});var cX,lX=h(()=>{cX=[{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]}]});var y8,uX=h(()=>{sX();aX();lX();m8();y8={getERC20Abi:e=>j.USDT_CONTRACT_ADDRESSES.includes(e)?cX:oX,getSwapAbi:()=>iX}});var rh,dX=h(()=>{m8();rh={ConnectorExplorerIds:{[j.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.BASE_ACCOUNT]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[j.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[j.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
18a09c0faed0709",[j.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[j.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[j.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[j.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[j.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[j.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[j.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[j.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[j.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[j.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[j.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[j.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[j.BINANCE_CONNECTOR_NAME]:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"},ConnectorImageIds:{[j.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[j.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[j.CONNECTOR_ID.BASE_ACCOUNT]:"bba2c8be-7fd1-463e-42b1-796ecb0ad200",[j.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[j.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[j.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[j.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[j.CONNECTOR_ID.INJECTED]:"Browser Wallet",[j.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[j.CONNECTOR_ID.COINBASE]:"Coinbase",[j.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[j.CONNECTOR_ID.BASE_ACCOUNT]:"Base Account",[j.CONNECTOR_ID.LEDGER]:"Ledger",[j.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[j.CONNECTOR_ID.INJECTED]:"INJECTED",[j.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[j.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[j.CONNECTOR_ID.AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]}});var Qe,pX=h(()=>{Qe={validateCaipAddress(e){if(e.split(":")?.length!==3)throw new Error("Invalid CAIP Address");return e},parseCaipAddress(e){let t=e.split(":");if(t.length!==3)throw new Error(`Invalid CAIP-10 address: ${e}`);let[r,n,o]=t;if(!r||!n||!o)throw new Error(`Invalid CAIP-10 address: ${e}`);return{chainNamespace:r,chainId:n,address:o}},parseCaipNetworkId(e){let t=e.split(":");if(t.length!==2)throw new Error(`Invalid CAIP-2 network id: ${e}`);let[r,n]=t;if(!r||!n)throw new Error(`Invalid CAIP-2 network id: ${e}`);return{chainNamespace:r,chainId:n}}}});var Ds,ZB,l1,fX=h(()=>{Ds={RPC_ERROR_CODE:{USER_REJECTED_REQUEST:4001,USER_REJECTED_METHODS:5002,USER_REJECTED:5e3,SEND_TRANSACTION_ERROR:5001},PROVIDER_RPC_ERROR_NAME:{PROVIDER_RPC:"ProviderRpcError",USER_REJECTED_REQUEST:"UserRejectedRequestError",SEND_TRANSACTION_ERROR:"SendTransactionError"},isRpcProviderError(e){try{if(typeof e=="object"&&e!==null){let t=e,r=typeof t.message=="string",n=typeof t.code=="number";return r&&n}return!1}catch{return!1}},isUserRejectedMessage(e){return e.toLowerCase().includes("user rejected")||e.toLowerCase().includes("user cancelled")||e.toLowerCase().includes("user canceled")},isUserRejectedRequestError(e){if(Ds.isRpcProviderError(e)){let t=e.code===Ds.RPC_ERROR_CODE.USER_REJECTED_REQUEST,r=e.code===Ds.RPC_ERROR_CODE.USER_REJECTED_METHODS;return t||r||Ds.isUserRejectedMessage(e.message)}return e instanceof Error?Ds.isUserRejectedMessage(e.message):!1}}
18,ZB=class extends Error{constructor(t,r){super(r.message,{cause:t}),this.name=Ds.PROVIDER_RPC_ERROR_NAME.PROVIDER_RPC,this.code=r.code}},l1=class extends ZB{constructor(t){super(t,{code:Ds.RPC_ERROR_CODE.USER_REJECTED_REQUEST,message:"User rejected the request"}),this.name=Ds.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST}}});function w8(e){if(!e)throw new Error("Namespace is required for CONNECTED_CONNECTOR_ID");return`@appkit/${e}:connected_connector_id`}function u1(){return typeof window<"u"&&typeof localStorage<"u"}var Le,Be,hX=h(()=>{Le={WALLET_ID:"@appkit/wallet_id",WALLET_NAME:"@appkit/wallet_name",SOLANA_WALLET:"@appkit/solana_wallet",SOLANA_CAIP_CHAIN:"@appkit/solana_caip_chain",ACTIVE_CAIP_NETWORK_ID:"@appkit/active_caip_network_id",CONNECTED_SOCIAL:"@appkit/connected_social",CONNECTED_SOCIAL_USERNAME:"@appkit-wallet/SOCIAL_USERNAME",RECENT_WALLETS:"@appkit/recent_wallets",RECENT_WALLET:"@appkit/recent_wallet",DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",ACTIVE_NAMESPACE:"@appkit/active_namespace",CONNECTED_NAMESPACES:"@appkit/connected_namespaces",CONNECTION_STATUS:"@appkit/connection_status",SIWX_AUTH_TOKEN:"@appkit/siwx-auth-token",SIWX_NONCE_TOKEN:"@appkit/siwx-nonce-token",TELEGRAM_SOCIAL_PROVIDER:"@appkit/social_provider",NATIVE_BALANCE_CACHE:"@appkit/native_balance_cache",PORTFOLIO_CACHE:"@appkit/portfolio_cache",ENS_CACHE:"@appkit/ens_cache",IDENTITY_CACHE:"@appkit/identity_cache",PREFERRED_ACCOUNT_TYPES:"@appkit/preferred_account_types",CONNECTIONS:"@appkit/connections",DISCONNECTED_CONNECTOR_IDS:"@appkit/disconnected_connector_ids",HISTORY_TRANSACTIONS_CACHE:"@appkit/history_transactions_cache",TOKEN_PRICE_CACHE:"@appkit/token_price_cache",RECENT_EMAILS:"@appkit/recent_emails",LATEST_APPKIT_VERSION:"@appkit/latest_version",TON_WALLETS_CACHE:"@appkit/ton_wallets_cache"};Be={setItem(e,t){u1()&&t!==void 0&&localStorage.setItem(e,t)},getItem(e){if(u1())return localStorage.getItem(e)||void 0},removeItem(e){u1()&&localStorage.removeItem(e)},clear(){u1()&&localStorage.clear()}}});function d1(e,t){let r=e?.["--apkt-accent"]??e?.["--w3m-accent"];return t==="light"?{"--w3m-accent":r||"hsla(231, 100%, 70%, 1)","--w3m-background":"#fff"}:{"--w3m-accent":r||"hsla(230, 100%, 67%, 1)","--w3m-background":"#202020"}}var mX=h(()=>{});var it=h(()=>{JQ();QQ();nX();uX();m8();dX();pX();fX();hX();mX()});var INe,gX,GB,TNe,yX,YB,wX=h(()=>{INe=Symbol(),gX=Object.getPrototypeOf,GB=new WeakMap,TNe=e=>e&&(GB.has(e)?GB.get(e):gX(e)===Object.prototype||gX(e)===Array.prototype),yX=e=>TNe(e)&&e[INe]||null,YB=(e,t=!0)=>{GB.set(e,t)}});function Xe(e={}){if(!QB(e))throw new Error("object required");let t=b8.get(e);if(t)return t;let r=XC[0],n=new Set,o=(y,b=++XC[0])=>{r!==b&&(s=r=b,n.forEach(C=>C(y,b)))},s=r,i=(y=XC[0])=>(s!==y&&(s=y,c.forEach(([b])=>{let C=b[1](y);C>r&&(r=C)})),r),a=y=>(b,C)=>{let w=[...b];w[1]=[y,...w[1]],o(w,C)},c=new Map,l=(y,b)=>{let C=!x8.has(b)&&nh.get(b);if(C){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&c.has(y))throw new Error("prop listener already exists");if(n.size){let w=C[2](a(y));c.set(y,[C,w])}else c.set(y,[C])}},u=y=>{var b;let C=c.get(y);C&&(c.delete(y),(b=C[1])==null||b.call(C))},d=y=>(n.add(y),n.size===1&&c.forEach(([C,w],x)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&w)throw new Error("remove already exists");let S=C[2](a(x));c.set(x,[C,S])}),()=>{n.delete(y),n.size===0&&c.forEach(([C,w],x)=>{w&&(w(),c.set(x,[C]))})}),p=!0,f=BNe(()=>p,l,u,o),m=NNe(e,f);b8.set(e,m);let g=[e,i,d];return nh.set(m,g),Reflect.ownKeys(e).forEach(y=>{let b=Object.getOwnPropertyDescriptor(e,y);"value"in b&&b.writable&&(m[y]=e[y])}),p=!1,m}function Ot(e,t,r){let n=nh.get(e);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let o,s=[],i=n[2],a=!1,l=i(u=>{if(s.push(u),r){t(s.splice(0));return}o||(o=Promise.resolve().then(()=>{o=void 0,a&&t(s.splice(0))}))});return a=!0,()=>{a=!1,l()}}function Rl(e){let t=nh.get(e);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!t&&console.warn("Please use proxy object");let[r,n]=t;return ONe(r,n())}function tp(e){return x8.add(e),e}function XB(){return{proxyStateMap:nh,refSet:x8,snapCache:JB,versionHolder:XC,proxyCache:b8}}var QB,_Ne,xX,PNe,nh,x8,JB,XC,b8,bX,NNe,RNe,ONe,BNe,Rr=h(()=>{wX();QB=e=>typeof e=="object"&&e!==null,_Ne=e=>QB(e)&&!x8.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise),xX=(e,t)=>{let r=JB.get(e);if(r?.[0]===t)return r[1];let n=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return YB(n,!0),JB.set(e,[t,n]),Reflect.ownKeys(e).forEach(o=>{if(Object.getOwnPropertyDescriptor(n,o))return;let s=Reflect.get(e,o),{enumerable:i}=Reflect.getOwnPropertyDescriptor(e,o),a={value:s,enumerable:i,configurable:!0};if(x8.has(s))YB(s,!1);else if(nh.has(s)){let[c,l]=nh.get(s);a.value=xX(c,l())}Object.defineProperty(n,o,a)}),Object.preventExtensions(n)},PNe=(e,t,r,n)=>({deleteProperty(o,s){let i=Reflect.get(o,s);r(s);let a=Reflect.deleteProperty(o,s);return a&&n(["delete",[s],i]),a},set(o,s,i,a){let c=!e()&&Reflect.has(o,s),l=Reflect.get(o,s,a);if(c&&(bX(l,i)||b8.has(i)&&bX(l,b8.get(i))))return!0;r(s),QB(i)&&(i=yX(i)||i);let u=!nh.has(i)&&RNe(i)?Xe(i):i;return t(s,u),Reflect.set(o,s,u,a),n(["set",[s],i,l]),!0}}
18),nh=new WeakMap,x8=new WeakSet,JB=new WeakMap,XC=[1],b8=new WeakMap,bX=Object.is,NNe=(e,t)=>new Proxy(e,t),RNe=_Ne,ONe=xX,BNe=PNe});function Ct(e,t,r,n){let o=e[t];return Ot(e,()=>{let s=e[t];Object.is(o,s)||r(o=s)},n)}function vX(e){let t=[],r=0,n=new Map,o=new WeakMap,s=()=>{let l=DNe.get(a),u=l?.[1];if(u&&!o.has(u)){let d=new Map(n);o.set(u,d)}},i=l=>o.get(l)||n;if(e){if(typeof e[Symbol.iterator]!="function")throw new TypeError(`proxyMap:
19	initial state must be iterable
20		tip: structure should be [[key, value]]`);for(let[l,u]of e)n.set(l,r),t[r++]=u}let a={data:t,index:r,epoch:0,get size(){return eS(this)||s(),i(this).size},get(l){let d=i(this).get(l);if(d===void 0){this.epoch;return}return this.data[d]},has(l){let u=i(this);return this.epoch,u.has(l)},set(l,u){if(!eS(this))throw new Error("Cannot perform mutations on a snapshot");let d=n.get(l);return d===void 0?(n.set(l,this.index),this.data[this.index++]=u):this.data[d]=u,this.epoch++,this},delete(l){if(!eS(this))throw new Error("Cannot perform mutations on a snapshot");let u=n.get(l);return u===void 0?!1:(delete this.data[u],n.delete(l),this.epoch++,!0)},clear(){if(!eS(this))throw new Error("Cannot perform mutations on a snapshot");this.data.length=0,this.index=0,this.epoch++,n.clear()},forEach(l){this.epoch,i(this).forEach((d,p)=>{l(this.data[d],p,this)})},*entries(){this.epoch;let l=i(this);for(let[u,d]of l)yield[u,this.data[d]]},*keys(){this.epoch;let l=i(this);for(let u of l.keys())yield u},*values(){this.epoch;let l=i(this);for(let u of l.values())yield this.data[u]},[Symbol.iterator](){return this.entries()},get[Symbol.toStringTag](){return"Map"},toJSON(){return new Map(this.entries())}},c=Xe(a);return Object.defineProperties(c,{size:{enumerable:!1},index:{enumerable:!1},epoch:{enumerable:!1},data:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(c),c}var kNe,DNe,eS,uct,dct,Pn=h(()=>{Rr();({proxyStateMap:kNe,snapCache:DNe}=XB()),eS=e=>kNe.has(e);({proxyStateMap:uct,snapCache:dct}=XB())});var ek,tk,EX,We,ea=h(()=>{it();ek=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",tk=[{label:"Meld.io",name:"meld",feeRange:"1-2%",url:"https://meldcrypto.com",supportedChains:["eip155","solana"]}],EX="WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",We={FOUR_MINUTES_MS:24e4,TEN_SEC_MS:1e4,FIVE_SEC_MS:5e3,THREE_SEC_MS:3e3,ONE_SEC_MS:1e3,SECURE_SITE:ek,SECURE_SITE_DASHBOARD:`${ek}/dashboard`,SECURE_SITE_FAVICON:`${ek}/images/favicon.png`,SOLANA_NATIVE_TOKEN_ADDRESS:"So11111111111111111111111111111111111111111",RESTRICTED_TIMEZONES:["ASIA/SHANGHAI","ASIA/URUMQI","ASIA/CHONGQING","ASIA/HARBIN","ASIA/KASHGAR","ASIA/MACAU","ASIA/HONG_KONG","ASIA/MACAO","ASIA/BEIJING","ASIA/HARBIN"],SWAP_SUGGESTED_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP"],SWAP_POPULAR_TOKENS:["ETH","UNI","1INCH","AAVE","SOL","ADA","AVAX","DOT","LINK","NITRO","GAIA","MILK","TRX","NEAR","GNO","WBTC","DAI","WETH","USDC","USDT","ARB","BAL","BICO","CRV","ENS","MATIC","OP","METAL","DAI","CHAMP","WOLF","SALE","BAL","BUSD","MUST","BTCpx","ROUTE","HEX","WELT","amDAI","VSQ","VISION","AURUM","pSP","SNX","VC","LINK","CHP","amUSDT","SPHERE","FOX","GIDDY","GFC","OMEN","OX_OLD","DE","WNT"],SUGGESTED_TOKENS_BY_CHAIN:{"eip155:42161":["USD\u20AE0"]},BALANCE_SUPPORTED_CHAINS:[j.CHAIN.EVM,j.CHAIN.SOLANA],SEND_PARAMS_SUPPORTED_CHAINS:[j.CHAIN.EVM],SWAP_SUPPORTED_NETWORKS:["eip155:1","eip155:42161","eip155:10","eip155:324","eip155:8453","eip155:56","eip155:137","eip155:100","eip155:43114","eip155:250","eip155:8217","eip155:1313161554"],NAMES_SUPPORTED_CHAIN_NAMESPACES:[j.CHAIN.EVM],ONRAMP_SUPPORTED_CHAIN_NAMESPACES:[j.CHAIN.EVM,j.CHAIN.SOLANA],PAY_WITH_EXCHANGE_SUPPORTED_CHAIN_NAMESPACES:[j.CHAIN.EVM,j.CHAIN.SOLANA],ACTIVITY_ENABLED_CHAIN_NAMESPACES:[j.CHAIN.EVM,j.CHAIN.TON],NATIVE_TOKEN_ADDRESS:{eip155:"0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",solana:"So11111111111111111111111111111111111111111",polkadot:"0x",bip122:"0x",cosmos:"0x",sui:"0x",stacks:"0x",ton:"0x",tron:"0x"},CONVERT_SLIPPAGE_TOLERANCE:1,CONNECT_LABELS:{MOBILE:"Open and continue in the wallet app",WEB:"Open and continue in the wallet app"},SEND_SUPPORTED_NAMESPACES:[j.CHAIN.EVM,j.CHAIN.SOLANA],DEFAULT_REMOTE_FEATURES:{swaps:["1inch"],onramp:["meld"],email:!0,socials:["google","x","discord","farcaster","github","apple","facebook"],activity:!0,reownBranding:!0,multiWallet:!1,emailCapture:!1,payWithExchange:!1,payments:!1,reownAuthentication:!1,headless:!1},DEFAULT_REMOTE_FEATURES_DISABLED:{email:!1,socials:!1,swaps:!1,onramp:!1,activity:!1,reownBranding:!1,emailCapture:!1,reownAuthentication:!1,headless:!1},DEFAULT_FEATURES:{receive:!0,send:!0,emailShowWallets:!0,connectorTypeOrder:["walletConnect","recent","
20injected","featured","custom","external","recommended"],analytics:!0,allWallets:!0,legalCheckbox:!1,smartSessions:!1,collapseWallets:!1,walletFeaturesOrder:["onramp","swaps","receive","send"],connectMethodsOrder:void 0,pay:!1,reownAuthentication:!1,headless:!1},DEFAULT_SOCIALS:["google","x","farcaster","discord","apple","github","facebook"],DEFAULT_ACCOUNT_TYPES:{bip122:"payment",eip155:"smartAccount",polkadot:"eoa",solana:"eoa",ton:"eoa",tron:"eoa"},ADAPTER_TYPES:{UNIVERSAL:"universal",SOLANA:"solana",WAGMI:"wagmi",ETHERS:"ethers",ETHERS5:"ethers5",BITCOIN:"bitcoin"},SIWX_DEFAULTS:{signOutOnDisconnect:!0},MANDATORY_WALLET_IDS_ON_MOBILE:[rh.ConnectorExplorerIds[j.CONNECTOR_ID.COINBASE],rh.ConnectorExplorerIds[j.CONNECTOR_ID.COINBASE_SDK],rh.ConnectorExplorerIds[j.CONNECTOR_ID.BASE_ACCOUNT],rh.ConnectorExplorerIds[j.SOLFLARE_CONNECTOR_NAME],rh.ConnectorExplorerIds[j.PHANTOM_CONNECTOR_NAME],rh.ConnectorExplorerIds[j.BINANCE_CONNECTOR_NAME]],DEFAULT_CONNECT_METHOD_ORDER:["email","social","wallet"]}});var ae,ta=h(()=>{it();ae={cacheExpiry:{portfolio:3e4,nativeBalance:3e4,ens:3e5,identity:3e5,transactionsHistory:15e3,tokenPrice:15e3,latestAppKitVersion:6048e5,tonWallets:864e5},isCacheExpired(e,t){return Date.now()-e>t},getActiveNetworkProps(){let e=ae.getActiveNamespace(),t=ae.getActiveCaipNetworkId(),r=t?t.split(":")[1]:void 0,n=r?isNaN(Number(r))?r:Number(r):void 0;return{namespace:e,caipNetworkId:t,chainId:n}},setWalletConnectDeepLink({name:e,href:t}){try{Be.setItem(Le.DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},getWalletConnectDeepLink(){try{let e=Be.getItem(Le.DEEPLINK_CHOICE);if(e)return JSON.parse(e)}catch{console.info("Unable to get WalletConnect deep link")}},deleteWalletConnectDeepLink(){try{Be.removeItem(Le.DEEPLINK_CHOICE)}catch{console.info("Unable to delete WalletConnect deep link")}},setActiveNamespace(e){try{Be.setItem(Le.ACTIVE_NAMESPACE,e)}catch{console.info("Unable to set active namespace")}},setActiveCaipNetworkId(e){try{Be.setItem(Le.ACTIVE_CAIP_NETWORK_ID,e),ae.setActiveNamespace(e.split(":")[0])}catch{console.info("Unable to set active caip network id")}},getActiveCaipNetworkId(){try{return Be.getItem(Le.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to get active caip network id");return}},deleteActiveCaipNetworkId(){try{Be.removeItem(Le.ACTIVE_CAIP_NETWORK_ID)}catch{console.info("Unable to delete active caip network id")}},deleteConnectedConnectorId(e){try{let t=w8(e);Be.removeItem(t)}catch{console.info("Unable to delete connected connector id")}},setAppKitRecent(e){try{let t=ae.getRecentWallets();t.find(n=>n.id===e.id)||(t.unshift(e),t.length>2&&t.pop(),Be.setItem(Le.RECENT_WALLETS,JSON.stringify(t)),Be.setItem(Le.RECENT_WALLET,JSON.stringify(e)))}catch{console.info("Unable to set AppKit recent")}},getRecentWallets(){try{let e=Be.getItem(Le.RECENT_WALLETS);return e?JSON.parse(e):[]}catch{console.info("Unable to get AppKit recent")}return[]},getRecentWallet(){try{let e=Be.getItem(Le.RECENT_WALLET);return e?JSON.parse(e):null}catch{console.info("Unable to get AppKit recent")}return null},deleteRecentWallet(){try{Be.removeItem(Le.RECENT_WALLET)}catch{console.info("Unable to delete AppKit recent")}},setConnectedConnectorId(e,t){try{let r=w8(e);Be.setItem(r,t)}catch{console.info("Unable to set Connected Connector Id")}},getActiveNamespace(){try{return Be.getItem(Le.ACTIVE_NAMESPACE)}catch{console.info("Unable to get active namespace")}},getConnectedConnectorId(e){if(e)try{let t=w8(e);return Be.getItem(t)}catch{console.info("Unable to get connected connector id in namespace",e)}},setConnectedSocialProvider(e){try{Be.setItem(Le.CONNECTED_SOCIAL,e)}catch{console.info("Unable to set connected social provider")}},getConnectedSocialProvider(){try{return Be.getItem(Le.CONNECTED_SOCIAL)}catch{console.info("Unable to get connected social provider")}},deleteConnectedSocialProvider(){try{Be.removeItem(Le.CONNECTED_SOCIAL)}catch{console.info("Unable to delete connected social provider")}},getConnectedSocialUsername(){try{return Be.getItem(Le.CONNECTED_SOCIAL_USERNAME)}catch{console.info("Unable to get connected social username")}},getStoredActiveCaipNetworkId(){return Be.getItem(Le.ACTIVE_CAIP_NETWORK_ID)?.split(":")?.[1]},setConnectionStatus(e){try{Be.setItem(Le.CONNECTION_STATUS,e)}catch{console.info("Unable to set connection status")}},getConnectionStatus(){try{return Be.getItem(Le.CONNECTION_STATUS)}catch{return}},getConnectedNamespaces(){try{let e=Be.getItem(Le.CONNECTED_NAMESPACES);return e?.length?e.split(","):[]}catch{return[]}},setConnectedNamespaces(e){try{let t=Array.from(new Set(e));Be.setItem(Le.CONNECTED_NAMESPACES,t.join(","))}catch{console.info("Unable to set namespaces in storage")}},addConnectedNamespace(e){try{let t=ae.getConnectedNamespaces();t.includes(e)||(t.push(e),ae.setConnectedNamespaces(t))}catch{console.info("Unable to add connected namespace")}},removeConnectedNamespace(e){try{let t=ae.getConnectedNamespaces(),r=t.indexOf(e);r>-1&&(t.splice(r,1),ae.setConnectedNamespaces(t))}catch{console.info("Unable to remove connected namespace")}},getTelegramSocialProvider(){try{return Be.getItem(Le.TELEGRAM_SOCIAL_PROVIDER)}catch{return console.info("Unable to get telegram social provider"),null}},setTelegramSocialProvider(e){try{Be.setItem(Le.TELEGRAM_SOCIAL_PROVIDER,e)}catch{console.info("Unable to set telegram social provider")}},removeTelegramSocialProvider(){try{Be.removeItem(Le.TELEGRAM_SOCIAL_PROVIDER)}catch{console.info("Unable to remove telegram social provider")}},getBalanceCache(){let e={};try{let t=Be.getItem(Le.PORTFOLIO_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e},removeAddressFromBalanceCache(e){try{let t=ae.getBalanceCache();Be.setItem(Le.PORTFOLIO_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getBalanceCacheForCaipAddress(e){try{let r=ae.getBalanceCache()[e];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.portfolio))return r.balance;ae.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateBalanceCache(e){try{let t=ae.getBalanceCache();t[e.caipAddress]=e,Be.setItem(Le.PORTFOLIO_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getNativeBalanceCache(){let e={};try{let t=Be.getItem(Le.NATIVE_BALANCE_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get balance cache")}return e},removeAddressFromNativeBalanceCache(e){try{let t=ae.getBalanceCache();Be.setItem(Le.NATIVE_BALANCE_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove address from balance cache",e)}},getNativeBalanceCacheForCaipAddress(e){try{let r=ae.getNativeBalanceCache()[e];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.nativeBalance))return r;console.info("Discarding cache for address",e),ae.removeAddressFromBalanceCache(e)}catch{console.info("Unable to get balance cache for address",e)}},updateNativeBalanceCache(e){try{let t=ae.getNativeBalanceCache();t[e.caipAddress]=e,Be.setItem(Le.NATIVE_BALANCE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update balance cache",e)}},getEnsCache(){let e={};try{let t=Be.getItem(Le.ENS_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get ens name cache")}return e}
vendor: 11,354 bytes, line 20
20,getEnsFromCacheForAddress(e){try{let r=ae.getEnsCache()[e];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.ens))return r.ens;ae.removeEnsFromCache(e)}catch{console.info("Unable to get ens name from cache",e)}},updateEnsCache(e){try{let t=ae.getEnsCache();t[e.address]=e,Be.setItem(Le.ENS_CACHE,JSON.stringify(t))}catch{console.info("Unable to update ens name cache",e)}},removeEnsFromCache(e){try{let t=ae.getEnsCache();Be.setItem(Le.ENS_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove ens name from cache",e)}},getIdentityCache(){let e={};try{let t=Be.getItem(Le.IDENTITY_CACHE);e=t?JSON.parse(t):{}}catch{console.info("Unable to get identity cache")}return e},getIdentityFromCacheForAddress(e){try{let r=ae.getIdentityCache()[e];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.identity))return r.identity;ae.removeIdentityFromCache(e)}catch{console.info("Unable to get identity from cache",e)}},updateIdentityCache(e){try{let t=ae.getIdentityCache();t[e.address]={identity:e.identity,timestamp:e.timestamp},Be.setItem(Le.IDENTITY_CACHE,JSON.stringify(t))}catch{console.info("Unable to update identity cache",e)}},removeIdentityFromCache(e){try{let t=ae.getIdentityCache();Be.setItem(Le.IDENTITY_CACHE,JSON.stringify({...t,[e]:void 0}))}catch{console.info("Unable to remove identity from cache",e)}},getTonWalletsCache(){try{let e=Be.getItem(Le.TON_WALLETS_CACHE),t=e?JSON.parse(e):void 0;if(t&&!this.isCacheExpired(t.timestamp,this.cacheExpiry.tonWallets))return t;ae.removeTonWalletsCache()}catch{console.info("Unable to get ton wallets cache")}},updateTonWalletsCache(e){try{let t=ae.getTonWalletsCache()||{timestamp:0,wallets:[]};t.timestamp=new Date().getTime(),t.wallets=e,Be.setItem(Le.TON_WALLETS_CACHE,JSON.stringify(t))}catch{console.info("Unable to update ton wallets cache",e)}},removeTonWalletsCache(){try{Be.removeItem(Le.TON_WALLETS_CACHE)}catch{console.info("Unable to remove ton wallets cache")}},clearAddressCache(){try{Be.removeItem(Le.PORTFOLIO_CACHE),Be.removeItem(Le.NATIVE_BALANCE_CACHE),Be.removeItem(Le.ENS_CACHE),Be.removeItem(Le.IDENTITY_CACHE),Be.removeItem(Le.HISTORY_TRANSACTIONS_CACHE)}catch{console.info("Unable to clear address cache")}},setPreferredAccountTypes(e){try{Be.setItem(Le.PREFERRED_ACCOUNT_TYPES,JSON.stringify(e))}catch{console.info("Unable to set preferred account types",e)}},getPreferredAccountTypes(){try{let e=Be.getItem(Le.PREFERRED_ACCOUNT_TYPES);return e?JSON.parse(e):{}}catch{console.info("Unable to get preferred account types")}return{}},setConnections(e,t){try{let r=ae.getConnections(),n=r[t]??[],o=new Map;for(let i of n)o.set(i.connectorId,{...i});for(let i of e){let a=o.get(i.connectorId),c=i.connectorId===j.CONNECTOR_ID.AUTH;if(a&&!c){let l=new Set(a.accounts.map(d=>d.address.toLowerCase())),u=i.accounts.filter(d=>!l.has(d.address.toLowerCase()));a.accounts.push(...u)}else o.set(i.connectorId,{...i})}let s={...r,[t]:Array.from(o.values())};Be.setItem(Le.CONNECTIONS,JSON.stringify(s))}catch(r){console.error("Unable to sync connections to storage",r)}},getConnections(){try{let e=Be.getItem(Le.CONNECTIONS);return e?JSON.parse(e):{}}catch(e){return console.error("Unable to get connections from storage",e),{}}},deleteAddressFromConnection({connectorId:e,address:t,namespace:r}){try{let n=ae.getConnections(),o=n[r]??[],s=new Map(o.map(a=>[a.connectorId,a])),i=s.get(e);i&&(i.accounts.filter(c=>c.address.toLowerCase()!==t.toLowerCase()).length===0?s.delete(e):s.set(e,{...i,accounts:i.accounts.filter(c=>c.address.toLowerCase()!==t.toLowerCase())})),Be.setItem(Le.CONNECTIONS,JSON.stringify({...n,[r]:Array.from(s.values())}))}catch{console.error(`Unable to remove address "${t}" from connector "${e}" in namespace "${r}"`)}},getDisconnectedConnectorIds(){try{let e=Be.getItem(Le.DISCONNECTED_CONNECTOR_IDS);return e?JSON.parse(e):{}}catch{console.info("Unable to get disconnected connector ids")}return{}},addDisconnectedConnectorId(e,t){try{let r=ae.getDisconnectedConnectorIds(),n=r[t]??[];n.push(e),Be.setItem(Le.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[t]:Array.from(new Set(n))}))}catch{console.error(`Unable to set disconnected connector id "${e}" for namespace "${t}"`)}},removeDisconnectedConnectorId(e,t){try{let r=ae.getDisconnectedConnectorIds(),n=r[t]??[];n=n.filter(o=>o.toLowerCase()!==e.toLowerCase()),Be.setItem(Le.DISCONNECTED_CONNECTOR_IDS,JSON.stringify({...r,[t]:Array.from(new Set(n))}))}catch{console.error(`Unable to remove disconnected connector id "${e}" for namespace "${t}"`)}},isConnectorDisconnected(e,t){try{return(ae.getDisconnectedConnectorIds()[t]??[]).some(o=>o.toLowerCase()===e.toLowerCase())}catch{console.info(`Unable to get disconnected connector id "${e}" for namespace "${t}"`)}return!1},getTransactionsCache(){try{let e=Be.getItem(Le.HISTORY_TRANSACTIONS_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get transactions cache")}return{}},getTransactionsCacheForAddress({address:e,chainId:t=""}){try{let n=ae.getTransactionsCache()[e]?.[t];if(n&&!this.isCacheExpired(n.timestamp,this.cacheExpiry.transactionsHistory))return n.transactions;ae.removeTransactionsCache({address:e,chainId:t})}catch{console.info("Unable to get transactions cache")}},updateTransactionsCache({address:e,chainId:t="",timestamp:r,transactions:n}){try{let o=ae.getTransactionsCache();o[e]={...o[e],[t]:{timestamp:r,transactions:n}},Be.setItem(Le.HISTORY_TRANSACTIONS_CACHE,JSON.stringify(o))}catch{console.info("Unable to update transactions cache",{address:e,chainId:t,timestamp:r,transactions:n})}},removeTransactionsCache({address:e,chainId:t}){try{let r=ae.getTransactionsCache(),n=r?.[e]||{},{[t]:o,...s}=n;Be.setItem(Le.HISTORY_TRANSACTIONS_CACHE,JSON.stringify({...r,[e]:s}))}catch{console.info("Unable to remove transactions cache",{address:e,chainId:t})}},getTokenPriceCache(){try{let e=Be.getItem(Le.TOKEN_PRICE_CACHE);return e?JSON.parse(e):{}}catch{console.info("Unable to get token price cache")}return{}},getTokenPriceCacheForAddresses(e){try{let r=ae.getTokenPriceCache()[e.join(",")];if(r&&!this.isCacheExpired(r.timestamp,this.cacheExpiry.tokenPrice))return r.tokenPrice;ae.removeTokenPriceCache(e)}catch{console.info("Unable to get token price cache for addresses",e)}},updateTokenPriceCache(e){try{let t=ae.getTokenPriceCache();t[e.addresses.join(",")]={timestamp:e.timestamp,tokenPrice:e.tokenPrice},Be.setItem(Le.TOKEN_PRICE_CACHE,JSON.stringify(t))}catch{console.info("Unable to update token price cache",e)}},removeTokenPriceCache(e){try{let t=ae.getTokenPriceCache();Be.setItem(Le.TOKEN_PRICE_CACHE,JSON.stringify({...t,[e.join(",")]:void 0}))}catch{console.info("Unable to remove token price cache",e)}},getLatestAppKitVersion(){try{let e=this.getLatestAppKitVersionCache(),t=e?.version;return t&&!this.isCacheExpired(e.timestamp,this.cacheExpiry.latestAppKitVersion)?t:void 0}catch{console.info("Unable to get latest AppKit version")}},getLatestAppKitVersionCache(){try{let e=Be.getItem(Le.LATEST_APPKIT_VERSION);return e?JSON.parse(e):{}}catch{console.info("Unable to get latest AppKit version cache")}return{}},updateLatestAppKitVersion(e){try{let t=ae.getLatestAppKitVersionCache();t.timestamp=e.timestamp,t.version=e.version,Be.setItem(Le.LATEST_APPKIT_VERSION,JSON.stringify(t))}catch{console.info("Unable to update latest AppKit version on local storage",e)}}}});var ee,xn=h(()=>{it();ea();ta();ee={getWindow(){if(!(typeof window>"u"))return window},isMobile(){return this.isClient()?!!(window?.matchMedia&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer:coarse)")?.matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},checkCaipNetwork(e,t=""){return e?.caipNetworkId.toLocaleLowerCase().includes(t.toLowerCase())},isAndroid(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return ee.isMobile()&&e.includes("android")},isIos(){if(!this.isMobile())return!1;let e=window?.navigator.userAgent.toLowerCase();return e.includes("iphone")||e.includes("ipad")},isSafari(){return this.isClient()?(window?.navigator.userAgent.toLowerCase()).includes("safari"):!1},isClient(){return typeof window<"u"},isPairingExpired(e){return e?e-Date.now()<=We.TEN_SEC_MS:!0},isAllowedRetry(e,t=We.ONE_SEC_MS){return Date.now()-e>=t},copyToClopboard(e){navigator.clipboard.writeText(e)},isIframe(){try{return window?.self!==window?.top}catch{return!1}},isSafeApp(){if(ee.isClient()&&window.self!==window.top)try{let e=window?.location?.ancestorOrigins?.[0],t="https://app.safe.global";if(e){let r=new URL(e),n=new URL(t);return r.hostname===n.hostname}}catch{return!1}return!1},getPairingExpiry(){return Date.now()+We.FOUR_MINUTES_MS},getNetworkId(e){return e?.split(":")[1]},getPlainAddress(e){return e?.split(":")[2]},async wait(e){return new Promise(t=>{setTimeout(t,e)})},debounce(e,t=500){let r;return(...n)=>{function o(){e(...n)}r&&clearTimeout(r),r=setTimeout(o,t)}},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},formatNativeUrl(e,t,r=null){if(ee.isHttpUrl(e))return this.formatUniversalUrl(e,t);let n=e,o=r;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),o&&!o?.endsWith("/")&&(o=`${o}/`),this.isTelegram()&&this.isAndroid()&&(t=encodeURIComponent(t));let s=encodeURIComponent(t);return{redirect:`${n}wc?uri=${s}`,redirectUniversalLink:o?`${o}wc?uri=${s}`:void 0,href:n}},formatUniversalUrl(e,t){if(!ee.isHttpUrl(e))return this.formatNativeUrl(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let n=encodeURIComponent(t);return{redirect:`${r}wc?uri=${n}`,href:r}},getOpenTargetForPlatform(e){return e==="popupWindow"?e:this.isTelegram()?ae.getTelegramSocialProvider()?"_top":"_blank":e},openHref(e,t,r){window?.open(e,this.getOpenTargetForPlatform(t),r||"noreferrer noopener")},returnOpenHref(e,t,r){return window?.open(e,this.getOpenTargetForPlatform(t),r||"noreferrer noopener")},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},isPWA(){if(typeof window>"u")return!1;let e=window?.matchMedia&&typeof window.matchMedia=="function"?window.matchMedia("(display-mode: standalone)")?.matches:!1,t=window?.navigator?.standalone;return!!(e||t)},async preloadImage(e){let t=new Promise((r,n)=>{let o=new Image;o.onload=r,o.onerror=n,o.crossOrigin="anonymous",o.src=e});return Promise.race([t,ee.wait(2e3)])},parseBalance(e,t){let r="0.000";if(typeof e=="string"){let c=Number(e);if(!isNaN(c)){let l=(Math.floor(c*1e3)/1e3).toFixed(3);l&&(r=l)}}let[n,o]=r.split("."),s=n||"0",i=o||"000";return{formattedText:`${s}.${i}${t?` ${t}`:""}`,value:s,decimals:i,symbol:t}},getApiUrl(){return j.W3M_API_URL},getBlockchainApiUrl(){return j.BLOCKCHAIN_API_RPC_URL},getAnalyticsUrl(){return j.PULSE_API_URL},getUUID(){return crypto?.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})},parseError(e){return typeof e=="string"?e:typeof e?.issues?.[0]?.message=="string"?e.issues[0].message:e instanceof Error?e.message:"Unknown error"},sortRequestedNetworks(e,t=[]){let r={};return t&&e&&(e.forEach((n,o)=>{r[n]=o}),t.sort((n,o)=>{let s=r[n.id],i=r[o.id];return s!==void 0&&i!==void 0?s-i:s!==void 0?-1:i!==void 0?1:0})),t},calculateBalance(e){let t=0;
20for(let r of e)t+=r.value??0;return t},formatTokenBalance(e){let t=e.toFixed(2),[r,n]=t.split(".");return{dollars:r,pennies:n}},isAddress(e,t="eip155"){switch(t){case"eip155":if(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)){if(/^(?:0x)?[0-9a-f]{40}$/iu.test(e)||/^(?:0x)?[0-9A-F]{40}$/iu.test(e))return!0}else return!1;return!1;case"solana":return/[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(e);case"bip122":{let r=/^[1][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(e),n=/^[3][a-km-zA-HJ-NP-Z1-9]{25,34}$/u.test(e),o=/^bc1[a-z0-9]{39,87}$/u.test(e),s=/^bc1p[a-z0-9]{58}$/u.test(e);return r||n||o||s}default:return!1}},uniqueBy(e,t){let r=new Set;return e.filter(n=>{let o=n[t];return r.has(o)?!1:(r.add(o),!0)})},generateSdkVersion(e,t,r){let o=e.length===0?We.ADAPTER_TYPES.UNIVERSAL:e.map(s=>s.adapterType).join(",");return`${t}-${o}-${r}`},createAccount(e){let{chainNamespace:t,chainId:r,address:n}=Qe.parseCaipAddress(e.caipAddress);return{namespace:t,address:n,chainId:r,caipAddress:e.caipAddress,type:e.type,publicKey:e.publicKey,path:e.path}},isCaipAddress(e){if(typeof e!="string")return!1;let t=e.split(":"),r=t[0];return t.filter(Boolean).length===3&&r in j.CHAIN_NAME_MAP},getAccount(e){return e?typeof e=="string"?{address:e,chainId:void 0}:{address:e.address,chainId:e.chainId}:{address:void 0,chainId:void 0}},isMac(){let e=window?.navigator.userAgent.toLowerCase();return e.includes("macintosh")&&!e.includes("safari")},formatTelegramSocialLoginUrl(e){let t=`--${encodeURIComponent(window?.location.href)}`,r="state=";if(new URL(e).host==="auth.magic.link"){let o="provider_authorization_url=",s=e.substring(e.indexOf(o)+o.length),i=this.injectIntoUrl(decodeURIComponent(s),r,t);return e.replace(s,encodeURIComponent(i))}return this.injectIntoUrl(e,r,t)},injectIntoUrl(e,t,r){let n=e.indexOf(t);if(n===-1)throw new Error(`${t} parameter not found in the URL: ${e}`);let o=e.indexOf("&",n),s=t.length,i=o!==-1?o:e.length,a=e.substring(0,n+s),c=e.substring(n+s,i),l=e.substring(o),u=c+r;return a+u+l},isNumber(e){return typeof e!="number"&&typeof e!="string"?!1:!isNaN(Number(e))},appendPayToUri(e,t){return t?`${e}&pay=${encodeURIComponent(t)}`:e}}});var UNe,vct,Ect,Act,$a,$r,v8=h(()=>{UNe="https://secure.walletconnect.org/sdk",vct=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL:void 0)||UNe,Ect=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_DEFAULT_LOG_LEVEL:void 0)||"error",Act=(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_SDK_VERSION:void 0)||"4",$a={APP_EVENT_KEY:"@w3m-app/",FRAME_EVENT_KEY:"@w3m-frame/",RPC_METHOD_KEY:"RPC_",STORAGE_KEY:"@appkit-wallet/",SESSION_TOKEN_KEY:"SESSION_TOKEN_KEY",EMAIL_LOGIN_USED_KEY:"EMAIL_LOGIN_USED_KEY",LAST_USED_CHAIN_KEY:"LAST_USED_CHAIN_KEY",LAST_EMAIL_LOGIN_TIME:"LAST_EMAIL_LOGIN_TIME",EMAIL:"EMAIL",PREFERRED_ACCOUNT_TYPE:"PREFERRED_ACCOUNT_TYPE",SMART_ACCOUNT_ENABLED:"SMART_ACCOUNT_ENABLED",SMART_ACCOUNT_ENABLED_NETWORKS:"SMART_ACCOUNT_ENABLED_NETWORKS",SOCIAL_USERNAME:"SOCIAL_USERNAME",APP_SWITCH_NETWORK:"@w3m-app/SWITCH_NETWORK",APP_CONNECT_EMAIL:"@w3m-app/CONNECT_EMAIL",APP_CONNECT_DEVICE:"@w3m-app/CONNECT_DEVICE",APP_CONNECT_OTP:"@w3m-app/CONNECT_OTP",APP_CONNECT_SOCIAL:"@w3m-app/CONNECT_SOCIAL",APP_GET_SOCIAL_REDIRECT_URI:"@w3m-app/GET_SOCIAL_REDIRECT_URI",APP_GET_USER:"@w3m-app/GET_USER",APP_SIGN_OUT:"@w3m-app/SIGN_OUT",APP_IS_CONNECTED:"@w3m-app/IS_CONNECTED",APP_GET_CHAIN_ID:"@w3m-app/GET_CHAIN_ID",APP_RPC_REQUEST:"@w3m-app/RPC_REQUEST",APP_UPDATE_EMAIL:"@w3m-app/UPDATE_EMAIL",APP_UPDATE_EMAIL_PRIMARY_OTP:"@w3m-app/UPDATE_EMAIL_PRIMARY_OTP",APP_UPDATE_EMAIL_SECONDARY_OTP:"@w3m-app/UPDATE_EMAIL_SECONDARY_OTP",APP_AWAIT_UPDATE_EMAIL:"@w3m-app/AWAIT_UPDATE_EMAIL",APP_SYNC_THEME:"@w3m-app/SYNC_THEME",APP_SYNC_DAPP_DATA:"@w3m-app/SYNC_DAPP_DATA",APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS:"@w3m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",APP_INIT_SMART_ACCOUNT:"@w3m-app/INIT_SMART_ACCOUNT",APP_SET_PREFERRED_ACCOUNT:"@w3m-app/SET_PREFERRED_ACCOUNT",APP_CONNECT_FARCASTER:"@w3m-app/CONNECT_FARCASTER",APP_GET_FARCASTER_URI:"@w3m-app/GET_FARCASTER_URI",APP_RELOAD:"@w3m-app/RELOAD",APP_RPC_ABORT:"@w3m-app/RPC_ABORT",FRAME_SWITCH_NETWORK_E
20RROR:"@w3m-frame/SWITCH_NETWORK_ERROR",FRAME_SWITCH_NETWORK_SUCCESS:"@w3m-frame/SWITCH_NETWORK_SUCCESS",FRAME_CONNECT_EMAIL_ERROR:"@w3m-frame/CONNECT_EMAIL_ERROR",FRAME_CONNECT_EMAIL_SUCCESS:"@w3m-frame/CONNECT_EMAIL_SUCCESS",FRAME_CONNECT_DEVICE_ERROR:"@w3m-frame/CONNECT_DEVICE_ERROR",FRAME_CONNECT_DEVICE_SUCCESS:"@w3m-frame/CONNECT_DEVICE_SUCCESS",FRAME_CONNECT_OTP_SUCCESS:"@w3m-frame/CONNECT_OTP_SUCCESS",FRAME_CONNECT_OTP_ERROR:"@w3m-frame/CONNECT_OTP_ERROR",FRAME_CONNECT_SOCIAL_SUCCESS:"@w3m-frame/CONNECT_SOCIAL_SUCCESS",FRAME_CONNECT_SOCIAL_ERROR:"@w3m-frame/CONNECT_SOCIAL_ERROR",FRAME_CONNECT_FARCASTER_SUCCESS:"@w3m-frame/CONNECT_FARCASTER_SUCCESS",FRAME_CONNECT_FARCASTER_ERROR:"@w3m-frame/CONNECT_FARCASTER_ERROR",FRAME_GET_FARCASTER_URI_SUCCESS:"@w3m-frame/GET_FARCASTER_URI_SUCCESS",FRAME_GET_FARCASTER_URI_ERROR:"@w3m-frame/GET_FARCASTER_URI_ERROR",FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",FRAME_GET_SOCIAL_REDIRECT_URI_ERROR:"@w3m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",FRAME_GET_USER_SUCCESS:"@w3m-frame/GET_USER_SUCCESS",FRAME_GET_USER_ERROR:"@w3m-frame/GET_USER_ERROR",FRAME_SIGN_OUT_SUCCESS:"@w3m-frame/SIGN_OUT_SUCCESS",FRAME_SIGN_OUT_ERROR:"@w3m-frame/SIGN_OUT_ERROR",FRAME_IS_CONNECTED_SUCCESS:"@w3m-frame/IS_CONNECTED_SUCCESS",FRAME_IS_CONNECTED_ERROR:"@w3m-frame/IS_CONNECTED_ERROR",FRAME_GET_CHAIN_ID_SUCCESS:"@w3m-frame/GET_CHAIN_ID_SUCCESS",FRAME_GET_CHAIN_ID_ERROR:"@w3m-frame/GET_CHAIN_ID_ERROR",FRAME_RPC_REQUEST_SUCCESS:"@w3m-frame/RPC_REQUEST_SUCCESS",FRAME_RPC_REQUEST_ERROR:"@w3m-frame/RPC_REQUEST_ERROR",FRAME_SESSION_UPDATE:"@w3m-frame/SESSION_UPDATE",FRAME_UPDATE_EMAIL_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SUCCESS",FRAME_UPDATE_EMAIL_ERROR:"@w3m-frame/UPDATE_EMAIL_ERROR",FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR:"@w3m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",FRAME_SYNC_THEME_SUCCESS:"@w3m-frame/SYNC_THEME_SUCCESS",FRAME_SYNC_THEME_ERROR:"@w3m-frame/SYNC_THEME_ERROR",FRAME_SYNC_DAPP_DATA_SUCCESS:"@w3m-frame/SYNC_DAPP_DATA_SUCCESS",FRAME_SYNC_DAPP_DATA_ERROR:"@w3m-frame/SYNC_DAPP_DATA_ERROR",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR:"@w3m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",FRAME_INIT_SMART_ACCOUNT_SUCCESS:"@w3m-frame/INIT_SMART_ACCOUNT_SUCCESS",FRAME_INIT_SMART_ACCOUNT_ERROR:"@w3m-frame/INIT_SMART_ACCOUNT_ERROR",FRAME_SET_PREFERRED_ACCOUNT_SUCCESS:"@w3m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",FRAME_SET_PREFERRED_ACCOUNT_ERROR:"@w3m-frame/SET_PREFERRED_ACCOUNT_ERROR",FRAME_READY:"@w3m-frame/READY",FRAME_RELOAD_SUCCESS:"@w3m-frame/RELOAD_SUCCESS",FRAME_RELOAD_ERROR:"@w3m-frame/RELOAD_ERROR",FRAME_RPC_ABORT_SUCCESS:"@w3m-frame/RPC_ABORT_SUCCESS",FRAME_RPC_ABORT_ERROR:"@w3m-frame/RPC_ABORT_ERROR",RPC_RESPONSE_TYPE_ERROR:"RPC_RESPONSE_ERROR",RPC_RESPONSE_TYPE_TX:"RPC_RESPONSE_TRANSACTION_HASH",RPC_RESPONSE_TYPE_OBJECT:"RPC_RESPONSE_OBJECT"},$r={SAFE_RPC_METHODS:["eth_accounts","eth_blockNumber","eth_call","eth_chainId","eth_estimateGas","eth_feeHistory","eth_gasPrice","eth_getAccount","eth_getBalance","eth_getBlockByHash","eth_getBlockByNumber","eth_getBlockReceipts","eth_getBlockTransactionCountByHash","eth_getBlockTransactionCountByNumber","eth_getCode","eth_getFilterChanges","eth_getFilterLogs","eth_getLogs","eth_getProof","eth_getStorageAt","eth_getTransactionByBlockHashAndIndex","eth_getTransactionByBlockNumberAndIndex","eth_getTransactionByHash","eth_getTransactionCount","eth_getTransactionReceipt","eth_getUncleCountByBlockHash","eth_getUncleCountByBlockNumber","eth_maxPriorityFeePerGas","eth_newBlockFilter","eth_newFilter","eth_newPendingTransactionFilter","eth_sendRawTransaction","eth_syncing","eth_uninstallFilter","wallet_getCapabilities","wallet_getCallsStatus","eth_getUserOperationReceipt","eth_estimateUserOperationGas","eth_getUserOperationByHash","eth_supportedEntryPoints","wallet_getAssets"],NOT_SAFE_RPC_METHODS:["personal_sign","eth_signTypedData_v4","eth_sendTransaction","solana_signMessage","solana_signTransaction","solana_signAllTransactions","solana_signAndSendTransaction","wallet_sendCalls","wallet_grantPermissions","wallet_revokePermissions","eth_sendUserOperation"],GET_CHAIN_ID:"eth_chainId",RPC_METHOD_NOT_ALLOWED_MESSAGE:"Requested RPC call is not allowed",RP
20C_METHOD_NOT_ALLOWED_UI_MESSAGE:"Action not allowed",ACCOUNT_TYPES:{EOA:"eoa",SMART_ACCOUNT:"smartAccount"}}});var rk,AX=h(()=>{rk={address:/^0x(?:[A-Fa-f0-9]{40})$/u,transactionHash:/^0x(?:[A-Fa-f0-9]{64})$/u,signedMessage:/^0x(?:[a-fA-F0-9]{62,})$/u}});var Cy,nk=h(()=>{v8();CX();Cy={set(e,t){tS.isClient&&localStorage.setItem(`${$a.STORAGE_KEY}${e}`,t)},get(e){return tS.isClient?localStorage.getItem(`${$a.STORAGE_KEY}${e}`):null},delete(e,t){tS.isClient&&(t?localStorage.removeItem(e):localStorage.removeItem(`${$a.STORAGE_KEY}${e}`))}}});var rS,tS,CX=h(()=>{AX();v8();nk();rS=30*1e3,tS={checkIfAllowedToTriggerEmail(){let e=Cy.get($a.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<rS){let r=Math.ceil((rS-t)/1e3);throw new Error(`Please try again after ${r} seconds`)}}},getTimeToNextEmailLogin(){let e=Cy.get($a.LAST_EMAIL_LOGIN_TIME);if(e){let t=Date.now()-Number(e);if(t<rS)return Math.ceil((rS-t)/1e3)}return 0},checkIfRequestExists(e){return $r.NOT_SAFE_RPC_METHODS.includes(e.method)||$r.SAFE_RPC_METHODS.includes(e.method)},getResponseType(e){return typeof e=="string"&&(e?.match(rk.transactionHash)||e?.match(rk.signedMessage))?$a.RPC_RESPONSE_TYPE_TX:$a.RPC_RESPONSE_TYPE_OBJECT},checkIfRequestIsSafe(e){return $r.SAFE_RPC_METHODS.includes(e.method)},isClient:typeof window<"u"}});var SX=h(()=>{v8();nk()});var IX,TX=h(()=>{IX="1.2.3"});var dn,Sy=h(()=>{TX();dn=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...o?[`Docs: https://abitype.dev${o}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${IX}`].join(`
21`);super(s),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.shortMessage=t}}});function ra(e,t){return e.exec(t)?.groups}var ok,sk,nS,E8=h(()=>{ok=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,sk=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,nS=/^\(.+?\).*?$/});function oS(e){let t=e.type;if(_X.test(e.type)&&"components"in e){t="(";let r=e.components.length;for(let o=0;o<r;o++){let s=e.components[o];t+=oS(s),o<r-1&&(t+=", ")}let n=ra(_X,e.type);return t+=`)${n?.array||""}`,oS({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}var _X,PX=h(()=>{E8();_X=/^tuple(?<array>(\[(\d*)\])*)$/});function rp(e){let t="",r=e.length;for(let n=0;n<r;n++){let o=e[n];t+=oS(o),n!==r-1&&(t+=", ")}return t}var ik=h(()=>{PX()});function p1(e){return e.type==="function"?`function ${e.name}(${rp(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${rp(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${rp(e.inputs)})`:e.type==="error"?`error ${e.name}(${rp(e.inputs)})`:e.type==="constructor"?`constructor(${rp(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}var NX=h(()=>{ik()});function OX(e){return RX.test(e)}function BX(e){return ra(RX,e)}function DX(e){return kX.test(e)}function UX(e){return ra(kX,e)}function MX(e){return LX.test(e)}function HX(e){return ra(LX,e)}function Ol(e){return $X.test(e)}function FX(e){return ra($X,e)}function zX(e){return VX.test(e)}function jX(e){return ra(VX,e)}function WX(e){return qX.test(e)}function KX(e){return ra(qX,e)}function ZX(e){return LNe.test(e)}var RX,kX,LX,$X,VX,qX,LNe,Iy,GX,sS,f1=h(()=>{E8();RX=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;kX=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;LX=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;$X=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;VX=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;qX=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;LNe=/^receive\(\) external payable$/;Iy=new Set(["memory","indexed","storage","calldata"]),GX=new Set(["indexed"]),sS=new Set(["calldata","memory","storage"])});var h1,m1,A8,C8=h(()=>{Sy();h1=class extends dn{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}},m1=class extends dn{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}},A8=class extends dn{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}});var g1,y1,w1,b1,x1,v1,E1,Ty=h(()=>{Sy();g1=class extends dn{constructor({param:t}){super("Failed to parse ABI parameter.",{details:`parseAbiParameter(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameter-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParameterError"})}},y1=class extends dn{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}},w1=class extends dn{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}},b1=class extends dn{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}},x1=class extends dn{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}},v1=class extends dn{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}},E1=class extends dn{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invali
21d."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}});var na,A1,C1,iS=h(()=>{Sy();na=class extends dn{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}},A1=class extends dn{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}},C1=class extends dn{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}});var S1,ak=h(()=>{Sy();S1=class extends dn{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}});var I1,ck=h(()=>{Sy();I1=class extends dn{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}});function YX(e,t,r){let n="";if(r)for(let o of Object.entries(r)){if(!o)continue;let s="";for(let i of o[1])s+=`[${i.type}${i.name?`:${i.name}`:""}]`;n+=`(${o[0]}{${s}})`}return t?`${t}:${e}${n}`:`${e}${n}`}var aS,JX=h(()=>{aS=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]])});function S8(e,t={}){if(MX(e))return MNe(e,t);if(DX(e))return HNe(e,t);if(OX(e))return $Ne(e,t);if(zX(e))return FNe(e,t);if(WX(e))return VNe(e);if(ZX(e))return{type:"receive",stateMutability:"payable"};throw new A1({signature:e})}function MNe(e,t={}){let r=HX(e);if(!r)throw new na({signature:e,type:"function"});let n=li(r.parameters),o=[],s=n.length;for(let a=0;a<s;a++)o.push(ui(n[a],{modifiers:sS,structs:t,type:"function"}));let i=[];if(r.returns){let a=li(r.returns),c=a.length;for(let l=0;l<c;l++)i.push(ui(a[l],{modifiers:sS,structs:t,type:"function"}))}return{name:r.name,type:"function",stateMutability:r.stateMutability??"nonpayable",inputs:o,outputs:i}}function HNe(e,t={}){let r=UX(e);if(!r)throw new na({signature:e,type:"event"});let n=li(r.parameters),o=[],s=n.length;for(let i=0;i<s;i++)o.push(ui(n[i],{modifiers:GX,structs:t,type:"event"}));return{name:r.name,type:"event",inputs:o}}function $Ne(e,t={}){let r=BX(e);if(!r)throw new na({signature:e,type:"error"});let n=li(r.parameters),o=[],s=n.length;for(let i=0;i<s;i++)o.push(ui(n[i],{structs:t,type:"error"}));return{name:r.name,type:"error",inputs:o}}function FNe(e,t={}){let r=jX(e);if(!r)throw new na({signature:e,type:"constructor"});let n=li(r.parameters),o=[],s=n.length;for(let i=0;i<s;i++)o.push(ui(n[i],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:r.stateMutability??"nonpayable",inputs:o}}function VNe(e){let t=KX(e);if(!t)throw new na({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}function ui(e,t){let r=YX(e,t?.type,t?.structs);if(aS.has(r))return aS.get(r);let n=nS.test(e),o=ra(n?jNe:zNe,e);if(!o)throw new w1({param:e});if(o.name&&KNe(o.name))throw new b1({param:e,name:o.name});let s=o.name?{name:o.name}:{},i=o.modifier==="indexed"?{indexed:!0}:{},a=t?.structs??{},c,l={};if(n){c="tuple";let d=li(o.type),p=[],f=d.length;for(let m=0;m<f;m++)p.push(ui(d[m],{structs:a}));l={components:p}}else if(o.type in a)c="tuple",l={components:a[o.type]};else if(qNe.test(o.type))c=`${o.type}256`;else if(o.type==="address payable")c="address";else if(c=o.type,t?.type!=="struct"&&!lk(c))throw new A8({type:c});if(o.modifier){if(!t?.modifiers?.has?.(o.modifier))throw new x1({param:e,type:t?.type,modifier:o.modifier});if(sS.has(o.modifier)&&!ZNe(c,!!o.array))throw new v1({param:e,type:t?.type,modifier:o.modifier})}let u={type:`${c}${o.array??""}`,...s,...i,...l};return aS.set(r,u),u}function li(e,t=[],r="",n=0){let o=e.trim().length;for(let s=0;s<o;s++){let i=e[s],a=e.slice(s+1);switch(i){case",":return n===0?li(a,[...t,r.trim()]):li(a,t,`${r}${i}`,n);case"(":return li(a,t,`${r}${i}`,n+1);case")":return li(a,t,`${r}${i}`,n-1);default:return li(a,t,`${r}${i}`,n)}}if(r==="")return t;if(n!==0)throw new I1({current:r,depth:n});return t.push(r.trim()),t}function lk(e){return e==="address"||e==="bool"||e==="function"||e==="string"||ok.test(e)||sk.test(e)}function KNe(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||ok.test(e)||sk.test(e)||W
21Ne.test(e)}function ZNe(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}var zNe,jNe,qNe,WNe,T1=h(()=>{E8();C8();Ty();iS();ck();JX();f1();zNe=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,jNe=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,qNe=/^u?int$/;WNe=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/});function oh(e){let t={},r=e.length;for(let i=0;i<r;i++){let a=e[i];if(!Ol(a))continue;let c=FX(a);if(!c)throw new na({signature:a,type:"struct"});let l=c.properties.split(";"),u=[],d=l.length;for(let p=0;p<d;p++){let m=l[p].trim();if(!m)continue;let g=ui(m,{type:"struct"});u.push(g)}if(!u.length)throw new C1({signature:a});t[c.name]=u}let n={},o=Object.entries(t),s=o.length;for(let i=0;i<s;i++){let[a,c]=o[i];n[a]=QX(c,t)}return n}function QX(e=[],t={},r=new Set){let n=[],o=e.length;for(let s=0;s<o;s++){let i=e[s];if(nS.test(i.type))n.push(i);else{let c=ra(GNe,i.type);if(!c?.type)throw new E1({abiParameter:i});let{array:l,type:u}=c;if(u in t){if(r.has(u))throw new S1({type:u});n.push({...i,type:`tuple${l??""}`,components:QX(t[u],t,new Set([...r,u]))})}else if(lk(u))n.push(i);else throw new m1({type:u})}}return n}var GNe,I8=h(()=>{E8();C8();Ty();iS();ak();f1();T1();GNe=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/});function _y(e){let t=oh(e),r=[],n=e.length;for(let o=0;o<n;o++){let s=e[o];Ol(s)||r.push(S8(s,t))}return r}var XX=h(()=>{f1();I8();T1()});function Py(e){let t;if(typeof e=="string")t=S8(e);else{let r=oh(e),n=e.length;for(let o=0;o<n;o++){let s=e[o];if(!Ol(s)){t=S8(s,r);break}}}if(!t)throw new h1({signature:e});return t}var eee=h(()=>{C8();f1();I8();T1()});function uk(e){let t;if(typeof e=="string")t=ui(e,{modifiers:Iy}
21);else{let r=oh(e),n=e.length;for(let o=0;o<n;o++){let s=e[o];if(!Ol(s)){t=ui(s,{modifiers:Iy,structs:r});break}}}if(!t)throw new g1({param:e});return t}var tee=h(()=>{Ty();f1();I8();T1()});function Ny(e){let t=[];if(typeof e=="string"){let r=li(e),n=r.length;for(let o=0;o<n;o++)t.push(ui(r[o],{modifiers:Iy}))}else{let r=oh(e),n=e.length;for(let o=0;o<n;o++){let s=e[o];if(Ol(s))continue;let i=li(s),a=i.length;for(let c=0;c<a;c++)t.push(ui(i[c],{modifiers:Iy,structs:r}))}}if(t.length===0)throw new y1({params:e});return t}var ree=h(()=>{Ty();f1();I8();T1();T1()});var Ry=h(()=>{NX();ik();XX();eee();tee();ree();C8();Ty();iS();ck();ak()});function ue(e,t,r){let n=e[t.name];if(typeof n=="function")return n;let o=e[r];return typeof o=="function"?o:s=>t(e,s)}var Mt=h(()=>{});function Wn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Oy(e.type);return`${e.name}(${T8(e.inputs,{includeName:t})})`}function T8(e,{includeName:t=!1}={}){return e?e.map(r=>YNe(r,{includeName:t})).join(t?", ":","):""}function YNe(e,{includeName:t}){return e.type.startsWith("tuple")?`(${T8(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}var np=h(()=>{zr()});function Ve(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Us=h(()=>{});function yt(e){return Ve(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var Go=h(()=>{Us()});var dk,oee=h(()=>{dk="2.55.1"});function see(e){cS=e}function iee(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?iee(e.cause,t):t?null:e}var cS,K,ut=h(()=>{oee();cS={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${dk}`};K=class e extends Error{constructor(t,r={}){let n=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=cS.getDocsUrl?.({...r,docsPath:o}),i=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...s?[`Docs: ${s}`]:[],...n?[`Details: ${n}`]:[],...cS.version?[`Version: ${cS.version}`]:[]].join(`
22`);super(i,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=dk}walk(t){return iee(this,t)}}});var sh,Bl,lS,ih,di,By,ky,ah,Dy,_1,ch,Uy,Ly,P1,oa,lh,My,uS,uh,Pc,kl,Hy,$y,dh,Oy,Fy,zr=h(()=>{np();Go();ut();sh=class extends K{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
23`),{docsPath:t,name:"AbiConstructorNotFoundError"})}},Bl=class extends K{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
24`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}},lS=class extends K{constructor({data:t,size:r}){super([`Data size of ${r}
24 bytes is invalid.`,"Size must be in increments of 32 bytes (size % 32 === 0)."].join(`
25`),{metaMessages:[`Data: ${t} (${r} bytes)`],name:"AbiDecodingDataSizeInvalidError"})}},ih=class extends K{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(`
26`),{metaMessages:[`Params: (${T8(r,{includeName:!0})})`,`Data:   ${t} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=r,this.size=n}},di=class extends K{constructor({cause:t}={}){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError",cause:t})}},By=class extends K{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(`
27`),{name:"AbiEncodingArrayLengthMismatchError"})}},ky=class extends K{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${yt(r)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}},ah=class extends K{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(`
28`),{name:"AbiEncodingLengthMismatchError"})}},Dy=class extends K{constructor(t,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
29`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}},_1=class extends K{constructor(t,{docsPath:r}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
30`),{docsPath:r,name:"AbiErrorNotFoundError"})}},ch=class extends K{constructor(t,{docsPath:r,cause:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
31`),{docsPath:r,name:"AbiErrorSignatureNotFoundError",cause:n}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}},Uy=class extends K{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}},Ly=class extends K{constructor(t,{docsPath:r}){super([`Encoded event signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
32`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}},P1=class extends K{constructor(t,{docsPath:r}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(`
33`),{docsPath:r,name:"AbiEventNotFoundError"})}},oa=class extends K{constructor(t,{docsPath:r}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
34`),{docsPath:r,name:"AbiFunctionNotFoundError"})}},lh=class extends K{constructor(t,{docsPath:r}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
35`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}},My=class extends K{constructor(t,{docsPath:r}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://4byte.sourcify.dev/?q=${t}.`].join(`
36`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}},uS=class extends K{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Wn(t.abiItem)}\`, and`,`\`${r.type}\` in \`${Wn(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}},uh=class extends K{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}},Pc=class extends K{constructor({abiItem:t,data:r,params:n,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(`
37`),{metaMessages:[`Params: (${T8(n,{includeName:!0})})`,`Data:   ${r} (${o} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t,this.data=r,this.params=n,this.size=o}},kl=class extends K{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Wn(t,{includeName:!0})}".`].join(`
38`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}},Hy=class extends K{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
39`),{docsPath:r,name:"InvalidAbiEncodingType"})}},$y=class extends K{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
40`),{docsPath:r,name:"InvalidAbiDecodingType"})}},dh=class extends K{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
41`),{name:"InvalidArrayError"})}},Oy=class extends K{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
42`),{name:"InvalidDefinitionTypeError"})}},Fy=class extends K{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}});var Vy,pk=h(()=>{ut();Vy=class extends K{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}});var N1,R1,_8,P8=h(()=>{ut();N1=class extends K{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},R1=class extends K{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}},_8=class extends K{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}});function Yo(e,{dir:t,size:r=32}={}){return typeof e=="string"?pi(e,{dir:t,size:r}):fk(e,{dir:t,size:r})}function pi(e,{dir:t,size:r=32}={}){if(r===null)return e;let n=e.replace("0x","");if(n.length>r*2)throw new R1({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function fk(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new R1({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let o=0;o<r;o++){let s=t==="right";n[s?o:r-o-1]=e[s?o:e.length-o-1]}return n}var ph=h(()=>{P8()});
42var Dl,zy,jy,qy,Wy,Ky,Zy,Gy,O1=h(()=>{ut();Dl=class extends K{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number "${s}" is not in safe ${o?`${o*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},zy=class extends K{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}},jy=class extends K{constructor(t){super(`Hex value "${t}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}},qy=class extends K{constructor(t){super(`Hex value "${t}" is an odd length (${t.length}). It must be an even length.`,{name:"InvalidHexValueError"})}},Wy=class extends K{constructor({limit:t}){super(`RLP depth limit of \`${t}\` exceeded.`,{name:"RlpDepthLimitExceededError"})}},Ky=class extends K{constructor({consumed:t,declared:r}){super(`RLP list items consumed \`${t}\` bytes but the list declared a length of \`${r}\`.`,{name:"RlpListBoundaryExceededError"})}},Zy=class extends K{constructor({count:t}){super(`RLP payload encodes a single item, but \`${t}\` trailing ${t===1?"byte remains":"bytes remain"}.`,{name:"RlpTrailingBytesError"})}},Gy=class extends K{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function jr(e,{dir:t="left"}={}){let r=typeof e=="string"?e.replace("0x",""):e,n=0;for(let o=0;o<r.length-1&&r[t==="left"?o:r.length-o-1].toString()==="0";o++)n++;return r=t==="left"?r.slice(n):r.slice(0,r.length-n),typeof e=="string"?(r.length===1&&t==="right"&&(r=`${r}0`),`0x${r.length%2===1?`0${r}`:r}`):r}var op=h(()=>{});function Ls(e,{size:t}){if(yt(e)>t)throw new Gy({givenSize:yt(e),maxSize:t})}function hk(e,t){let r=typeof t=="string"?{to:t}:t,n=r.to;return n==="number"?ht(e,r):n==="bigint"?at(e,r):n==="string"?dS(e,r):n==="boolean"?Yy(e,r):zt(e,r)}function at(e,t={}){let{signed:r}=t;t.size&&Ls(e,{size:t.size});let n=BigInt(e);if(!r)return n;let o=(e.length-2)/2,s=(1n<<BigInt(o)*8n-1n)-1n;return n<=s?n:n-BigInt(`0x${"f".padStart(o*2,"f")}`)-1n}function Yy(e,t={}){let r=e;if(t.size&&(Ls(r,{size:t.size}),r=jr(r)),jr(r)==="0x00")return!1;if(jr(r)==="0x01")return!0;throw new jy(r)}function ht(e,t={}){let r=at(e,t),n=Number(r);if(!Number.isSafeInteger(n))throw new Dl({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${r}n`});return n}function dS(e,t={}){let r=zt(e);return t.size&&(Ls(r,{size:t.size}),r=jr(r,{dir:"right"})),new TextDecoder().decode(r)}var tn=h(()=>{O1();Go();op();Sr()});function vr(e,t={}){return typeof e=="number"||typeof e=="bigint"?re(e,t):typeof e=="string"?Fa(e,t):typeof e=="boolean"?B1(e,t):ft(e,t)}function B1(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Ls(r,{size:t.size}),Yo(r,{size:t.size})):r}function ft(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=JNe[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(Ls(n,{size:t.size}),Yo(n,{dir:"right",size:t.size})):n}function re(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let i=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<i){let c=typeof e=="bigint"?"n":"";throw new Dl({max:s?`${s}${c}`:void 0,min:`${i}${c}`,signed:r,size:n,value:`${e}${c}`})}let a=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?Yo(a,{size:n}):a}function Fa(e,t={}){let r=QNe.encode(e);return ft(r,t)}var JNe,QNe,Fe=h(()=>{O1();ph();tn();JNe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));QNe=new TextEncoder});function rn(e,t={}){return typeof e=="number"||typeof e=="bigint"?gk(e,t):typeof e=="boolean"?mk(e,t):Ve(e)?zt(e,t):sa(e,t)}function mk(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Ls(r,{size:t.size}),Yo(r,{size:t.size})):r}function aee(e){if(e>=sp.zero&&e<=sp.nine)return e-sp.zero;if(e>=sp.A&&e<=sp.F)return e-(sp.A-10);if(e>=sp.a&&e<=sp.f)return e-(sp.a-10)}function zt(e,t={}){let r=e;t.size&&(Ls(r,{size:t.size}),r=Yo(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let o=n.length/2,s=new Uint8Array(o);for(let i=0,a=0;i<o;i++){let c=aee(n.charCodeAt(a++)),l=aee(n.charCodeAt(a++));if(c===void 0||l===void 0)throw new K(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);s[i]=c*16+l}return s}function gk(e,t){let r=re(e,t);return zt(r)}function sa(e,t={}){let r=XNe.encode(e);return typeof t.size=="number"?(Ls(r,{size:t.size}),Yo(r,{dir:"right",size:t.size})):r}var XNe,sp,Sr=h(()=>{ut();Us();ph();tn();Fe();XNe=new TextEncoder;sp={zero:48,nine:57,A:65,F:70,a:97,f:102}}
42);function eRe(e,t=!1){return t?{h:Number(e&pS),l:Number(e>>cee&pS)}:{h:Number(e>>cee&pS)|0,l:Number(e&pS)|0}}function lee(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=eRe(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}var pS,cee,uee,dee,pee,fee,hee=h(()=>{pS=BigInt(4294967295),cee=BigInt(32);uee=(e,t,r)=>e<<r|t>>>32-r,dee=(e,t,r)=>t<<r|e>>>32-r,pee=(e,t,r)=>t<<r-32|e>>>64-r,fee=(e,t,r)=>e<<r-32|t>>>64-r});var k1,mee=h(()=>{k1=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function tRe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function D1(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ul(e,...t){if(!tRe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function gee(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");D1(e.outputLen),D1(e.blockLen)}function ip(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fS(e,t){Ul(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function yee(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ia(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function hS(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Nc(e,t){return e<<32-t|e>>>t}function N8(e,t){return e<<t|e>>>32-t>>>0}function nRe(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function oRe(e){for(let t=0;t<e.length;t++)e[t]=nRe(e[t]);return e}function sRe(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function U1(e){return typeof e=="string"&&(e=sRe(e)),Ul(e),e}function wee(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];Ul(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function Jy(e){let t=n=>e().update(U1(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function mS(e=32){if(k1&&typeof k1.getRandomValues=="function")return k1.getRandomValues(new Uint8Array(e));if(k1&&typeof k1.randomBytes=="function")return Uint8Array.from(k1.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var rRe,yk,fh,ap=h(()=>{mee();rRe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;yk=rRe?e=>e:oRe;fh=class{}});function fRe(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,c=(i+2)%10,l=r[c],u=r[c+1],d=bee(l,u,1)^r[a],p=xee(l,u,1)^r[a+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=Eee[i],c=bee(o,s,a),l=xee(o,s,a),u=vee[i];o=e[u],s=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=dRe[n],e[1]^=pRe[n]}ia(r)}var iRe,R8,aRe,cRe,lRe,uRe,vee,Eee,Aee,Cee,dRe,pRe,bee,xee,wk,hRe,gS,bk=h(()=>{hee();ap();iRe=BigInt(0),R8=BigInt(1),aRe=BigInt(2),cRe=BigInt(7),lRe=BigInt(256),uRe=BigInt(113),vee=[],Eee=[],Aee=[];for(let e=0,t=R8,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],vee.push(2*(5*n+r)),Eee.push((e+1)*(e+2)/2%64);let o=iRe;for(let s=0;s<7;s++)t=(t<<R8^(t>>cRe)*uRe)%lRe,t&aRe&&(o^=R8<<(R8<<BigInt(s))-R8);Aee.push(o)}Cee=lee(Aee,!0),dRe=Cee[0],pRe=Cee[1],bee=(e,t,r)=>r>32?pee(e,t,r):uee(e,t,r),xee=(e,t,r)=>r>32?fee(e,t,r):dee(e,t,r);wk=class e extends fh{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,D1(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=yee(this.state)}clone(){return this._cloneInto()}keccak(){yk(this.state32),fRe(this.state32,this.rounds),yk(this.state32),this.posOut=0,this.pos=0}update(t){ip(this),t=U1(t),Ul(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ip(this,!1),Ul(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return D1(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(fS(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ia(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}},hRe=(e,t,r)=>Jy(()=>new wk(t,e,r)),gS=hRe(1,136,256/8)});function Ht(e,t){let r=t||"hex",n=gS(Ve(e,{strict:!1})?rn(e):e);return r==="bytes"?n:vr(n)}var fi=h(()=>{bk();Us();Sr();Fe()});function See(e){return mRe(e)}var mRe,Iee=h(()=>{Sr();fi();mRe=e=>Ht(rn(e))});function Tee(e){let t=!0,r="",n=0,o="",s=!1;for(let i=0;i<e.length;i++){let a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&n++,a===")"&&n--,!!t){if(n===0){if(a===" "&&["event","function",""].includes(o))o="";else if(o+=a,a===")"){s=!0;break}continue}if(a===" "){e[i-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}o+=a,r+=a}}if(!s)throw new K("Unable to normalize signature.");return o}var _ee=h(()=>{ut()});var cp,yS=h(()=>{Ry();_ee();cp=e=>{let t=typeof e=="string"?e:p1(e);return Tee(t)}
42});function lp(e){return See(cp(e))}var O8=h(()=>{Iee();yS()});var Rc,Qy=h(()=>{O8();Rc=lp});var mr,Va=h(()=>{ut();mr=class extends K{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var Jo,hh=h(()=>{Jo=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,r)),r}set(t,r){if(super.has(t)&&super.delete(t),super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=super.keys().next().value;n!==void 0&&super.delete(n)}return this}}});function Oc(e,t){if(xk.has(`${e}.${t}`))return xk.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=Ht(sa(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&o[i]&&(o[i]=o[i].toUpperCase()),(n[i>>1]&15)>=8&&o[i+1]&&(o[i+1]=o[i+1].toUpperCase());let s=`0x${o.join("")}`;return xk.set(`${e}.${t}`,s),s}function qr(e,t){if(!Dt(e,{strict:!1}))throw new mr({address:e});return Oc(e,t)}var xk,Ms=h(()=>{Va();Sr();fi();hh();Hs();xk=new Jo(8192)});function Dt(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(vk.has(n))return vk.get(n);let o=gRe.test(e)?e.toLowerCase()===e?!0:r?Oc(e)===e:!0:!1;return vk.set(n,o),o}var gRe,vk,Hs=h(()=>{hh();Ms();gRe=/^0x[a-fA-F0-9]{40}$/,vk=new Jo(8192)});function nn(e){return typeof e[0]=="string"?ur(e):Ek(e)}function Ek(e){let t=0;for(let o of e)t+=o.length;let r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function ur(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Nn=h(()=>{});function so(e,t,r,{strict:n}={}){return Ve(e,{strict:!1})?Ll(e,t,r,{strict:n}):B8(e,t,r,{strict:n})}function Pee(e,t){if(typeof t=="number"&&t>0&&t>yt(e)-1)throw new N1({offset:t,position:"start",size:yt(e)})}function Nee(e,t,r){if(typeof t=="number"&&typeof r=="number"&&yt(e)!==r-t)throw new N1({offset:r,position:"end",size:yt(e)})}function B8(e,t,r,{strict:n}={}){Pee(e,t);let o=e.slice(t,r);return n&&Nee(o,t,r),o}function Ll(e,t,r,{strict:n}={}){Pee(e,t);let o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&Nee(o,t,r),o}var aa=h(()=>{P8();Us();Go()});var Ree,wS,Xy,bS=h(()=>{Ree=/^(.*)\[([0-9]*)\]$/,wS=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Xy=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/});function Kn(e,t){if(e.length!==t.length)throw new ah({expectedLength:e.length,givenLength:t.length});let r=yRe({params:e,values:t});return Sk(r)}function yRe({params:e,values:t}){let r=[];for(let n=0;n<e.length;n++)r.push(Ck({param:e[n],value:t[n]}));return r}function Ck({param:e,value:t}){let r=k8(e.type);if(r){let[n,o]=r;return bRe(t,{length:n,param:{...e,type:o}})}if(e.type==="tuple")return CRe(t,{param:e});if(e.type==="address")return wRe(t);if(e.type==="bool")return vRe(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){let n=e.type.startsWith("int"),[,,o="256"]=Xy.exec(e.type)??[];return ERe(t,{signed:n,size:Number(o)})}if(e.type.startsWith("bytes"))return xRe(t,{param:e});if(e.type==="string")return ARe(t);throw new Hy(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Sk(e){let t=0;for(let s=0;s<e.length;s++){let{dynamic:i,encoded:a}=e[s];i?t+=32:t+=yt(a)}let r=[],n=[],o=0;for(let s=0;s<e.length;s++){let{dynamic:i,encoded:a}=e[s];i?(r.push(re(t+o,{size:32})),n.push(a),o+=yt(a)):r.push(a)}return ur([...r,...n])}function wRe(e){if(!Dt(e))throw new mr({address:e});return{dynamic:!1,encoded:pi(e.toLowerCase())}}function bRe(e,{length:t,param:r}){let n=t===null;if(!Array.isArray(e))throw new dh(e);if(!n&&e.length!==t)throw new By({expectedLength:t,givenLength:e.length,type:`${r.type}[${t}]`});let o=e.length===0&&Ak(r),s=[];for(let i=0;i<e.length;i++){let a=Ck({param:r,value:e[i]});a.dynamic&&(o=!0),s.push(a)}if(n||o){let i=Sk(s);if(n){let a=re(s.length,{size:32});return{dynamic:!0,encoded:ur([a,i])}}if(o)return{dynamic:!0,encoded:i}}return{dynamic:!1,encoded:ur(s.map(({encoded:i})=>i))}}function xRe(e,{param:t}){let[,r]=t.type.split("bytes"),n=yt(e);if(!r){let o=e;return n%32!==0&&(o=pi(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:ur([pi(re(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new ky({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:pi(e,{dir:"right"})}}function vRe(e){if(typeof e!="boolean")throw new K(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:pi(B1(e))}}function ERe(e,{signed:t,size:r=256}){if(typeof r=="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new Dl({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:re(e,{size:32,signed:t})}}function ARe(e){let t=Fa(e),r=Math.ceil(yt(t)/32),n=[];for(let o=0;o<r;o++)n.push(pi(so(t,o*32,(o+1)*32),{dir:"right"}));return{dynamic:!0,encoded:ur([pi(re(yt(t),{size:32})),...n])}}function CRe(e,{param:t}){let r=!1,n=[];for(let o=0;o<t.components.length;o++){let s=t.components[o],i=Array.isArray(e)?o:s.name,a=Ck({param:s,value:e[i]});n.push(a),a.dynamic&&(r=!0)}return{dynamic:r,encoded:r?Sk(n):ur(n.map(({encoded:o})=>o))}}function k8(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Ak(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;
42if(t==="tuple")return e.components.some(Ak);let r=k8(t);return r?Ak({...e,type:r[1]}):!1}var Bc=h(()=>{zr();Va();ut();O1();Hs();Nn();ph();Go();aa();Fe();bS()});var ca,L1=h(()=>{aa();O8();ca=e=>so(lp(e),0,4)});function Qo(e){let{abi:t,args:r=[],name:n}=e,o=Ve(n,{strict:!1}),s=t.filter(a=>o?a.type==="function"?ca(a)===n:a.type==="event"?Rc(a)===n:!1:"name"in a&&a.name===n);if(s.length===0)return;if(s.length===1)return s[0];let i;for(let a of s){if(!("inputs"in a))continue;if(!r||r.length===0){if(!a.inputs||a.inputs.length===0)return a;continue}if(!a.inputs||a.inputs.length===0||a.inputs.length!==r.length)continue;if(r.every((l,u)=>{let d="inputs"in a&&a.inputs[u];return d?Ik(l,d):!1})){if(i&&"inputs"in i&&i.inputs){let l=Oee(a.inputs,i.inputs,r);if(l)throw new uS({abiItem:a,type:l[0]},{abiItem:i,type:l[1]})}i=a}}return i||s[0]}function Ik(e,t){let r=typeof e,n=t.type;switch(n){case"address":return Dt(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>r==="object"&&Ik(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>Ik(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Oee(e,t,r){for(let n in e){let o=e[n],s=t[n];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return Oee(o.components,s.components,r[n]);let i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?Dt(r[n],{strict:!1}):i.includes("address")&&i.includes("bytes")?Dt(r[n],{strict:!1}):!1)return i}}var up=h(()=>{zr();Us();Hs();Qy();L1()});function za(e){let{abi:t,eventName:r,args:n}=e,o=t[0];if(r){let c=Qo({abi:t,name:r});if(!c)throw new P1(r,{docsPath:Bee});o=c}if(o.type!=="event")throw new P1(void 0,{docsPath:Bee});let s=[];if(n&&"inputs"in o){let c=o.inputs?.filter(u=>"indexed"in u&&u.indexed),l=Array.isArray(n)?n:Object.values(n).length>0?c?.map(u=>n[u.name])??[]:[];l.length>0&&(s=c?.map((u,d)=>Array.isArray(l[d])?l[d].map((p,f)=>kee({param:u,value:l[d][f]})):typeof l[d]<"u"&&l[d]!==null?kee({param:u,value:l[d]}):null)??[])}if(o.anonymous)return s;let i=Wn(o);return[Rc(i),...s]}function kee({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Ht(rn(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Vy(e.type);return Kn([e],[t])}var Bee,M1=h(()=>{zr();pk();Sr();fi();Qy();Bc();np();up();Bee="/docs/contract/encodeEventTopics"});function mh(e,{method:t}){let r={};return e.transport.type==="fallback"&&e.transport.onResponse?.(({method:n,response:o,status:s,transport:i})=>{s==="success"&&t===n&&(r[o]=i.request)}),(n=>r[n]||e.request)}var D8=h(()=>{});async function ew(e,t){let{address:r,abi:n,args:o,eventName:s,fromBlock:i,strict:a,toBlock:c}=t,l=mh(e,{method:"eth_newFilter"}),u=s?za({abi:n,args:o,eventName:s}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof i=="bigint"?re(i):i,toBlock:typeof c=="bigint"?re(c):c,topics:u}]});return{abi:n,args:o,eventName:s,id:d,request:l(d),strict:!!a,type:"event"}}var xS=h(()=>{M1();Fe();D8()});function ct(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}var Wr=h(()=>{});function vS(e){let{abi:t,args:r,functionName:n}=e,o=t[0];if(n){let s=Qo({abi:t,args:r,name:n});if(!s)throw new oa(n,{docsPath:Dee});o=s}if(o.type!=="function")throw new oa(void 0,{docsPath:Dee});return{abi:[o],functionName:ca(Wn(o))}}var Dee,Tk=h(()=>{zr();L1();np();up();Dee="/docs/contract/encodeFunctionData"});function jt(e){let{args:t}=e,{abi:r,functionName:n}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:vS(e),o=r[0],s=n,i="inputs"in o&&o.inputs?Kn(o.inputs,t??[]):void 0;return ur([s,i??"0x"])}var Io=h(()=>{Nn();Bc();Tk()});var Uee,tw,Lee,U8=h(()=>
42{Uee={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},tw={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},Lee={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}});var L8,rw,ES,_k=h(()=>{ut();L8=class extends K{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},rw=class extends K{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},ES=class extends K{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}});function kc(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(SRe);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var SRe,nw=h(()=>{_k();SRe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ES({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new rw({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new L8({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new L8({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}}});function Mee(e,t){let r=typeof t=="string"?{to:t}:t,n=r.to;return n==="number"?la(e,r):n==="bigint"?M8(e,r):n==="boolean"?H8(e,r):n==="string"?$8(e,r):ft(e,r)}function M8(e,t={}){typeof t.size<"u"&&Ls(e,{size:t.size});let r=ft(e,t);return at(r,t)}function H8(e,t={}){let r=e;if(typeof t.size<"u"&&(Ls(r,{size:t.size}),r=jr(r)),r.length>1||r[0]>1)throw new zy(r);return!!r[0]}function la(e,t={}){typeof t.size<"u"&&Ls(e,{size:t.size});let r=ft(e,t);return ht(r,t)}function $8(e,t={}){let r=e;return typeof t.size<"u"&&(Ls(r,{size:t.size}),r=jr(r,{dir:"right"})),new TextDecoder().decode(r)}var Pk=h(()=>{O1();op();tn();Fe()});function $s(e,t){let r=typeof t=="string"?zt(t):t,n=kc(r);if(yt(r)===0&&e.length>0)throw new di;
42if(yt(t)&&yt(t)<32)throw new ih({data:typeof t=="string"?t:ft(t),params:e,size:yt(t)});let o=0,s=[];for(let i=0;i<e.length;++i){let a=e[i];o<r.length&&n.setPosition(o);let[c,l]=ow(n,a,{staticPosition:0});o+=l,s.push(c)}return s}function ow(e,t,{staticPosition:r}){let n=k8(t.type);if(n){let[o,s]=n;return TRe(e,{...t,type:s},{length:o,staticPosition:r})}if(t.type==="tuple")return RRe(e,t,{staticPosition:r});if(t.type==="address")return IRe(e);if(t.type==="bool")return _Re(e);if(t.type.startsWith("bytes"))return PRe(e,t,{staticPosition:r});if(t.type.startsWith("uint")||t.type.startsWith("int"))return NRe(e,t);if(t.type==="string")return ORe(e,{staticPosition:r});throw new $y(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}function IRe(e){let t=e.readBytes(32);return[Oc(ft(B8(t,-20))),32]}function TRe(e,t,{length:r,staticPosition:n}){if(r===null){let i=la(e.readBytes(Nk)),a=n+i,c=a+Hee;e.setPosition(a);let l=la(e.readBytes(Hee)),u=F8(t),d=0,p=[];for(let f=0;f<l;++f){e.setPosition(c+(u?f*32:d));let[m,g]=ow(e,t,{staticPosition:c});d+=g,p.push(m),g===0&&(e.assertReadLimit(),e._touch())}return e.setPosition(n+32),[p,32]}if(F8(t)){let i=la(e.readBytes(Nk)),a=n+i,c=[];for(let l=0;l<r;++l){e.setPosition(a+l*32);let[u]=ow(e,t,{staticPosition:a});c.push(u)}return e.setPosition(n+32),[c,32]}let o=0,s=[];for(let i=0;i<r;++i){let[a,c]=ow(e,t,{staticPosition:n+o});o+=c,s.push(a),c===0&&(e.assertReadLimit(),e._touch())}return[s,o]}function _Re(e){return[H8(e.readBytes(32),{size:32}),32]}function PRe(e,t,{staticPosition:r}){let[n,o]=t.type.split("bytes");if(!o){let i=la(e.readBytes(32));e.setPosition(r+i);let a=la(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(a);return e.setPosition(r+32),[ft(c),32]}return[ft(e.readBytes(Number.parseInt(o,10),32)),32]}function NRe(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?M8(o,{signed:r}):la(o,{signed:r}),32]}function RRe(e,t,{staticPosition:r}){let n=t.components.length===0||t.components.some(({name:i})=>!i),o=n?[]:{},s=0;if(F8(t)){let i=la(e.readBytes(Nk)),a=r+i;for(let c=0;c<t.components.length;++c){let l=t.components[c];e.setPosition(a+s);let[u,d]=ow(e,l,{staticPosition:a});s+=d,o[n?c:l?.name]=u}return e.setPosition(r+32),[o,32]}for(let i=0;i<t.components.length;++i){let a=t.components[i],[c,l]=ow(e,a,{staticPosition:r});o[n?i:a?.name]=c,s+=l}return[o,s]}function ORe(e,{staticPosition:t}){let r=la(e.readBytes(32)),n=t+r;e.setPosition(n);let o=la(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let s=e.readBytes(o,32),i=$8(jr(s));return e.setPosition(t+32),[i,32]}function F8(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(F8);let r=k8(e.type);return!!(r&&F8({...e,type:r[1]}))}var Hee,Nk,gh=h(()=>{zr();Ms();nw();Go();aa();op();Pk();Sr();Fe();Bc();Hee=32,Nk=32});function yh(e){let{abi:t,data:r,cause:n}=e,o=so(r,0,4);if(o==="0x")throw new di({cause:n});let i=[...t||[],tw,Lee].find(a=>a.type==="error"&&o===ca(Wn(a)));if(!i)throw new ch(o,{docsPath:"/docs/contract/decodeErrorResult",cause:n});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?$s(i.inputs,so(r,4)):void 0,errorName:i.name}}var V8=h(()=>{U8();zr();aa();L1();gh();np()});var St,To=h(()=>{St=(e,t,r)=>JSON.stringify(e,(n,o)=>{let s=typeof o=="bigint"?o.toString():o;return typeof t=="function"?t(n,s):s},r)});function Rk({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((o,s)=>`${n&&o.name?`${o.name}: `:""}${typeof t[s]=="object"?St(t[s]):t[s]}`).join(", ")})`}var $ee=h(()=>{To()});var sw,iw,Fee,aw=h(()=>{sw={gwei:9,wei:18},iw={ether:-9,wei:9},Fee={ether:-18,gwei:-9}});function Xo(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[o,s]=[r.slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${s?`.${s}`:""}`}var H1=h(()=>{});function wh(e,t="wei"){return Xo(e,sw[t])}var z8=h(()=>{aw();H1()});function vn(e,t="wei"){return Xo(e,iw[t])}var $1=h(()=>{aw();H1()});function Vee(e){return e.reduce((t,{slot:r,value:n})=>`${t}        ${r}: ${n}
43`,"")}function zee(e){return e.reduce((t,{address:r,...n})=>{let o=`${t}    ${r}:
44`;return n.nonce&&(o+=`      nonce: ${n.nonce}
45`),n.balance&&(o+=`      balance: ${n.balance}
46`),n.code&&(o+=`      code: ${n.code}
47`),n.state&&(o+=`      state:
48`,o+=Vee(n.state)),n.stateDiff&&(o+=`      stateDiff:
49`,o+=Vee(n.stateDiff)),o},`  State Override:
50`).slice(0,-1)}var cw,lw,AS=h(()=>{ut();cw=class extends K{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}},lw=class extends K{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}});function V1(e){let t=Object.entries(e).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>`  ${`${n}:`.padEnd(r+1)}  ${o}`).join(`
51`)}var CS,bh,uw,dw,pw,Ml,fw,hw,Hl,xh,F1,mw,es=h(()=>{z8();$1();ut();CS=class extends K{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
52`),{name:"FeeConflictError"})}},bh=class extends K{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}},uw=class extends K{constructor({yParity:t}){super(`Invalid \`yParity\` value "${t}". Expected 0 or 1.`,{name:"InvalidYParityError"})}},dw=class extends K{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",V1(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}},pw=class extends K{constructor({serializedType:t}){super(`Serialized transaction type "${t}" is invalid.`,{name:"InvalidSerializedTransactionType"}),Object.defineProperty(this,"serializedType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedType=t}},Ml=class extends K{constructor({attributes:t,serializedTransaction:r,type:n}){let o=Object.entries(t).map(([s,i])=>typeof i>"u"?s:void 0).filter(Boolean);super(`Invalid serialized transaction of type "${n}" was provided.`,{metaMessages:[`Serialized Transaction: "${r}"`,o.length>0?`Missing Attributes: ${o.join(", ")}`:""].filter(Boolean),name:"InvalidSerializedTransactionError"}),Object.defineProperty(this,"serializedTransaction",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.serializedTransaction=r,this.type=n}},fw=class extends K{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}},hw=class extends K{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:p}){let f=V1({chain:o&&`${o?.name} (id: ${o?.id})`,from:r?.address,to:d,value:typeof p<"u"&&`${wh(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${vn(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${vn(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${vn(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",f].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},Hl=class extends K{constructor({blockHash:t,blockNumber:r,blockTag:n,hash:o,index:s}){let i="Transaction";n&&s!==void 0&&(i=`Transaction at block time "${n}" at index "${s}"`),t&&s!==void 0&&(i=`Transaction at block hash "${t}" at index "${s}"`),r&&s!==void 0&&(i=`Transaction at block number "${r}" at index "${s}"`),o&&(i=`Transaction with hash "${o}"`),super(`${i} could not be found.`,{name:"TransactionNotFoundError"})}},xh=class extends K{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}},F1=class extends K{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}},mw=class extends K{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}});function _o(e){if(e?.reason)return e.reason;if(typeof DOMException=="function")return new DOMException("This operation was aborted","AbortError");let t=new Error("This operation was aborted");return t.name="AbortError",t}function hi(e){return typeof e=="object"&&e!==null&&"name"in e&&e.name==="AbortError"}var jee,dp,Dc=h(()=>{jee=e=>e;dp=e=>{try{let t=new URL(e);return!t.username&&!t.password?e:(t.username="",t.password="",t.toString())}catch{return e}}});var vh,Eh,pp,gw,yw,ja,fp=h(()=>{Wr();U8();V8();np();$ee();up();z8();$1();zr();ut();AS();es();Dc();vh=class extends K{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:p,stateOverride:f}){let m=r?ct(r):void 0,g=V1({from:m?.address,to:d,value:typeof p<"u"&&`${wh(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${vn(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${vn(c)}
52 gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${vn(l)} gwei`,nonce:u});f&&(g+=`
53${zee(f)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}},Eh=class extends K{constructor(t,{abi:r,args:n,contractAddress:o,docsPath:s,functionName:i,sender:a}){let c=Qo({abi:r,args:n,name:i}),l=c?Rk({abiItem:c,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=c?Wn(c,{includeName:!0}):void 0,d=V1({address:o&&jee(o),function:u,args:l&&l!=="()"&&`${[...Array(i?.length??0).keys()].map(()=>" ").join("")}${l}`,sender:a});super(t.shortMessage||`An unknown error occurred while executing the contract function "${i}".`,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=t,this.contractAddress=o,this.functionName=i,this.sender=a}},pp=class extends K{constructor({abi:t,data:r,functionName:n,message:o,cause:s}){let i,a,c,l;if(r&&r!=="0x")try{a=yh({abi:t,data:r,cause:s});let{abiItem:d,errorName:p,args:f}=a;if(p==="Error")l=f[0];else if(p==="Panic"){let[m]=f;l=Uee[m]}else{let m=d?Wn(d,{includeName:!0}):void 0,g=d&&f?Rk({abiItem:d,args:f,includeFunctionName:!1,includeName:!1}):void 0;c=[m?`Error: ${m}`:"",g&&g!=="()"?`       ${[...Array(p?.length??0).keys()].map(()=>" ").join("")}${g}`:""]}}catch(d){i=d}else o&&(l=o);let u;i instanceof ch&&(u=i.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(`
54`):`The contract function "${n}" reverted.`,{cause:i??s,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=r,this.reason=l,this.signature=u}},gw=class extends K{constructor({functionName:t,cause:r}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",`  - The contract does not have the function "${t}",`,"  - The parameters passed to the contract function may be invalid, or","  - The address is not a contract."],name:"ContractFunctionZeroDataError",cause:r})}},yw=class extends K{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}},ja=class extends K{constructor({data:t,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}});var ts,hp,z1,qa,$l,mp,Wa=h(()=>{To();ut();Dc();ts=class extends K{constructor({body:t,cause:r,details:n,headers:o,status:s,url:i}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[s&&`Status: ${s}`,`URL: ${dp(i)}`,t&&`Request body: ${St(t)}
54`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=o,this.status=s,this.url=i}},hp=class extends K{constructor({maxSize:t,size:r}){super("HTTP response body exceeded the size limit.",{metaMessages:[`Max: ${t} bytes`,`Received: ${r} bytes`],name:"ResponseBodyTooLargeError"}),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t,this.size=r}},z1=class extends K{constructor({body:t,cause:r,details:n,url:o}){super("WebSocket request failed.",{cause:r,details:n,metaMessages:[`URL: ${dp(o)}`,t&&`Request body: ${St(t)}`].filter(Boolean),name:"WebSocketRequestError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=o}},qa=class extends K{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${dp(n)}`,`Request body: ${St(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=n}},$l=class extends K{constructor({url:t}={}){super("The socket has been closed.",{metaMessages:[t&&`URL: ${dp(t)}`].filter(Boolean),name:"SocketClosedError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=t}},mp=class extends K{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${dp(r)}`,`Request body: ${St(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}});var BRe,io,ao,Ah,Ch,Sh,Ih,Uc,mi,Th,_h,Fl,Vl,gp,Ph,Lc,Nh,Rh,Oh,Bh,kh,zl,Dh,Uh,Lh,Mh,Hh,jl,$h,ww,Fh=h(()=>{ut();Wa();BRe=-1,io=class extends K{constructor(t,{code:r,docsPath:n,metaMessages:o,name:s,shortMessage:i}){super(i,{cause:t,docsPath:n,metaMessages:o||t?.metaMessages,name:s||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=s||t.name,this.code=t instanceof qa?t.code:r??BRe}},ao=class extends io{constructor(t,r){super(t,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}},Ah=class e extends io{constructor(t){super(t,{code:e.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}};Object.defineProperty(Ah,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});Ch=class e extends io{constructor(t){super(t,{code:e.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}};Object.defineProperty(Ch,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});Sh=class e extends io{constructor(t,{method:r}={}){super(t,{code:e.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}};Object.defineProperty(Sh,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});Ih=class e extends io{constructor(t){super(t,{code:e.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
55`)})}};Object.defineProperty(Ih,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});Uc=class e extends io{constructor(t){super(t,{code:e.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}};Object.defineProperty(Uc,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});mi=class e extends io{constructor(t){super(t,{code:e.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
56`)})}};
56Object.defineProperty(mi,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});Th=class e extends io{constructor(t){super(t,{code:e.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}};Object.defineProperty(Th,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});_h=class e extends io{constructor(t){super(t,{code:e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}};Object.defineProperty(_h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});Fl=class e extends io{constructor(t){super(t,{code:e.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}};Object.defineProperty(Fl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});Vl=class e extends io{constructor(t,{method:r}={}){super(t,{code:e.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}};Object.defineProperty(Vl,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});gp=class e extends io{constructor(t){super(t,{code:e.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}};Object.defineProperty(gp,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});Ph=class e extends io{constructor(t){super(t,{code:e.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}};Object.defineProperty(Ph,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});Lc=class e extends ao{constructor(t){super(t,{code:e.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}};Object.defineProperty(Lc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});Nh=class e extends ao{constructor(t){super(t,{code:e.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}};Object.defineProperty(Nh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});Rh=class e extends ao{constructor(t,{method:r}={}){super(t,{code:e.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}};Object.defineProperty(Rh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});Oh=class e extends ao{constructor(t){super(t,{code:e.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}};Object.defineProperty(Oh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});Bh=class e extends ao{constructor(t){super(t,{code:e.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}};Object.defineProperty(Bh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});kh=class e extends ao{constructor(t){super(t,{code:e.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}};Object.defineProperty(kh,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});zl=class e extends ao{constructor(t){super(t,{code:e.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}};Object.defineProperty(zl,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});Dh=class e extends ao{constructor(t){super(t,{code:e.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}};Object.defineProperty(Dh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});Uh=class e extends ao{constructor(t){super(t,{code:e.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}};Object.defineProperty(Uh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});Lh=class e extends ao{constructor(t){super(t,{code:e.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}};Object.defineProperty(Lh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});Mh=class e extends ao{constructor(t){super(t,{code:e.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}};Object.defineProperty(Mh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});Hh=class e extends ao{constructor(t){super(t,{code:e.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}};Object.defineProperty(Hh,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}
56);jl=class e extends ao{constructor(t){super(t,{code:e.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}};Object.defineProperty(jl,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});$h=class e extends ao{constructor(t){super(t,{code:e.code,name:"WalletConnectSessionSettlementError",shortMessage:"WalletConnect session settlement failed."})}};Object.defineProperty($h,"code",{enumerable:!0,configurable:!0,writable:!0,value:7e3});ww=class extends io{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}});function Fs(e,{abi:t,address:r,args:n,docsPath:o,functionName:s,sender:i}){let a=e instanceof ja?e:e instanceof K?e.walk(m=>"data"in m)||e.walk():{},{code:c,data:l,details:u,message:d,shortMessage:p}=a,f=e instanceof di?new gw({functionName:s,cause:e}):[kRe,Uc.code].includes(c)&&(l||u||d||p)||c===mi.code&&u==="execution reverted"&&l?new pp({abi:t,data:typeof l=="object"?l.data:l,functionName:s,message:a instanceof qa?u:p??d,cause:e}):e;return new Eh(f,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:s,sender:i})}var kRe,Vh=h(()=>{zr();ut();fp();Wa();Fh();kRe=3});function qee(e){let t=Ht(`0x${e.substring(4)}`).substring(26);return Oc(`0x${t}`)}var Wee=h(()=>{Ms();fi()});function DRe(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function Ok(e,t,r){return e&t^~e&r}function Bk(e,t,r){return e&t^e&r^t&r}var bw,yp,kk=h(()=>{ap();bw=class extends fh{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=hS(this.buffer)}update(t){ip(this),t=U1(t),Ul(t);let{view:r,buffer:n,blockLen:o}=this,s=t.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=hS(t);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ip(this),fS(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;r[i++]=128,ia(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(n,0),i=0);for(let d=i;d<o;d++)r[d]=0;DRe(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=hS(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}},yp=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});var URe,zh,SS,j1,Dk=h(()=>{kk();ap();URe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),zh=new Uint32Array(64),SS=class extends bw{constructor(t=32){super(64,t,8,!1),this.A=yp[0]|0,this.B=yp[1]|0,this.C=yp[2]|0,this.D=yp[3]|0,this.E=yp[4]|0,this.F=yp[5]|0,this.G=yp[6]|0,this.H=yp[7]|0}get(){let{A:t,B:r,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[t,r,n,o,s,i,a,c]}set(t,r,n,o,s,i,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)zh[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){let p=zh[d-15],f=zh[d-2],m=Nc(p,7)^Nc(p,18)^p>>>3,g=Nc(f,17)^Nc(f,19)^f>>>10;zh[d]=g+zh[d-7]+m+zh[d-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){let p=Nc(a,6)^Nc(a,11)^Nc(a,25),f=u+p+Ok(a,c,l)+URe[d]+zh[d]|0,g=(Nc(n,2)^Nc(n,13)^Nc(n,22))+Bk(n,o,s)|0;u=l,l=c,c=a,a=i+f|0,i=s,s=o,o=n,n=f+g|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,s,i,a,c,l,u)}roundClean(){ia(zh)}destroy(){this.set(0,0,0,0,0,0,0,0),ia(this.buffer)}},j1=Jy(()=>new SS)});var IS,Uk,Kee=h(()=>{ap();IS=class extends fh{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,gee(t);let n=U1(r);if(this.iHash=t.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;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),ia(s)}update(t){return ip(this),this.iHash.update(t),this}digestInto(t){ip(this),Ul(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:o,destroyed:s,blockLen:i,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Uk=(e,t,r)=>new IS(e,t).update(r).digest();Uk.create=(e,t)=>
vendor: 12,285 bytes, line 56
56new IS(e,t)});function xw(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function bp(e){if(!xw(e))throw new Error("Uint8Array expected")}function vw(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function j8(e){let t=e.toString(16);return t.length&1?"0"+t:t}function Yee(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?$k:BigInt("0x"+e)}function Ew(e){if(bp(e),Jee)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=LRe[e[r]];return t}function Zee(e){if(e>=wp._0&&e<=wp._9)return e-wp._0;if(e>=wp.A&&e<=wp.F)return e-(wp.A-10);if(e>=wp.a&&e<=wp.f)return e-(wp.a-10)}function q8(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Jee)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=Zee(e.charCodeAt(s)),a=Zee(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function gi(e){return Yee(Ew(e))}function Fk(e){return bp(e),Yee(Ew(Uint8Array.from(e).reverse()))}function ql(e,t){return q8(e.toString(16).padStart(t*2,"0"))}function Vk(e,t){return ql(e,t).reverse()}function Rn(e,t,r){let n;if(typeof t=="string")try{n=q8(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(xw(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function Vs(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];bp(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function TS(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function q1(e,t,r){return Lk(e)&&Lk(t)&&Lk(r)&&t<=e&&e<r}function xp(e,t,r,n){if(!q1(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Qee(e){let t;for(t=0;e>$k;e>>=Hk,t+=1);return t}function Xee(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=Mk(e),o=Mk(e),s=0,i=()=>{n.fill(1),o.fill(0),s=0},a=(...d)=>r(o,n,...d),c=(d=Mk(0))=>{o=a(Gee([0]),d),n=a(),d.length!==0&&(o=a(Gee([1]),d),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,p=[];for(;d<t;){n=a();let f=n.slice();p.push(f),d+=n.length}return Vs(...p)};return(d,p)=>{i(),c(d);let f;for(;!(f=p(l()));)c();return i(),f}}function vp(e,t,r={}){let n=(o,s,i)=>{let a=MRe[s];if(typeof a!="function")throw new Error("invalid validator function");let c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+c)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(r))n(o,s,!0);return e}function zk(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}var $k,Hk,Jee,LRe,wp,Lk,W1,Mk,Gee,MRe,Aw=h(()=>{$k=BigInt(0),Hk=BigInt(1);Jee=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",LRe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));wp={_0:48,_9:57,A:65,F:70,a:97,f:102};Lk=e=>typeof e=="bigint"&&$k<=e;W1=e=>(Hk<<BigInt(e))-Hk,Mk=e=>new Uint8Array(e),Gee=e=>Uint8Array.from(e);MRe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||xw(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)}});function En(e,t){let r=e%t;return r>=zs?r:t+r}function ua(e,t,r){let n=e;for(;t-- >zs;)n*=n,n%=r;return n}function _S(e,t){if(e===zs)throw new Error("invert: expected non-zero number");if(t<=zs)throw new Error("invert: expected positive modulus, got "+t);let r=En(e,t),n=t,o=zs,s=rs,i=rs,a=zs;for(;r!==zs;){let l=n/r,u=n%r,d=o-i*l,p=s-a*l;n=r,r=u,o=i,s=a,i=d,a=p}if(n!==rs)throw new Error("invert: does not exist");return En(o,t)}function ote(e,t){let r=(e.ORDER+rs)/tte,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function $Re(e,t){let r=(e.ORDER-rte)/nte,n=e.mul(t,K1),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,K1),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function FRe(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-rs,r=0;for(;t%K1===zs;)t/=K1,r++;let n=K1,o=W8(e);for(;ete(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return ote;let s=o.pow(n,t),i=(t+rs)/K1;return function(c,l){if(c.is0(l))return l;if(ete(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,s),p=c.pow(l,t),f=c.pow(l,i);for(;!c.eql(p,c.ONE);){if(c.is0(p))return c.ZERO;let m=1,g=c.sqr(p);for(;!c.eql(g,c.ONE);)if(m++,g=c.sqr(g),m===u)throw new Error("Cannot find square root");let y=rs<<BigInt(u-m-1),b=c.pow(d,y);u=m,d=c.sqr(b),p=c.mul(p,d),f=c.mul(f,b)}return f}}function VRe(e){return e%tte===HRe?ote:e%nte===rte?$Re:FRe(e)}function PS(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=zRe.reduce((n,o)=>(n[o]="function",n),t);return vp(e,r)}function jRe(e,t,r){if(r<zs)throw new Error("invalid exponent, negatives unsupported");if(r===zs)return e.ONE;if(r===rs)return t;let n=e.ONE,o=t;for(;r>zs;)r&rs&&(n=e.mul(n,o)),o=e.sqr(o),r>>=rs;return n}function Cw(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(n[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(n[c]=e.mul(i,n[c]),e.mul(i,a)),s),n}function ete(e,t){let r=(e.ORDER-rs)/K1,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function jk(e,t){t!==void 0&&D1(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function W8(e,t,r=!1,n={}){if(e<=zs)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=jk(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i,a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:W1(o),ZERO:zs,ONE:rs,create:c=>En(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return zs<=c&&c<e},is0:c=>c===zs,isOdd:c=>(c&rs)===rs,neg:c=>En(-c,e),eql:(c,l)=>c===l,sqr:c=>En(c*c,e),add:(c,l)=>En(c+l,e),sub:(c,l)=>En(c-l,e),mul:(c,l)=>En(c*l,e),pow:(c,l)=>jRe(a,c,l),div:(c,l)=>En(c*_S(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>_S(c,e),sqrt:n.sqrt||(c=>(i||(i=VRe(e)),i(a,c))),toBytes:c=>r?Vk(c,s):ql(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?Fk(c):gi(c)},invertBatch:c=>Cw(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function ste(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function qk(e){let t=ste(e);return t+Math.ceil(t/2)}function ite(e,t,r=!1){let n=e.length,o=ste(t),s=qk(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);let i=r?Fk(e):gi(e),a=En(i,t-rs)+rs;return r?Vk(a,o):ql(a,o)}var zs,rs,K1,HRe,tte,rte,nte,zRe,K8=h(()=>{ap();Aw();zs=BigInt(0),rs=BigInt(1),K1=BigInt(2),HRe=BigInt(3),tte=BigInt(4),rte=BigInt(5),nte=BigInt(8);zRe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function Wk(e,t){let r=t.negate();return e?r:t}function lte(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Kk(e,t){lte(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,s=W1(e),i=BigInt(e);return{windows:r,windowSize:n,mask:s,maxNumber:o,shiftBy:i}}function cte(e,t,r){let{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r,a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=Yk);let l=t*n,u=l+Math.abs(a)-1,d=a===0,p=a<0,f=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:l}}function qRe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function WRe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}function Gk(e){return ute.get(e)||1}function dte(e,t){return{constTimeNegate:Wk,hasPrecomputes(r){return Gk(r)!==1},unsafeLadder(r,n,o=e.ZERO){let s=r;for(;n>ate;)n&Yk&&(o=o.add(s)),s=s.double(),n>>=Yk;return o},precomputeWindow(r,n){let{windows:o,windowSize:s}=Kk(n,t),i=[],a=r,c=a;for(let l=0;l<o;l++){c=a,i.push(c);for(let u=1;u<s;u++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(r,n,o){let s=e.ZERO,i=e.BASE,a=Kk(r,t);for(let c=0;c<a.windows;c++){let{nextN:l,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:m}=cte(o,c,a);o=l,d?i=i.add(Wk(f,n[m])):s=s.add(Wk(p,n[u]))}return{p:s,f:i}},wNAFUnsafe(r,n,o,s=e.ZERO){let i=Kk(r,t);for(let a=0;a<i.windows&&o!==ate;a++){let{nextN:c,offset:l,isZero:u,isNeg:d}=cte(o,a,i);if(o=c,!u){let p=n[l];s=s.add(d?p.negate():p)}}return s},getPrecomputes(r,n,o){let s=Zk.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&Zk.set(n,o(s))),s},wNAFCached(r,n,o){let s=Gk(r);return this.wNAF(s,this.getPrecomputes(s,r,o),n)},wNAFCachedUnsafe(r,n,o,s){let i=Gk(r);return i===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,r,o),n,s)},setWindowSize(r,n){lte(n,t),ute.set(r,n),Zk.delete(r)}}}function pte(e,t,r,n){qRe(r,e),WRe(n,t);let o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");let i=e.ZERO,a=Qee(BigInt(o)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=W1(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c,p=i;for(let f=d;f>=0;f-=c){u.fill(i);for(let g=0;g<s;g++){let y=n[g],b=Number(y>>BigInt(f)&l);u[b]=u[b].add(r[g])}let m=i;for(let g=u.length-1,y=i;g>0;g--)y=y.add(u[g]),m=m.add(y);if(p=p.add(m),f!==0)for(let g=0;g<c;g++)p=p.double()}return p}function Jk(e){return PS(e.Fp),vp(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...jk(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var ate,Yk,Zk,ute,fte=h(()=>{K8();Aw();ate=BigInt(0),Yk=BigInt(1);Zk=new WeakMap,ute=new WeakMap});function hte(e){e.lowS!==void 0&&vw("lowS",e.lowS),e.prehash!==void 0&&vw("prehash",e.prehash)}function KRe(e){let t=Jk(e);vp(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}function Qk(e,t){return Ew(ql(e,t))}function ZRe(e){let t=KRe(e),{Fp:r}=t,n=W8(t.n,t.nBitLength),o=t.toBytes||((w,x,S)=>{let P=x.toAffine();return Vs(Uint8Array.from([4]),r.toBytes(P.x),r.toBytes(P.y))}),s=t.fromBytes||(w=>{let x=w.subarray(1),S=r.fromBytes(x.subarray(0,r.BYTES)),P=r.fromBytes(x.subarray(r.BYTES,2*r.BYTES));return{x:S,y:P}});function i(w){let{a:x,b:S}=t,P=r.sqr(w),D=r.mul(P,w);return r.add(r.add(D,r.mul(w,x)),S)}function a(w,x){let S=r.sqr(x),P=i(w);return r.eql(S,P)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,Z8),eD),l=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,l)))throw new Error("bad curve params: a or b");function u(w){return q1(w,Er,t.n)}function d(w){let{allowedPrivateKeyLengths:x,nByteLength:S,wrapPrivateKey:P,n:D}=t;
vendor: 10,008 bytes, line 56
56if(x&&typeof w!="bigint"){if(xw(w)&&(w=Ew(w)),typeof w!="string"||!x.includes(w.length))throw new Error("invalid private key");w=w.padStart(S*2,"0")}let U;try{U=typeof w=="bigint"?w:gi(Rn("private key",w,S))}catch{throw new Error("invalid private key, expected hex or "+S+" bytes, got "+typeof w)}return P&&(U=En(U,D)),xp("private key",U,Er,D),U}function p(w){if(!(w instanceof g))throw new Error("ProjectivePoint expected")}let f=zk((w,x)=>{let{px:S,py:P,pz:D}=w;if(r.eql(D,r.ONE))return{x:S,y:P};let U=w.is0();x==null&&(x=U?r.ONE:r.inv(D));let N=r.mul(S,x),L=r.mul(P,x),I=r.mul(D,x);if(U)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:N,y:L}}),m=zk(w=>{if(w.is0()){if(t.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}let{x,y:S}=w.toAffine();if(!r.isValid(x)||!r.isValid(S))throw new Error("bad point: x or y not FE");if(!a(x,S))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(x,S,P){if(x==null||!r.isValid(x))throw new Error("x required");if(S==null||!r.isValid(S)||r.is0(S))throw new Error("y required");if(P==null||!r.isValid(P))throw new Error("z required");this.px=x,this.py=S,this.pz=P,Object.freeze(this)}static fromAffine(x){let{x:S,y:P}=x||{};if(!x||!r.isValid(S)||!r.isValid(P))throw new Error("invalid affine point");if(x instanceof g)throw new Error("projective point not allowed");let D=U=>r.eql(U,r.ZERO);return D(S)&&D(P)?g.ZERO:new g(S,P,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){let S=Cw(r,x.map(P=>P.pz));return x.map((P,D)=>P.toAffine(S[D])).map(g.fromAffine)}static fromHex(x){let S=g.fromAffine(s(Rn("pointHex",x)));return S.assertValidity(),S}static fromPrivateKey(x){return g.BASE.multiply(d(x))}static msm(x,S){return pte(g,n,x,S)}_setWindowSize(x){C.setWindowSize(this,x)}assertValidity(){m(this)}hasEvenY(){let{y:x}=this.toAffine();if(r.isOdd)return!r.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.eql(r.mul(S,L),r.mul(U,D)),R=r.eql(r.mul(P,L),r.mul(N,D));return I&&R}negate(){return new g(this.px,r.neg(this.py),this.pz)}double(){let{a:x,b:S}=t,P=r.mul(S,Z8),{px:D,py:U,pz:N}=this,L=r.ZERO,I=r.ZERO,R=r.ZERO,A=r.mul(D,D),T=r.mul(U,U),v=r.mul(N,N),E=r.mul(D,U);return E=r.add(E,E),R=r.mul(D,N),R=r.add(R,R),L=r.mul(x,R),I=r.mul(P,v),I=r.add(L,I),L=r.sub(T,I),I=r.add(T,I),I=r.mul(L,I),L=r.mul(E,L),R=r.mul(P,R),v=r.mul(x,v),E=r.sub(A,v),E=r.mul(x,E),E=r.add(E,R),R=r.add(A,A),A=r.add(R,A),A=r.add(A,v),A=r.mul(A,E),I=r.add(I,A),v=r.mul(U,N),v=r.add(v,v),A=r.mul(v,E),L=r.sub(L,A),R=r.mul(v,T),R=r.add(R,R),R=r.add(R,R),new g(L,I,R)}add(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.ZERO,R=r.ZERO,A=r.ZERO,T=t.a,v=r.mul(t.b,Z8),E=r.mul(S,U),O=r.mul(P,N),B=r.mul(D,L),_=r.add(S,P),M=r.add(U,N);_=r.mul(_,M),M=r.add(E,O),_=r.sub(_,M),M=r.add(S,D);let F=r.add(U,L);return M=r.mul(M,F),F=r.add(E,B),M=r.sub(M,F),F=r.add(P,D),I=r.add(N,L),F=r.mul(F,I),I=r.add(O,B),F=r.sub(F,I),A=r.mul(T,M),I=r.mul(v,B),A=r.add(I,A),I=r.sub(O,A),A=r.add(O,A),R=r.mul(I,A),O=r.add(E,E),O=r.add(O,E),B=r.mul(T,B),M=r.mul(v,M),O=r.add(O,B),B=r.sub(E,B),B=r.mul(T,B),M=r.add(M,B),E=r.mul(O,M),R=r.add(R,E),E=r.mul(F,M),I=r.mul(_,I),I=r.sub(I,E),E=r.mul(_,O),A=r.mul(F,A),A=r.add(A,E),new g(I,R,A)}subtract(x){return this.add(x.negate())}is0(){return this.equals(g.ZERO)}wNAF(x){return C.wNAFCached(this,x,g.normalizeZ)}multiplyUnsafe(x){let{endo:S,n:P}=t;xp("scalar",x,Mc,P);let D=g.ZERO;if(x===Mc)return D;if(this.is0()||x===Er)return this;if(!S||C.hasPrecomputes(this))return C.wNAFCachedUnsafe(this,x,g.normalizeZ);let{k1neg:U,k1:N,k2neg:L,k2:I}=S.splitScalar(x),R=D,A=D,T=this;for(;N>Mc||I>Mc;)N&Er&&(R=R.add(T)),I&Er&&(A=A.add(T)),T=T.double(),N>>=Er,I>>=Er;return U&&(R=R.negate()),L&&(A=A.negate()),A=new g(r.mul(A.px,S.beta),A.py,A.pz),R.add(A)}multiply(x){let{endo:S,n:P}=t;xp("scalar",x,Er,P);let D,U;if(S){let{k1neg:N,k1:L,k2neg:I,k2:R}=S.splitScalar(x),{p:A,f:T}=this.wNAF(L),{p:v,f:E}=this.wNAF(R);A=C.constTimeNegate(N,A),v=C.constTimeNegate(I,v),v=new g(r.mul(v.px,S.beta),v.py,v.pz),D=A.add(v),U=T.add(E)}else{let{p:N,f:L}=this.wNAF(x);D=N,U=L}return g.normalizeZ([D,U])[0]}multiplyAndAddUnsafe(x,S,P){let D=g.BASE,U=(L,I)=>I===Mc||I===Er||!L.equals(D)?L.multiplyUnsafe(I):L.multiply(I),N=U(this,S).add(U(x,P));return N.is0()?void 0:N}toAffine(x){return f(this,x)}isTorsionFree(){let{h:x,isTorsionFree:S}=t;if(x===Er)return!0;if(S)return S(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:x,clearCofactor:S}=t;return x===Er?this:S?S(g,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return vw("isCompressed",x),this.assertValidity(),o(g,this,x)}toHex(x=!0){return vw("isCompressed",x),Ew(this.toRawBytes(x))}}g.BASE=new g(t.Gx,t.Gy,r.ONE),g.ZERO=new g(r.ZERO,r.ONE,r.ZERO);let{endo:y,nBitLength:b}=t,C=dte(g,y?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function GRe(e){let t=Jk(e);return vp(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function mte(e){let t=GRe(e),{Fp:r,n,nByteLength:o,nBitLength:s}=t,i=r.BYTES+1,a=2*r.BYTES+1;function c(v){return En(v,n)}function l(v){return _S(v,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:f}=ZRe({...t,toBytes(v,E,O){let B=E.toAffine(),_=r.toBytes(B.x),M=Vs;return vw("isCompressed",O),O?M(Uint8Array.from([E.hasEvenY()?2:3]),_):M(Uint8Array.from([4]),_,r.toBytes(B.y))},fromBytes(v){let E=v.length,O=v[0],B=v.subarray(1);if(E===i&&(O===2||O===3)){let _=gi(B);if(!q1(_,Er,r.ORDER))throw new Error("Point is not on curve");let M=p(_),F;try{F=r.sqrt(M)}catch(Q){let Y=Q instanceof Error?": "+Q.message:"";throw new Error("Point is not on curve"+Y)}let q=(F&Er)===Er;return(O&1)===1!==q&&(F=r.neg(F)),{x:_,y:F}}else if(E===a&&O===4){let _=r.fromBytes(B.subarray(0,r.BYTES)),M=r.fromBytes(B.subarray(r.BYTES,2*r.BYTES));return{x:_,y:M}}else{let _=i,M=a;throw new Error("invalid Point, expected length of "+_+", or uncompressed "+M+", got "+E)}}});function m(v){let E=n>>Er;return v>E}function g(v){return m(v)?c(-v):v}let y=(v,E,O)=>gi(v.slice(E,O));class b{constructor(E,O,B){xp("r",E,Er,n),xp("s",O,Er,n),this.r=E,this.s=O,B!=null&&(this.recovery=B),Object.freeze(this)}static fromCompact(E){let O=o;return E=Rn("compactSignature",E,O*2),new b(y(E,0,O),y(E,O,2*O))}static fromDER(E){let{r:O,s:B}=Ep.toSig(Rn("DER",E));return new b(O,B)}assertValidity(){}addRecoveryBit(E){return new b(this.r,this.s,E)}recoverPublicKey(E){let{r:O,s:B,recovery:_}=this,M=D(Rn("msgHash",E));if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");let F=_===2||_===3?O+t.n:O;if(F>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(_&1)===0?"02":"03",oe=u.fromHex(q+Qk(F,r.BYTES)),Q=l(F),Y=c(-M*Q),pe=c(B*Q),he=u.BASE.multiplyAndAddUnsafe(oe,Y,pe);if(!he)throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return q8(this.toDERHex())}toDERHex(){return Ep.hexFromSig(this)}toCompactRawBytes(){return q8(this.toCompactHex())}toCompactHex(){let E=o;return Qk(this.r,E)+Qk(this.s,E)}}let C={isValidPrivateKey(v){try{return d(v),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let v=qk(t.n);return ite(t.randomBytes(v),t.n)},precompute(v=8,E=u.BASE){return E._setWindowSize(v),E.multiply(BigInt(3)),E}};function w(v,E=!0){return u.fromPrivateKey(v).toRawBytes(E)}function x(v){if(typeof v=="bigint")return!1;if(v instanceof u)return!0;let O=Rn("key",v).length,B=r.BYTES,_=B+1,M=2*B+1;if(!(t.allowedPrivateKeyLengths||o===_))return O===_||O===M}function S(v,E,O=!0){if(x(v)===!0)throw new Error("first arg must be private key");if(x(E)===!1)throw new Error("second arg must be public key");return u.fromHex(E).multiply(d(v)).toRawBytes(O)}let P=t.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");let E=gi(v),O=v.length*8-s;return O>0?E>>BigInt(O):E},D=t.bits2int_modN||function(v){return c(P(v))},U=W1(s);function N(v){return xp("num < 2^"+s,v,Mc,U),ql(v,o)}function L(v,E,O=I){if(["recovered","canonical"].some(me=>me in O))throw new Error("sign() legacy options not supported");let{hash:B,randomBytes:_}=t,{lowS:M,prehash:F,extraEntropy:q}=O;M==null&&(M=!0),v=Rn("msgHash",v),hte(O),F&&(v=Rn("prehashed msgHash",B(v)));let oe=D(v),Q=d(E),Y=[N(Q),N(oe)];if(q!=null&&q!==!1){let me=q===!0?_(r.BYTES):q;Y.push(Rn("extraEntropy",me))}let pe=Vs(...Y),he=oe;function Te(me){let _e=P(me);if(!f(_e))return;let wt=l(_e),Nt=u.BASE.multiply(_e).toAffine(),bt=c(Nt.x);if(bt===Mc)return;let ar=c(wt*c(he+bt*Q));if(ar===Mc)return;let Ar=(Nt.x===bt?0:2)|Number(Nt.y&Er),fl=ar;return M&&m(ar)&&(fl=g(ar),Ar^=1),new b(bt,fl,Ar)}return{seed:pe,k2sig:Te}}let I={lowS:t.lowS,prehash:!1},R={lowS:t.lowS,prehash:!1};function A(v,E,O=I){let{seed:B,k2sig:_}=L(v,E,O),M=t;return Xee(M.hash.outputLen,M.nByteLength,M.hmac)(B,_)}u.BASE._setWindowSize(8);function T(v,E,O,B=R){let _=v;E=Rn("msgHash",E),O=Rn("publicKey",O);let{lowS:M,prehash:F,format:q}=B;if(hte(B),"strict"in B)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&q!=="compact"&&q!=="der")throw new Error("format must be compact or der");let oe=typeof _=="string"||xw(_),Q=!oe&&!q&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!oe&&!Q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,pe;try{if(Q&&(Y=new b(_.r,_.s)),oe){try{q!=="compact"&&(Y=b.fromDER(_))}catch(Ar){if(!(Ar instanceof Ep.Err))throw Ar}!Y&&q!=="der"&&(Y=b.fromCompact(_))}pe=u.fromHex(O)}catch{return!1}if(!Y||M&&Y.hasHighS())return!1;F&&(E=t.hash(E));
56let{r:he,s:Te}=Y,me=D(E),_e=l(Te),wt=c(me*_e),Nt=c(he*_e),bt=u.BASE.multiplyAndAddUnsafe(pe,wt,Nt)?.toAffine();return bt?c(bt.x)===he:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:S,sign:A,verify:T,ProjectivePoint:u,Signature:b,utils:C}}function YRe(e,t){let r=e.ORDER,n=Mc;for(let m=r-Er;m%jh===Mc;m/=jh)n+=Er;let o=n,s=jh<<o-Er-Er,i=s*jh,a=(r-Er)/i,c=(a-Er)/jh,l=i-Er,u=s,d=e.pow(t,a),p=e.pow(t,(a+Er)/jh),f=(m,g)=>{let y=d,b=e.pow(g,l),C=e.sqr(b);C=e.mul(C,g);let w=e.mul(m,C);w=e.pow(w,c),w=e.mul(w,b),b=e.mul(w,g),C=e.mul(w,m);let x=e.mul(C,b);w=e.pow(x,u);let S=e.eql(w,e.ONE);b=e.mul(C,p),w=e.mul(x,y),C=e.cmov(b,C,S),x=e.cmov(w,x,S);for(let P=o;P>Er;P--){let D=P-jh;D=jh<<D-Er;let U=e.pow(x,D),N=e.eql(U,e.ONE);b=e.mul(C,y),y=e.mul(y,y),U=e.mul(x,y),C=e.cmov(b,C,N),x=e.cmov(U,x,N)}return{isValid:S,value:C}};if(e.ORDER%eD===Z8){let m=(e.ORDER-Z8)/eD,g=e.sqrt(e.neg(t));f=(y,b)=>{let C=e.sqr(b),w=e.mul(y,b);C=e.mul(C,w);let x=e.pow(C,m);x=e.mul(x,w);let S=e.mul(x,g),P=e.mul(e.sqr(x),b),D=e.eql(P,y),U=e.cmov(S,x,D);return{isValid:D,value:U}}}return f}function gte(e,t){if(PS(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let r=YRe(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let o,s,i,a,c,l,u,d;o=e.sqr(n),o=e.mul(o,t.Z),s=e.sqr(o),s=e.add(s,o),i=e.add(s,e.ONE),i=e.mul(i,t.B),a=e.cmov(t.Z,e.neg(s),!e.eql(s,e.ZERO)),a=e.mul(a,t.A),s=e.sqr(i),l=e.sqr(a),c=e.mul(l,t.A),s=e.add(s,c),s=e.mul(s,i),l=e.mul(l,a),c=e.mul(l,t.B),s=e.add(s,c),u=e.mul(o,i);let{isValid:p,value:f}=r(s,l);d=e.mul(o,n),d=e.mul(d,f),u=e.cmov(u,i,p),d=e.cmov(d,f,p);let m=e.isOdd(n)===e.isOdd(d);d=e.cmov(e.neg(d),d,m);let g=Cw(e,[a],!0)[0];return u=e.mul(u,g),{x:u,y:d}}}var Xk,Ep,Mc,Er,jh,Z8,eD,tD=h(()=>{fte();K8();Aw();Xk=class extends Error{constructor(t=""){super(t)}},Ep={Err:Xk,_tlv:{encode:(e,t)=>{let{Err:r}=Ep;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=j8(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?j8(o.length/2|128):"";return j8(e)+s+o+t},decode(e,t){let{Err:r}=Ep,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],s=!!(o&128),i=0;if(!s)i=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=t.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of l)i=i<<8|u;if(n+=c,i<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+i)}}},_int:{encode(e){let{Err:t}=Ep;if(e<Mc)throw new t("integer: negative integers are not allowed");let r=j8(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Ep;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return gi(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=Ep,o=Rn("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=Ep,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),s=n+o;return t.encode(48,s)}};Mc=BigInt(0),Er=BigInt(1),jh=BigInt(2),Z8=BigInt(3),eD=BigInt(4)});function JRe(e){return{hash:e,hmac:(t,...r)=>Uk(e,t,wee(...r)),randomBytes:mS}}function yte(e,t){let r=n=>mte({...e,...JRe(n)});return{...r(t),create:r}}var wte=h(()=>{Kee();ap();tD();});function qh(e,t){if(G8(e),G8(t),e<0||e>=1<<8*t)throw new Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=e&255,e>>>=8;return new Uint8Array(r)}function XRe(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function G8(e){if(!Number.isSafeInteger(e))throw new Error("number expected")}function eOe(e,t,r,n){bp(e),bp(t),G8(r),t.length>255&&(t=n(Vs(TS("H2C-OVERSIZE-DST-"),t)));let{outputLen:o,blockLen:s}=n,i=Math.ceil(r/o);if(r>65535||i>
56255)throw new Error("expand_message_xmd: invalid lenInBytes");let a=Vs(t,qh(t.length,1)),c=qh(0,s),l=qh(r,2),u=new Array(i),d=n(Vs(c,e,l,qh(0,1),a));u[0]=n(Vs(d,qh(1,1),a));for(let f=1;f<=i;f++){let m=[XRe(d,u[f-1]),qh(f+1,1),a];u[f]=n(Vs(...m))}return Vs(...u).slice(0,r)}function tOe(e,t,r,n,o){if(bp(e),bp(t),G8(r),t.length>255){let s=Math.ceil(2*n/8);t=o.create({dkLen:s}).update(TS("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(qh(r,2)).update(t).update(qh(t.length,1)).digest()}function bte(e,t,r){vp(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:o,m:s,hash:i,expand:a,DST:c}=r;bp(e),G8(t);let l=typeof c=="string"?TS(c):c,u=n.toString(2).length,d=Math.ceil((u+o)/8),p=t*s*d,f;if(a==="xmd")f=eOe(e,l,p,i);else if(a==="xof")f=tOe(e,l,p,o,i);else if(a==="_internal_pass")f=e;else throw new Error('expand must be "xmd" or "xof"');let m=new Array(t);for(let g=0;g<t;g++){let y=new Array(s);for(let b=0;b<s;b++){let C=d*(b+g*s),w=f.subarray(C,C+d);y[b]=En(QRe(w),n)}m[g]=y}return m}function xte(e,t){let r=t.map(n=>Array.from(n).reverse());return(n,o)=>{let[s,i,a,c]=r.map(d=>d.reduce((p,f)=>e.add(e.mul(p,n),f))),[l,u]=Cw(e,[i,c],!0);return n=e.mul(s,l),o=e.mul(o,e.mul(a,u)),{x:n,y:o}}}function vte(e,t,r){if(typeof t!="function")throw new Error("mapToCurve() must be defined");function n(s){return e.fromAffine(t(s))}function o(s){let i=s.clearCofactor();return i.equals(e.ZERO)?e.ZERO:(i.assertValidity(),i)}return{defaults:r,hashToCurve(s,i){let a=bte(s,2,{...r,DST:r.DST,...i}),c=n(a[0]),l=n(a[1]);return o(c.add(l))},encodeToCurve(s,i){let a=bte(s,1,{...r,DST:r.encodeDST,...i});return o(n(a[0]))},mapToCurve(s){if(!Array.isArray(s))throw new Error("expected array of bigints");for(let i of s)if(typeof i!="bigint")throw new Error("expected array of bigints");return o(n(s))}}}var QRe,Ete=h(()=>{K8();Aw();QRe=gi});var Pte={};Ce(Pte,{encodeToCurve:()=>lOe,hashToCurve:()=>cOe,schnorr:()=>sOe,secp256k1:()=>js,secp256k1_hasher:()=>cD});function Ste(e){let t=Q8,r=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=ua(u,r,t)*u%t,p=ua(d,r,t)*u%t,f=ua(p,RS,t)*l%t,m=ua(f,o,t)*f%t,g=ua(m,s,t)*m%t,y=ua(g,a,t)*g%t,b=ua(y,c,t)*y%t,C=ua(b,a,t)*g%t,w=ua(C,r,t)*u%t,x=ua(w,i,t)*m%t,S=ua(x,n,t)*l%t,P=ua(S,RS,t);if(!Wh.eql(Wh.sqr(P),e))throw new Error("Cannot find square root");return P}function OS(e,...t){let r=Cte[e];if(r===void 0){let n=j1(Uint8Array.from(e,o=>
56o.charCodeAt(0)));r=Vs(n,n),Cte[e]=r}return j1(Vs(r,...t))}function oD(e){let t=js.utils.normPrivateKeyToScalar(e),r=aD.fromPrivateKey(t);return{scalar:r.hasEvenY()?t:J8(-t),bytes:iD(r)}}function Ite(e){xp("x",e,Y8,Q8);let t=rD(e*e),r=rD(t*e+BigInt(7)),n=Ste(r);n%RS!==sD&&(n=rD(-n));let o=new aD(e,n,Y8);return o.assertValidity(),o}function Tte(...e){return J8(Sw(OS("BIP0340/challenge",...e)))}function nOe(e){return oD(e).bytes}function oOe(e,t,r=mS(32)){let n=Rn("message",e),{bytes:o,scalar:s}=oD(t),i=Rn("auxRand",r,32),a=nD(s^Sw(OS("BIP0340/aux",i))),c=OS("BIP0340/nonce",a,o,n),l=J8(Sw(c));if(l===sD)throw new Error("sign failed: k is zero");let{bytes:u,scalar:d}=oD(l),p=Tte(u,o,n),f=new Uint8Array(64);if(f.set(u,0),f.set(nD(J8(d+p*s)),32),!_te(f,n,o))throw new Error("sign: Invalid signature produced");return f}function _te(e,t,r){let n=Rn("signature",e,64),o=Rn("message",t),s=Rn("publicKey",r,32);try{let i=Ite(Sw(s)),a=Sw(n.subarray(0,32));if(!q1(a,Y8,Q8))return!1;let c=Sw(n.subarray(32,64));if(!q1(c,Y8,NS))return!1;let l=Tte(nD(a),iD(i),o),u=rOe(i,c,J8(-l));return!(!u||!u.hasEvenY()||u.toAffine().x!==a)}catch{return!1}}var Q8,NS,sD,Y8,RS,Ate,Wh,js,Cte,iD,nD,rD,J8,aD,rOe,Sw,sOe,iOe,aOe,cD,cOe,lOe,Z1=h(()=>{Dk();ap();wte();Ete();K8();Aw();tD();Q8=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),NS=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),sD=BigInt(0),Y8=BigInt(1),RS=BigInt(2),Ate=(e,t)=>(e+t/RS)/t;Wh=W8(Q8,void 0,void 0,{sqrt:Ste}),js=yte({a:sD,b:BigInt(7),Fp:Wh,n:NS,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=NS,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Y8*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,i=BigInt("0x100000000000000000000000000000000"),a=Ate(s*e,t),c=Ate(-n*e,t),l=En(e-a*r-c*o,t),u=En(-a*n-c*s,t),d=l>i,p=u>i;if(d&&(l=t-l),p&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:p,k2:u}}}},j1),Cte={};iD=e=>e.toRawBytes(!0).slice(1),nD=e=>ql(e,32),rD=e=>En(e,Q8),J8=e=>En(e,NS),aD=js.ProjectivePoint,rOe=(e,t,r)=>aD.BASE.multiplyAndAddUnsafe(e,t,r);Sw=gi;sOe={getPublicKey:nOe,sign:oOe,verify:_te,utils:{randomPrivateKey:js.utils.randomPrivateKey,lift_x:Ite,pointToBytes:iD,numberToBytesBE:ql,bytesToNumberBE:gi,taggedHash:OS,mod:En}},iOe=xte(Wh,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(t=>BigInt(t)))),aOe=gte(Wh,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:Wh.create(BigInt("-11"))}),cD=vte(js.ProjectivePoint,e=>{let{x:t,y:r}=aOe(Wh.create(e[0]));return iOe(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:Wh.ORDER,m:1,k:128,expand:"xmd",hash:j1}),cOe=cD.hashToCurve,lOe=cD.encodeToCurve});async function BS({hash:e,signature:t}){let r=Ve(e)?e:vr(e),{secp256k1:n}=await Promise.resolve().then(()=>(Z1(),Pte));return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){let{r:l,s:u,v:d,yParity:p}=t,f=Number(p??d),m=Nte(f);return new n.Signature(at(l),at(u)).addRecoveryBit(m)}let i=Ve(t)?t:vr(t);if(yt(i)!==65)throw new Error("invalid signature length");let a=ht(`0x${i.slice(130)}`),c=Nte(a);return n.Signature.fromCompact(i.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function Nte(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}var lD=h(()=>{Us();Go();tn();Fe()});async function qs({hash:e,signature:t}){return qee(await BS({hash:e,signature:t}))}var Kh=h(()=>{Wee();lD()});function Ws(e,t="hex"){let r=Bte(e),n=kc(new Uint8Array(r.length));return r.encode(n),t==="hex"?ft(n.bytes):n.bytes}function Rte(e,t="bytes"){return Ws(e,t)}
56function Ote(e,t="hex"){return Ws(e,t)}function Bte(e){return Array.isArray(e)?uOe(e.map(t=>Bte(t))):dOe(e)}function uOe(e){let t=e.reduce((o,s)=>o+s.length,0),r=kte(t);return{length:t<=55?1+t:1+r+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+r),r===1?o.pushUint8(t):r===2?o.pushUint16(t):r===3?o.pushUint24(t):o.pushUint32(t));for(let{encode:s}of e)s(o)}}}function dOe(e){let t=typeof e=="string"?zt(e):e,r=kte(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+r),r===1?o.pushUint8(t.length):r===2?o.pushUint16(t.length):r===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function kte(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new K("Length is too large.")}var X8=h(()=>{ut();nw();Sr();Fe()});function Dte(e){let{chainId:t,nonce:r,to:n}=e,o=e.contractAddress??e.address,s=Ht(ur(["0x05",Ws([t?re(t):"0x",o,r?re(r):"0x"])]));return n==="bytes"?zt(s):s}var Ute=h(()=>{Nn();Sr();Fe();X8();fi()});async function Zh(e){let{authorization:t,signature:r}=e;return qs({hash:Dte(t),signature:r??t})}var e4=h(()=>{Kh();Ute()});var Iw,uD=h(()=>{z8();$1();ut();es();Iw=class extends K{constructor(t,{account:r,docsPath:n,chain:o,data:s,gas:i,gasPrice:a,maxFeePerGas:c,maxPriorityFeePerGas:l,nonce:u,to:d,value:p}){let f=V1({from:r?.address,to:d,value:typeof p<"u"&&`${wh(p)} ${o?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:i,gasPrice:typeof a<"u"&&`${vn(a)} gwei`,maxFeePerGas:typeof c<"u"&&`${vn(c)} gwei`,maxPriorityFeePerGas:typeof l<"u"&&`${vn(l)} gwei`,nonce:u});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",f].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}});var da,yi,Gh,Yh,Jh,Qh,Xh,e0,t0,r0,Ka,wi,Wl=h(()=>{$1();ut();da=class extends K{constructor({cause:t,message:r}={}){let n=r?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}};Object.defineProperty(da,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(da,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});yi=class extends K{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${vn(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}};Object.defineProperty(yi,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});Gh=class extends K{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${vn(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}};Object.defineProperty(Gh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});Yh=class extends K{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}};Object.defineProperty(Yh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});Jh=class extends K{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
57`),{cause:t,name:"NonceTooLowError"})}};Object.defineProperty(Jh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});Qh=class extends K{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}};Object.defineProperty(Qh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});Xh=class extends K{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
58`),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}};Object.defineProperty(Xh,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});e0=class extends K{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}};Object.defineProperty(e0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});t0=class extends K{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}};Object.defineProperty(t0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});r0=class extends K{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}};Object.defineProperty(r0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});Ka=class extends K{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${vn(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${vn(n)} gwei`:""}).`].join(`
59`),{cause:t,name:"TipAboveFeeCapError"})}};Object.defineProperty(Ka,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});wi=class extends K{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}});function n0(e,t){let r=(e.details||"").toLowerCase(),n=e instanceof K?e.walk(o=>o?.code===da.code):e;return n instanceof K?new da({cause:e,message:n.details}):da.nodeMessage.test(r)?new da({cause:e,message:e.details}):yi.nodeMessage.test(r)?new yi({cause:e,maxFeePerGas:t?.maxFeePerGas}):Gh.nodeMessage.test(r)?new Gh({cause:e,maxFeePerGas:t?.maxFeePerGas}):Yh.nodeMessage.test(r)?new Yh({cause:e,nonce:t?.nonce}):Jh.nodeMessage.test(r)?new Jh({cause:e,nonce:t?.nonce}):Qh.nodeMessage.test(r)?new Qh({cause:e,nonce:t?.nonce}):Xh.nodeMessage.test(r)?new Xh({cause:e}):e0.nodeMessage.test(r)?new e0({cause:e,gas:t?.gas}):t0.nodeMessage.test(r)?new t0({cause:e,gas:t?.gas}):r0.nodeMessage.test(r)?new r0({cause:e}):Ka.nodeMessage.test(r)?new Ka({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new wi({cause:e})}var t4=h(()=>{ut();Wl()});function Lte(e,{docsPath:t,...r}){let n=(()=>{let o=n0(e,r);return o instanceof wi?e:o})();return new Iw(n,{docsPath:t,...r})}var Mte=h(()=>{uD();Wl();t4()});function bi(e,{format:t}){if(!t)return{};let r={};function n(s){let i=Object.keys(s);for(let a of i)a in e&&(r[a]=e[a]),s[a]&&typeof s[a]=="object"&&!Array.isArray(s[a])&&n(s[a])}let o=t(e||{});return n(o),r}var o0=h(()=>{});function s0(e,t){return({exclude:r,format:n})=>({exclude:r,format:(o,s)=>{let i=t(o,s);if(r)for(let a of r)delete i[a];return{...i,...n(o,s)}},type:e})}var r4=h(()=>{});function An(e,t){let r={};return typeof e.authorizationList<"u"&&(r.authorizationList=pOe(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="str
59ing"?r.blobs=e.blobs.map(n=>ft(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),e.account&&(r.from=e.account.address),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=re(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=re(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=re(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=re(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=re(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=re(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=dD[e.type]),typeof e.value<"u"&&(r.value=re(e.value)),r}function pOe(e){return e.map(t=>({address:t.address,r:t.r?re(BigInt(t.r)):t.r,s:t.s?re(BigInt(t.s)):t.s,chainId:re(t.chainId),nonce:re(t.nonce),...typeof t.yParity<"u"?{yParity:re(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:re(t.v)}:{}}))}var dD,Hte,Hc=h(()=>{Fe();r4();dD={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};Hte=s0("transactionRequest",An)});function $te(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new _8({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new _8({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function fOe(e){let{balance:t,nonce:r,state:n,stateDiff:o,code:s}=e,i={};if(s!==void 0&&(i.code=s),t!==void 0&&(i.balance=re(t)),r!==void 0&&(i.nonce=re(r)),n!==void 0&&(i.state=$te(n)),o!==void 0){if(i.state)throw new lw;i.stateDiff=$te(o)}return i}function Tw(e){if(!e)return;let t={};for(let{address:r,...n}of e){if(!Dt(r,{strict:!1}))throw new mr({address:r});if(t[r])throw new cw({address:r});t[r]=fOe(n)}return t}var kS=h(()=>{Va();P8();AS();Hs();Fe()});var Fte,Vte,zte,jte,qte,Wte,Kte,Zte,Gte,Yte,Jte,Qte,Xte,ere,tre,rre,nre,ore,sre,ire,are,cre,lre,ure,dre,pre,fre,hre,mre,gre,yre,wre,bre,xre,vre,Ere,Are,Cre,Sre,Ire,Tre,_re,Pre,Nre,Rre,Ore,Bre,kre,Dre,Ure,Lre,Mre,Hre,$re,Fre,Vre,zre,jre,qre,Wre,Kre,Zre,Gre,Yre,Jre,Qre,Xre,ene,tne,rne,nne,one,sne,ine,ane,cne,lne,une,dne,pne,fne,hne,mne,gne,yne,wne,bne,xne,vne,Ene,Ane,Cne,Sne,Ine,Tne,i0,DS=h(()=>{Fte=2n**(8n-1n)-1n,Vte=2n**(16n-1n)-1n,zte=2n**(24n-1n)-1n,jte=2n**(32n-1n)-1n,qte=2n**(40n-1n)-1n,Wte=2n**(48n-1n)-1n,Kte=2n**(56n-1n)-1n,Zte=2n**(64n-1n)-1n,Gte=2n**(72n-1n)-1n,Yte=2n**(80n-1n)-1n,Jte=2n**(88n-1n)-1n,Qte=2n**(96n-1n)-1n,Xte=2n**(104n-1n)-1n,ere=2n**(112n-1n)-1n,tre=2n**(120n-1n)-1n,rre=2n**(128n-1n)-1n,nre=2n**(136n-1n)-1n,ore=2n**(144n-1n)-1n,sre=2n**(152n-1n)-1n,ire=2n**(160n-1n)-1n,are=2n**(168n-1n)-1n,cre=2n**(176n-1n)-1n,lre=2n**(184n-1n)-1n,ure=2n**(192n-1n)-1n,dre=2n**(200n-1n)-1n,pre=2n**(208n-1n)-1n,fre=2n**(216n-1n)-1n,hre=2n**(224n-1n)-1n,mre=2n**(232n-1n)-1n,gre=2n**(240n-1n)-1n,yre=2n**(248n-1n)-1n,wre=2n**(256n-1n)-1n,bre=-(2n**(8n-1n)),xre=-(2n**(16n-1n)),vre=-(2n**(24n-1n)),Ere=-(2n**(32n-1n)),Are=-(2n**(40n-1n)),Cre=-(2n**(48n-1n)),Sre=-(2n**(56n-1n)),Ire=-(2n**(64n-1n)),Tre=-(2n**(72n-1n)),_re=-(2n**(80n-1n)),Pre=-(2n**(88n-1n)),Nre=-(2n**(96n-1n)),Rre=-(2n**(104n-1n)),Ore=-(2n**(112n-1n)),Bre=-(2n**(120n-1n)),kre=-(2n**(128n-1n)),Dre=-(2n**(136n-1n)),Ure=-(2n**(144n-1n)),Lre=-(2n**(152n-1n)),Mre=-(2n**(160n-1n)),Hre=-(2n**(168n-1n)),$re=-(2n**(176n-1n)),Fre=-(2n**(184n-1n)),Vre=-(2n**(192n-1n)),zre=-(2n**(200n-1n)),jre=-(2n**(208n-1n)),qre=-(2n**(216n-1n)),Wre=-(2n**(224n-1n)),Kre=-(2n**(232n-1n)),Zre=-(2n**(240n-1n)),Gre=-(2n**(248n-1n)),Yre=-(2n**(256n-1n)),Jre=2n**8n-1n,Qre=2n**16n-1n,Xre=2n**24n-1n,ene=2n**32n-1n,tne=2n**40n-1n,rne=2n**48n-1n,nne=2n**56n-1n,one=2n**64n-1n,sne=2n**72n-1n,ine=2n**80n-1n,ane=2n**88n-1n,cne=2n**96n-1n,lne=2n**104n-1n,une=2n**112n-1n,dne=2n**120n-1n,pne=2n**128n-1n,fne=2n**136n-1n,hne=2n**144n-1n,mne=2n**152n-1n,gne=2n**160n-1n,yne=2n**168n-1n,wne=2n**176n-1n,bne=2n**184n-1n,xne=2n**192n-1n,vne=2n**200n-1n,Ene=2n**208n-1n,Ane=2n**216n-1n,Cne=2n**224n-1n,Sne=2n**232n-1n,Ine=2n**240n-1n,Tne=2n**248n-1n,i0=2n**256n-1n});function On(e){let{account:t,maxFeePerGas:r,maxPriorityFeePerGas:n,to:o}=e,s=t?ct(t):void 0;if(s&&!Dt(s.address))throw new mr({address:s.address});if(o&&!Dt(o))throw new mr({address:o});if(r&&r>i0)throw new yi({maxFeePerGas:r});if(n&&r&&n>r)throw new Ka({maxFeePerGas:r,maxPriorityFeePerGas:n})}var $c=h(()=>{Wr();DS();Va();Wl();Hs()});var a0,Kl,_w,Pw=h(()=>{$1();ut();a0=class extends K{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}},Kl=class extends K{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}},_w=class extends K{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${vn(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}});var Zl,n4=h(()=>{ut();Zl=class extends K{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}});function Ap(e,t){let r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?ht(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?ht(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?o4[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(r.authorizationList=hOe(e.authorizationList)),r.yParity=(()=>
59{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}function hOe(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}var o4,_ne,Nw=h(()=>{tn();r4();o4={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};_ne=s0("transaction",Ap)});function G1(e,t){let r=(e.transactions??[]).map(n=>typeof n=="string"?n:Ap(n));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}var Pne,US=h(()=>{r4();Nw();Pne=s0("block",G1)});async function co(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:o}={}){let s=o??!1,i=r!==void 0?re(r):void 0,a=null;if(t?a=await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):a=await e.request({method:"eth_getBlockByNumber",params:[i||n,s]},{dedupe:!!i}),!a)throw new Zl({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||G1)(a,"getBlock")}var c0=h(()=>{n4();Fe();US()});async function Rw(e){let t=await e.request({method:"eth_gasPrice"});return BigInt(t)}var LS=h(()=>{});async function Nne(e,t){return pD(e,t)}async function pD(e,t){let{block:r,chain:n=e.chain,request:o}=t||{};try{let s=n?.fees?.maxPriorityFeePerGas??n?.fees?.defaultPriorityFee;if(typeof s=="function"){let a=r||await ue(e,co,"getBlock")({}),c=await s({block:a,client:e,request:o});if(c===null)throw new Error;return c}if(typeof s<"u")return s;let i=await e.request({method:"eth_maxPriorityFeePerGas"});return at(i)}catch{let[s,i]=await Promise.all([r?Promise.resolve(r):ue(e,co,"getBlock")({}),ue(e,Rw,"getGasPrice")({})]);if(typeof s.baseFeePerGas!="bigint")throw new Kl;let a=i-s.baseFeePerGas;return a<0n?0n:a}}var fD=h(()=>{Pw();tn();Mt();c0();LS()});async function Rne(e,t){return MS(e,t)}async function MS(e,t){let{block:r,chain:n=e.chain,request:o,type:s="eip1559"}=t||{},i=await(async()=>typeof n?.fees?.baseFeeMultiplier=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:o}):n?.fees?.baseFeeMultiplier??1.2)();if(i<1)throw new a0;let c=10**(i.toString().split(".")[1]?.length??0),l=p=>p*BigInt(Math.ceil(i*c))/BigInt(c),u=r||await ue(e,co,"getBlock")({});if(typeof n?.fees?.estimateFeesPerGas=="function"){let p=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:l,request:o,type:s});if(p!==null)return p}if(s==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new Kl;let p=typeof o?.maxPriorityFeePerGas=="bigint"?o.maxPriorityFeePerGas:await pD(e,{block:u,chain:n,request:o}),f=l(u.baseFeePerGas);return{maxFeePerGas:o?.maxFeePerGas??f+p,maxPriorityFeePerGas:p}}return{gasPrice:o?.gasPrice??l(await ue(e,Rw,"getGasPrice")({}))}}var hD=h(()=>{Pw();Mt();fD();c0();LS()});function pa(e){let{blockHash:t,blockNumber:r,blockTag:n,requireCanonical:o}=e;if(o!==void 0&&!t)throw new K("`requireCanonical` can only be provided when `blockHash` is set.");return t?o?{blockHash:t,requireCanonical:o}:{blockHash:t}:typeof r=="bigint"?re(r):n??"latest"}var Y1=h(()=>{ut();Fe()});async function l0(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:s}){let i=pa({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s}),a=await e.request({method:"eth_getTransactionCount",params:[t,i]},{dedupe:typeof n=="bigint"||r!==void 0});return ht(a)}var s4=h(()=>{Y1();tn()});function u0(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(s=>zt(s)):e.blobs,o=[];for(let s of n)o.push(Uint8Array.from(t.blobToKzgCommitment(s)));return r==="bytes"?o:o.map(s=>ft(s))}var i4=h(()=>{Sr();Fe()});function d0(e){let{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(i=>zt(i)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(i=>zt(i)):e.commitments,s=[];for(let i=0;i<n.length;i++){let a=n[i],c=o[i];s.push(Uint8Array.from(t.computeBlobKzgProof(a,c)))}return r==="bytes"?s:s.map(i=>ft(i))}var a4=h(()=>{Sr();Fe()});
59var One,Bne=h(()=>{Dk();One=j1});function HS(e,t){let r=t||"hex",n=One(Ve(e,{strict:!1})?rn(e):e);return r==="bytes"?n:vr(n)}var mD=h(()=>{Bne();Us();Sr();Fe()});function Ow(e){let{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),o=HS(t,"bytes");return o.set([r],0),n==="bytes"?o:ft(o)}var $S=h(()=>{Fe();mD()});function Bw(e){let{commitments:t,version:r}=e,n=e.to??(typeof t[0]=="string"?"hex":"bytes"),o=[];for(let s of t)o.push(Ow({commitment:s,to:n,version:r}));return o}var FS=h(()=>{$S()});var VS,kw,zS,jS,gD=h(()=>{ut();VS=class extends K{constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}},kw=class extends K{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}},zS=class extends K{constructor({hash:t,size:r}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}},jS=class extends K{constructor({hash:t,version:r}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${1}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}});function qS(e){let t=e.to??(typeof e.data=="string"?"hex":"bytes"),r=typeof e.data=="string"?zt(e.data):e.data,n=yt(r);if(!n)throw new kw;if(n>761855)throw new VS({maxSize:761855,size:n});let o=[],s=!0,i=0;for(;s;){let a=kc(new Uint8Array(131072)),c=0;for(;c<4096;){let l=r.slice(i,i+31);if(a.pushByte(0),a.pushBytes(l),l.length<31){a.pushByte(128),s=!1;break}c++,i+=31}o.push(a)}return t==="bytes"?o.map(a=>a.bytes):o.map(a=>ft(a.bytes))}var yD=h(()=>{gD();nw();Go();Sr();Fe()});function p0(e){let{data:t,kzg:r,to:n}=e,o=e.blobs??qS({data:t,to:n}),s=e.commitments??u0({blobs:o,kzg:r,to:n}),i=e.proofs??d0({blobs:o,commitments:s,kzg:r,to:n}),a=[];for(let c=0;c<o.length;c++)a.push({blob:o[c],commitment:s[c],proof:i[c]});return a}var c4=h(()=>{i4();a4();yD()});function Dw(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new dw({transaction:e})}var WS=h(()=>{es()});function f0(e,{docsPath:t,...r}){let n=(()=>{let o=n0(e,r);return o instanceof wi?e:o})();return new hw(n,{docsPath:t,...r})}var l4=h(()=>{Wl();es();t4()});async function lo(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return ht(t)}var Cp=h(()=>{tn()});async function Uw(e,t){let{account:r=e.account,accessList:n,authorizationList:o,chain:s=e.chain,blobVersionedHashes:i,blobs:a,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:m,nonceManager:g,to:y,type:b,value:C,...w}=t,x=await(async()=>{if(!r||!g||typeof m<"u")return m;let U=ct(r),N=s?s.id:await ue(e,lo,"getChainId")({});return await g.consume({address:U.address,chainId:N,client:e})})();On(t);let S=s?.formatters?.transactionRequest?.format,D=(S||An)({...bi(w,{format:S}),account:r?ct(r):void 0,accessList:n,authorizationList:o,blobs:a,blobVersionedHashes:i,data:c,gas:l,gasPrice:u,maxFeePerBlobGas:d,maxFeePerGas:p,maxPriorityFeePerGas:f,nonce:x,to:y,type:b,value:C},"fillTransaction");try{let U=await e.request({method:"eth_fillTransaction",params:[D]}),L=(s?.formatters?.transaction?.format||Ap)(U.tx);delete L.blockHash,delete L.blockNumber,delete L.r,delete L.s,delete L.transactionIndex,delete L.v,delete L.yParity,L.data=L.input,L.gas&&(L.gas=t.gas??L.gas),L.gasPrice&&(L.gasPrice=t.gasPrice??L.gasPrice),L.maxFeePerBlobGas&&(L.maxFeePerBlobGas=t.maxFeePerBlobGas??L.maxFeePerBlobGas),L.maxFeePerGas&&(L.maxFeePerGas=t.maxFeePerGas??L.maxFeePerGas),L.maxPriorityFeePerGas&&(L.maxPriorityFeePerGas=t.maxPriorityFeePerGas??L.maxPriorityFeePerGas),typeof L.nonce<"u"&&(L.nonce=t.nonce??L.nonce);let I=await(async()=>{if(typeof s?.fees?.baseFeeMultiplier=="function"){let v=await ue(e,co,"getBlock")({});return s.fees.baseFeeMultiplier({block:v,client:e,request:t})}return s?.fees?.baseFeeMultiplier??1.2})();if(I<1)throw new a0;let A=10**(I.toString().split(".")[1]?.length??0),T=v=>v*BigInt(Math.ceil(I*A))/BigInt(A);return L.feePayerSignature||(L.maxFeePerGas&&!t.maxFeePerGas&&(L.maxFeePerGas=T(L.maxFeePerGas)),L.gasPrice&&!t.gasPrice&&(L.gasPrice=T(L.gasPrice))),{raw:U.raw,transaction:{from:D.from,...L},...U.capabilities?{capabilities:U.capabilities}:{}}}catch(U){throw f0(U,{...t,chain:e.chain})}}var KS=h(()=>{Wr();Pw();l4();o0();Nw();Hc();Mt();$c();c0();Cp()});async function Gl(e,t){let r=t;r.account??=e.account,r.parameters??=u4;let{account:n,chain:o=e.chain,nonceManager:s,parameters:i}=r,a=(()=>
59{if(typeof o?.prepareTransactionRequest=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o?.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})(),c;async function l(){return c||(typeof r.chainId<"u"?r.chainId:o?o.id:(c=await ue(e,lo,"getChainId")({}),c))}let u=n&&ct(n),d=r.nonce;if(i.includes("nonce")&&typeof d>"u"&&u&&s){let x=await l();d=await s.consume({address:u.address,chainId:x,client:e})}a?.fn&&a.runAt?.includes("beforeFillTransaction")&&(r=await a.fn({...r,chain:o},{client:e,phase:"beforeFillTransaction"}),d??=r.nonce);let f=((i.includes("blobVersionedHashes")||i.includes("sidecars"))&&r.kzg&&r.blobs||wD.get(e.uid)===!1||!["fees","gas"].some(S=>i.includes(S))?!1:!!(i.includes("chainId")&&typeof r.chainId!="number"||i.includes("nonce")&&typeof d!="number"||i.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||i.includes("gas")&&typeof r.gas!="bigint"))?await ue(e,Uw,"fillTransaction")({...r,nonce:d}).then(x=>{let{chainId:S,from:P,gas:D,gasPrice:U,nonce:N,maxFeePerBlobGas:L,maxFeePerGas:I,maxPriorityFeePerGas:R,type:A,...T}=x.transaction,v="feeToken"in T?T.feeToken:void 0,E="feePayerSignature"in T&&T.feePayerSignature!==null&&typeof T.feePayerSignature<"u",O=typeof v<"u"&&v!==null&&(!("feeToken"in r)||E);return wD.set(e.uid,!0),{...r,...P?{from:P}:{},...A&&!r.type?{type:A}:{},...typeof S<"u"?{chainId:S}:{},...typeof D<"u"?{gas:D}:{},...typeof U<"u"?{gasPrice:U}:{},...typeof N<"u"?{nonce:N}:{},...typeof L<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerBlobGas:L}:{},...typeof I<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxFeePerGas:I}:{},...typeof R<"u"&&r.type!=="legacy"&&r.type!=="eip2930"?{maxPriorityFeePerGas:R}:{}
59,..."nonceKey"in T&&typeof T.nonceKey<"u"?{nonceKey:T.nonceKey}:{},..."keyAuthorization"in T&&typeof T.keyAuthorization<"u"&&T.keyAuthorization!==null&&!("keyAuthorization"in r)?{keyAuthorization:T.keyAuthorization}:{},..."feePayerSignature"in T&&typeof T.feePayerSignature<"u"&&T.feePayerSignature!==null?{feePayerSignature:T.feePayerSignature}:{},...O?{feeToken:v}:{},...x.capabilities?{_capabilities:x.capabilities}:{}}}).catch(x=>{let S=x;if(S.name!=="TransactionExecutionError")return r;if(S.walk?.(U=>U.name==="ExecutionRevertedError"))throw x;return S.walk?.(U=>{let N=U;return N.name==="MethodNotFoundRpcError"||N.name==="MethodNotSupportedRpcError"||N.message?.includes("eth_fillTransaction is not available")})&&wD.set(e.uid,!1),r}):r;d??=f.nonce,r={...f,...u?{from:u?.address}:{},...typeof d<"u"?{nonce:d}:{}};let{blobs:m,gas:g,kzg:y,type:b}=r;a?.fn&&a.runAt?.includes("beforeFillParameters")&&(r=await a.fn({...r,chain:o},{client:e,phase:"beforeFillParameters"}));let C;async function w(){return C||(C=await ue(e,co,"getBlock")({blockTag:"latest"}),C)}if(i.includes("nonce")&&typeof d>"u"&&u&&!s&&(r.nonce=await ue(e,l0,"getTransactionCount")({address:u.address,blockTag:"pending"})),(i.includes("blobVersionedHashes")||i.includes("sidecars"))&&m&&y){let x=u0({blobs:m,kzg:y});if(i.includes("blobVersionedHashes")){let S=Bw({commitments:x,to:"hex"});r.blobVersionedHashes=S}if(i.includes("sidecars")){let S=d0({blobs:m,commitments:x,kzg:y}),P=p0({blobs:m,commitments:x,proofs:S,to:"hex"});r.sidecars=P}}if(i.includes("chainId")&&(r.chainId=await l()),(i.includes("fees")||i.includes("type"))&&typeof b>"u")try{r.type=Dw(r)}catch{let x=kne.get(e.uid);typeof x>"u"&&(x=typeof(await w())?.baseFeePerGas=="bigint",kne.set(e.uid,x)),r.type=x?"eip1559":"legacy"}if(i.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){let x=await w(),{maxFeePerGas:S,maxPriorityFeePerGas:P}=await MS(e,{block:x,chain:o,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas<P)throw new _w({maxPriorityFeePerGas:P});r.maxPriorityFeePerGas=P,r.maxFeePerGas=S}}else{if(typeof r.maxFeePerGas<"u"||typeof r.maxPriorityFeePerGas<"u")throw new Kl;if(typeof r.gasPrice>"u"){let x=await w(),{gasPrice:S}=await MS(e,{block:x,chain:o,request:r,type:"legacy"});r.gasPrice=S}}return i.includes("gas")&&typeof g>"u"&&(r.gas=await ue(e,Mw,"estimateGas")({...r,account:u,prepare:u?.type==="local"?[]:["blobVersionedHashes"]})),a?.fn&&a.runAt?.includes("afterFillParameters")&&(r=await a.fn({...r,chain:o},{client:e,phase:"afterFillParameters"})),On(r),delete r.parameters,r}var u4,kne,wD,Lw=h(()=>{Wr();hD();ZS();c0();s4();Pw();i4();a4();FS();c4();Mt();hh();$c();WS();KS();Cp();u4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],kne=new Map,wD=new Jo(128)});async function Mw(e,t){let{account:r=e.account,prepare:n=!0}=t,o=r?ct(r):void 0,s=(()=>{if(Array.isArray(n))return n;if(o?.type!=="local")return["blobVersionedHashes"]})();try{let i=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await Zh({authorization:t.authorizationList[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:u,blockNumber:d,blockTag:p,data:f,gas:m,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:C,nonce:w,value:x,stateOverride:S,...P}=n?await Gl(e,{...t,parameters:s,to:i}):t;if(m&&t.gas!==m)return m;let U=(typeof d=="bigint"?re(d):void 0)||p,N=Tw(S);On(t);let L=e.chain?.formatters?.transactionRequest?.format,R=(L||An)({...bi(P,{format:L}),account:o,accessList:a,authorizationList:c,blobs:l,blobVersionedHashes:u,data:f,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:b,maxPriorityFeePerGas:C,nonce:w,to:i,value:x},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:N?[R,U??e.experimental_blockTag??"latest",N]:U?[R,U]:[R]}))}catch(i){throw Lte(i,{...t,account:o,chain:e.chain})}}var ZS=h(()=>{Wr();ut();e4();Fe();Mte();o0();Hc();kS();$c();Lw()});async function h0(e,t){let{abi:r,address:n,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:e.dataSuffix?.value,...a}=t,c=jt({abi:r,args:o,functionName:s});try{return await ue(e,Mw,"estimateGas")({data:`${c}${i?i.replace("0x",""):""}`,to:n,...a})}catch(l){let u=a.account?ct(a.account):void 0;throw Fs(l,{abi:r,address:n,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:s,sender:u?.address})}}var d4=h(()=>{Wr();Io();Vh();Mt();ZS()});function Or(e,t){if(!Dt(e,{strict:!1}))throw new mr({address:e});if(!Dt(t,{strict:!1}))throw new mr({address:t});return e.toLowerCase()===t.toLowerCase()}var fa=h(()=>{Va();Hs()});function Bn(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}var Yl=h(()=>{});function Sp(e){let{abi:t,data:r,strict:n,topics:o}=e,s=n??!0,[i,...a]=o;if(!i)throw new Uy({docsPath:Dne});let c=t.find(b=>b.type==="event"&&i===Rc(Wn(b)));if(!(c&&"name"in c)||c.type!=="event")throw new Ly(i,{docsPath:Dne});let{name:l,inputs:u}=c,d=u?.some(b=>!("name"in b&&b.name)),p=d?[]:{},f=u.map((b,C)=>[b,C]).filter(([b])=>"indexed"in b&&b.indexed),m=[];for(let b=0;b<f.length;b++){let[C,w]=f[b],x=a[b];if(!x){if(s)throw new kl({abiItem:c,param:C}
59);m.push([C,w]);continue}p[d?w:C.name||w]=yOe({param:C,value:x})}let g=u.filter(b=>!("indexed"in b&&b.indexed)),y=s?g:[...m.map(([b])=>b),...g];if(y.length>0){if(r&&r!=="0x")try{let b=$s(y,r);if(b){let C=0;if(!s)for(let[w,x]of m)p[d?x:w.name||x]=b[C++];if(d)for(let w=0;w<u.length;w++)p[w]===void 0&&C<b.length&&(p[w]=b[C++]);else for(let w=0;w<g.length;w++)p[g[w].name]=b[C++]}}catch(b){if(s)throw b instanceof ih||b instanceof rw?new Pc({abiItem:c,data:r,params:y,size:yt(r)}):b}else if(s)throw new Pc({abiItem:c,data:"0x",params:y,size:0})}return{eventName:l,args:Object.values(p).length>0?p:void 0}}function yOe({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:($s([e],t)||[])[0]}var Dne,p4=h(()=>{zr();_k();Go();Qy();gh();np();Dne="/docs/contract/decodeEventLog"});function Za(e){let{abi:t,args:r,logs:n,strict:o=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),i=t.filter(a=>a.type==="event").map(a=>({abi:a,selector:Rc(a)}));return n.map(a=>{let c=typeof a.blockNumber=="string"?Bn(a):a,l=i.filter(p=>c.topics[0]===p.selector);if(l.length===0)return null;let u,d;for(let p of l)try{u=Sp({...c,abi:[p.abi],strict:!0}),d=p;break}catch{}if(!u&&!o){d=l[0];try{u=Sp({data:c.data,topics:c.topics,abi:[d.abi],strict:!1})}catch{let p=d.abi.inputs?.some(f=>!("name"in f&&f.name));return{...c,args:p?[]:{},eventName:d.abi.name}}}return!u||!d||s&&!s.includes(u.eventName)||!wOe({args:u.args,inputs:d.abi.inputs,matchArgs:r})?null:{...u,...c}}).filter(Boolean)}function wOe(e){let{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function o(s,i,a){try{return s.type==="address"?Or(i,a):s.type==="string"||s.type==="bytes"?Ht(rn(i))===a:i===a}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((s,i)=>{if(s==null)return!0;let a=r[i];return a?(Array.isArray(s)?s:[s]).some(l=>o(a,l,t[i])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([s,i])=>{if(i==null)return!0;let a=r.find(l=>
59l.name===s);return a?(Array.isArray(i)?i:[i]).some(l=>o(a,l,t[s])):!1}):!1}var J1=h(()=>{fa();Sr();Yl();fi();Qy();p4()});async function Hw(e,{address:t,blockHash:r,fromBlock:n,toBlock:o,event:s,events:i,args:a,strict:c}={}){let l=c??!1,u=i??(s?[s]:void 0),d=[];u&&(d=[u.flatMap(g=>za({abi:[g],eventName:g.name,args:i?void 0:a}))],s&&(d=d[0]));let p;r?p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):p=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof n=="bigint"?re(n):n,toBlock:typeof o=="bigint"?re(o):o}]});let f=p.map(m=>Bn(m));return u?Za({abi:u,args:a,logs:f,strict:l}):f}var GS=h(()=>{M1();J1();Fe();Yl()});async function $w(e,t){let{abi:r,address:n,args:o,blockHash:s,eventName:i,fromBlock:a,toBlock:c,strict:l}=t,u=i?Qo({abi:r,name:i}):void 0,d=u?void 0:r.filter(p=>p.type==="event");return ue(e,Hw,"getLogs")({address:n,args:o,blockHash:s,event:u,events:d,fromBlock:a,toBlock:c,strict:l})}var YS=h(()=>{up();Mt();GS()});function kn(e){let{abi:t,args:r,functionName:n,data:o}=e,s=t[0];if(n){let a=Qo({abi:t,args:r,name:n});if(!a)throw new oa(n,{docsPath:bD});s=a}if(s.type!=="function")throw new oa(void 0,{docsPath:bD});if(!s.outputs)throw new lh(s.name,{docsPath:bD});let i=$s(s.outputs,o);if(i&&i.length>1)return i;if(i&&i.length===1)return i[0]}var bD,Fc=h(()=>{zr();gh();up();bD="/docs/contract/decodeFunctionResult"});var Une,Lne=h(()=>{Une="0.1.1"});function Mne(){return Une}var Hne=h(()=>{Lne()});function $ne(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?$ne(e.cause,t):t?null:e}var ze,xi=h(()=>{Hne();ze=class e extends Error{static setStaticOptions(t){e.prototype.docsOrigin=t.docsOrigin,e.prototype.showVersion=t.showVersion,e.prototype.version=t.version}constructor(t,r={}){let n=(()=>{if(r.cause instanceof e){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,s=r.docsOrigin??e.prototype.docsOrigin,i=`${s}${o??""}`,a=!!(r.version??e.prototype.showVersion),c=r.version??e.prototype.version,l=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||o||a?["",n?`Details: ${n}`:void 0,o?`See: ${i}`:void 0,a?`Version: ${c}`:void 0]:[]].filter(u=>typeof u=="string").join(`
60`);super(l,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=i,this.docsOrigin=s,this.docsPath=o,this.shortMessage=t,this.showVersion=a,this.version=c}walk(t){return $ne(this,t)}};Object.defineProperty(ze,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${Mne()}`}});ze.setStaticOptions(ze.defaultStaticOptions)});function Fw(e,t){if(Ga(e)>t)throw new JS({givenSize:Ga(e),maxSize:t})}function Fne(e,t){if(typeof t=="number"&&t>0&&t>Ga(e)-1)throw new f4({offset:t,position:"start",size:Ga(e)})}function Vne(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Ga(e)!==r-t)throw new f4({offset:r,position:"end",size:Ga(e)})}function xD(e){if(e>=Ip.zero&&e<=Ip.nine)return e-Ip.zero;if(e>=Ip.A&&e<=Ip.F)return e-(Ip.A-10);if(e>=Ip.a&&e<=Ip.f)return e-(Ip.a-10)}function zne(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new QS({size:e.length,targetSize:n,type:"Bytes"});let o=new Uint8Array(n);for(let s=0;s<n;s++){let i=r==="right";o[i?s:n-s-1]=e[i?s:e.length-s-1]}return o}function vD(e,t={}){let{dir:r="left"}=t,n=e,o=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=r==="left"?n.slice(o):n.slice(0,n.length-o),n}var Ip,jne=h(()=>{m0();Ip={zero:48,nine:57,A:65,F:70,a:97,f:102}}
60);function Vw(e,t){if(Kr(e)>t)throw new XS({givenSize:Kr(e),maxSize:t})}function qne(e,t){if(typeof t=="number"&&t>0&&t>Kr(e)-1)throw new h4({offset:t,position:"start",size:Kr(e)})}function Wne(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Kr(e)!==r-t)throw new h4({offset:r,position:"end",size:Kr(e)})}function ED(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;let o=e.replace("0x","");if(o.length>n*2)throw new eI({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function Kne(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),o=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=r==="left"?n.slice(o):n.slice(0,n.length-o),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}var AD=h(()=>{uo()});function g0(e,t,r){return JSON.stringify(e,(n,o)=>typeof t=="function"?t(n,o):typeof o=="bigint"?o.toString()+xOe:o,r)}var xOe,m4=h(()=>{xOe="#__bigint"});function AOe(e){if(!(e instanceof Uint8Array)){if(!e)throw new zw(e);if(typeof e!="object")throw new zw(e);if(!("BYTES_PER_ELEMENT"in e))throw new zw(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new zw(e)}}function Gne(e){return e instanceof Uint8Array?e:typeof e=="string"?jw(e):COe(e)}function COe(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function jw(e,t={}){let{size:r}=t,n=e;r&&(Vw(e,r),n=Ql(e,r));let o=n.slice(2);o.length%2&&(o=`0${o}`);let s=o.length/2,i=new Uint8Array(s);for(let a=0,c=0;a<s;a++){let l=xD(o.charCodeAt(c++)),u=xD(o.charCodeAt(c++));if(l===void 0||u===void 0)throw new ze(`Invalid byte sequence ("${o[c-2]}${o[c-1]}" in "${o}").`);i[a]=l<<4|u}return i}function Yne(e,t={}){let{size:r}=t,n=EOe.encode(e);return typeof r=="number"?(Fw(n,r),SOe(n,r)):n}function SOe(e,t){return zne(e,{dir:"right",size:t})}function Ga(e){return e.length}function Jne(e,t,r,n={}){let{strict:o}=n;Fne(e,t);let s=e.slice(t,r);return o&&Vne(s,t,r),s}function Qne(e,t={}){let{size:r}=t;typeof r<"u"&&Fw(e,r);let n=Cn(e,t);return ID(n,t)}function Xne(e,t={}){let{size:r}=t,n=e;if(typeof r<"u"&&(Fw(n,r),n=SD(n)),n.length>1||n[0]>1)throw new CD(n);return!!n[0]}function Jl(e,t={}){let{size:r}=t;typeof r<"u"&&Fw(e,r);let n=Cn(e,t);return rI(n,t)}function eoe(e,t={}){let{size:r}=t,n=e;return typeof r<"u"&&(Fw(n,r),n=IOe(n)),vOe.decode(n)}function SD(e){return vD(e,{dir:"left"})}function IOe(e){return vD(e,{dir:"right"})}function toe(e){try{return AOe(e),!0}catch{return!1}}var vOe,EOe,CD,zw,JS,f4,QS,m0=h(()=>{xi();uo();jne();AD();m4();vOe=new TextDecoder,EOe=new TextEncoder;CD=class extends ze{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}},zw=class extends ze{constructor(t){super(`Value \`${typeof t=="object"?g0(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}},JS=class extends ze{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},f4=class extends ze{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SliceOffsetOutOfBoundsError"})}},QS=class extends ze{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}});function POe(e,t={}){let{strict:r=!1}=t;if(!e)throw new nI(e);if(typeof e!="string")throw new nI(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new oI(e);if(!e.startsWith("0x"))throw new oI(e)}function on(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function qw(e){return e instanceof Uint8Array?Cn(e):Array.isArray(e)?Cn(new Uint8Array(e)):e}function sI(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Vw(r,t.size),Tp(r,t.size)):r}function Cn(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=_Oe[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(Vw(n,t.size),Ql(n,t.size)):n}function Qt(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let i=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<i){let l=typeof e=="bigint"?"n":"";throw new g4({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:r,size:n,value:`${e}${l}`})}let c=`0x${(r&&o<0?BigInt.asUintN(n*8,BigInt(o)):o).toString(16)}`;return n?Tp(c,n):c}function Ww(e,t={}){return Cn(TOe.encode(e),t)}function Tp(e,t){return ED(e,{dir:"left",size:t})}function Ql(e,t){return ED(e,{dir:"right",size:t})}function Zr(e,t,r,n={}){let{strict:o}=n;qne(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return o&&Wne(s,t,r),s}function Kr(e){return Math.ceil((e.length-2)/2)}function TD(e){return Kne(e,{dir:"left"})}function ID(e,t={}){let{signed:r}=t;t.size&&Vw(e,t.size);let n=BigInt(e);if(!r)return n;let o=(e.length-2)/2,s=(1n<<BigInt(o)*8n)-1n,i=s>>1n;return n<=i?n:n-s-1n}function rI(e,t={}){let{signed:r,size:n}=t;return Number(!r&&!n?e:ID(e,t))}function y4(e,t={}){let{strict:r=!1}=t;try{return POe(e,{strict:r}),!0}catch{return!1}}var TOe,_Oe,g4,nI,oI,XS,h4,eI,uo=h(()=>{xi();AD();m4();TOe=new TextEncoder,_Oe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));g4=class extends ze{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},nI=class extends ze{constructor(t){super(`Value \`${typeof t=="object"?g0(t):t}\` of type \`${typeof t}
60\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}},oI=class extends ze{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}},XS=class extends ze{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},h4=class extends ze{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},eI=class extends ze{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function roe(e){return{address:e.address,amount:Qt(e.amount),index:Qt(e.index),validatorIndex:Qt(e.validatorIndex)}}var noe=h(()=>{uo()});function iI(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Qt(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Qt(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Qt(e.gasLimit)},...typeof e.number=="bigint"&&{number:Qt(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Qt(e.prevRandao)},...typeof e.time=="bigint"&&{time:Qt(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(roe)}}}var _D=h(()=>{uo();noe()});var Ya,y0,soe,aI,ioe,PD,ND,RD,Kw,Br,aoe,coe,loe,uoe,po=h(()=>{Ya=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{name:"addr",type:"address"}],name:"getEthBalance",outputs:[{name:"balance",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],y0=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],soe=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],aI=[...soe,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],ioe=[...soe,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],PD=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],ND=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],RD=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],Kw=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}
vendor: 7,203 bytes, line 60
60],Br=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],aoe=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"bytes32"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],coe=[{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ERC1155InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC1155InvalidApprover",type:"error"},{inputs:[{internalType:"uint256",name:"idsLength",type:"uint256"},{internalType:"uint256",name:"valuesLength",type:"uint256"}],name:"ERC1155InvalidArrayLength",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"}],name:"ERC1155InvalidOperator",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC1155InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC1155InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC1155MissingApprovalForAll",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"values",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}
60],loe=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"event",name:"ApprovalForAll",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"operator",type:"address"},{indexed:!1,name:"approved",type:"bool"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!0,name:"tokenId",type:"uint256"}]},{type:"function",name:"approve",stateMutability:"payable",inputs:[{name:"spender",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"getApproved",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"address"}]},{type:"function",name:"isApprovedForAll",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"operator",type:"address"}],outputs:[{type:"bool"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"ownerOf",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"owner",type:"address"}]},{type:"function",name:"safeTransferFrom",stateMutability:"payable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]},{type:"function",name:"safeTransferFrom",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]},{type:"function",name:"setApprovalForAll",stateMutability:"nonpayable",inputs:[{name:"operator",type:"address"},{name:"approved",type:"bool"}],outputs:[]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"index",type:"uint256"}],outputs:[{type:"uint256"}]},{type:"function",name:"tokenByIndex",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"index",type:"uint256"}],outputs:[{name:"tokenId",type:"uint256"}]},{type:"function",name:"tokenURI",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transferFrom",stateMutability:"payable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],uoe=[{anonymous:!1,inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Deposit",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}],name:"Transfer",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"receiver",type:"address"},{indexed:!0,name:"owner",type:"address"},{indexed:!1,name:"assets",type:"uint256"},{indexed:!1,name:"shares",type:"uint256"}],name:"Withdraw",type:"event"},{inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],name:"allowance",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],name:"approve",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"asset",outputs:[{name:"assetTokenAddress",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"convertToAssets",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"convertToShares",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"}],name:"deposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxDeposit",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"caller",type:"address"}],name:"maxMint",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxRedeem",outputs:[{name:"maxShares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"owner",type:"address"}],name:"maxWithdraw",outputs:[{name:"maxAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"}],name:"mint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewDeposit",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewMint",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"}],name:"previewRedeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"assets",type:"uint256"}],name:"previewWithdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"shares",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"redeem",outputs:[{name:"assets",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"totalAssets",outputs:[{name:"totalManagedAssets",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transfer",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"assets",type:"uint256"},{name:"receiver",type:"address"},{name:"owner",type:"address"}],name:"withdraw",outputs:[{name:"shares",type:"uint256"}],stateMutability:"nonpayable",type:"function"}]});var doe,poe=h(()=>{doe="0x82ad56cb"});var Zw,cI,w4,Gw,Yw=h(()=>{Zw="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b
60602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",cI="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",w4="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
60603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Gw="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9
60150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033"});var _p,Jw,Qw,X1,Pp,Xw=h(()=>{ut();_p=class extends K{constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}},Jw=class extends K{constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} \u2013 ${t.name}).`,{metaMessages:[`Current Chain ID:  ${r}`,`Expected Chain ID: ${t.id} \u2013 ${t.name}`],name:"ChainMismatchError"})}},Qw=class extends K{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
61`),{name:"ChainNotFoundError"})}},X1=class extends K{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}},Pp=class extends K{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}
61" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}});function Np(e){let{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;let o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new sh({docsPath:OD});if(!("inputs"in o))throw new Bl({docsPath:OD});if(!o.inputs||o.inputs.length===0)throw new Bl({docsPath:OD});let s=Kn(o.inputs,r);return ur([n,s])}var OD,b4=h(()=>{zr();Nn();Bc();OD="/docs/contract/encodeDeployData"});function vi({blockNumber:e,chain:t,contract:r}){let n=t?.contracts?.[r];if(!n)throw new _p({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new _p({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}var w0=h(()=>{Xw()});function lI(e,{docsPath:t,...r}){let n=(()=>{let o=n0(e,r);return o instanceof wi?e:o})();return new vh(n,{docsPath:t,...r})}var BD=h(()=>{fp();Wl();t4()});function eb(){let e=()=>{},t=()=>{};return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}var uI=h(()=>{});function tb({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){let s=async()=>{let u=c();i();let d=u.map(({args:p})=>p);d.length!==0&&e(d).then(p=>{o&&Array.isArray(p)&&p.sort(o);for(let f=0;f<u.length;f++){let{resolve:m}=u[f];m?.([p[f],p])}}).catch(p=>{for(let f=0;f<u.length;f++){let{reject:m}=u[f];m?.(p)}})},i=()=>kD.delete(t),a=()=>c().map(({args:u})=>u),c=()=>kD.get(t)||[],l=u=>kD.set(t,[...c(),u]);return{flush:i,async schedule(u){let{promise:d,resolve:p,reject:f}=eb();return r?.([...a(),u])&&s(),c().length>0?(l({args:u,resolve:p,reject:f}),d):(l({args:u,resolve:p,reject:f}),setTimeout(s,n),d)}}}var kD,dI=h(()=>{uI();kD=new Map});var pI,fI,hI,foe=h(()=>{To();ut();Dc();pI=class extends K{constructor({callbackSelector:t,cause:r,data:n,extraData:o,sender:s,urls:i}){super(r.shortMessage||"An error occurred while fetching for an offchain result.",{cause:r,metaMessages:[...r.metaMessages||[],r.metaMessages?.length?"":[],"Offchain Gateway Call:",i&&["  Gateway URL(s):",...i.map(a=>`    ${dp(a)}`)],`  Sender: ${s}`,`  Data: ${n}`,`  Callback selector: ${t}`,`  Extra data: ${o}`].flat(),name:"OffchainLookupError"})}},fI=class extends K{constructor({result:t,url:r}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${dp(r)}`,`Response: ${St(t)}`],name:"OffchainLookupResponseMalformedError"})}},hI=class extends K{constructor({sender:t,to:r}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${r}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}});function mI(e){let{abi:t,data:r}=e,n=so(r,0,4),o=t.find(s=>s.type==="function"&&n===ca(Wn(s)));if(!o)throw new My(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?$s(o.inputs,so(r,4)):void 0}}var DD=h(()=>{zr();aa();L1();gh();np()});function x4(e){let{abi:t,errorName:r,args:n}=e,o=t[0];if(r){let c=Qo({abi:t,args:n,name:r});if(!c)throw new _1(r,{docsPath:UD});o=c}if(o.type!=="error")throw new _1(void 0,{docsPath:UD});let s=Wn(o),i=ca(s),a="0x";if(n&&n.length>0){if(!o.inputs)throw new Dy(o.name,{docsPath:UD});a=Kn(o.inputs,n)}return ur([i,a])}var UD,LD=h(()=>{zr();Nn();L1();Bc();np();up();UD="/docs/contract/encodeErrorResult"});function gI(e){let{abi:t,functionName:r,result:n}=e,o=t[0];if(r){let i=Qo({abi:t,name:r});if(!i)throw new oa(r,{docsPath:MD});o=i}if(o.type!=="function")throw new oa(void 0,{docsPath:MD});if(!o.outputs)throw new lh(o.name,{docsPath:MD});let s=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new dh(n)})();return Kn(o.outputs,s)}var MD,HD=h(()=>{zr();Bc();up();MD="/docs/contract/encodeFunctionResult"});async function $D(e){let{data:t,ccipRequest:r}=e,{args:[n]}=mI({abi:y0,data:t}),o=[],s=[];return await Promise.all(n.map(async(i,a)=>{try{s[a]=i.urls.includes(Vc)?await $D({data:i.data,ccipRequest:r}):await r(i),o[a]=!1}catch(c){o[a]=!0,s[a]=ROe(c)}})),gI({abi:y0,functionName:"query",result:[o,s]})}function ROe(e){return e.name==="HttpRequestError"&&e.status?x4({abi:y0,errorName:"HttpError",args:[e.status,e.shortMessage]}):x4({abi:[tw],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}var Vc,rb=h(()=>{po();U8();DD();LD();HD();Vc="x-batch-gateway:true"});var hoe={};Ce(hoe,{ccipRequest:()=>eg,offchainLookup:()=>VD,offchainLookupAbiItem:()=>yI,offchainLookupSignature:()=>FD});async function VD(e,{blockNumber:t,blockTag:r,data:n,requestOptions:o,to:s}){let{args:i}=yh({data:n,abi:[yI]}),[a,c,l,u,d]=i,{ccipRead:p}=e,f=p&&typeof p?.request=="function"?p.request:eg;try{if(!Or(s,a))throw new hI({sender:a,to:s});let m=c.includes(Vc)?await $D({data:l,ccipRequest:y=>f({...y,requestOptions:o})}):await f({data:l,requestOptions:o,sender:a,urls:c}),{data:g}=await Ja(e,{blockNumber:t,blockTag:r,data:nn([u,Kn([{type:"bytes"},{type:"bytes"}],[m,d])]),requestOptions:o,to:s});return g}catch(m){throw o?.signal?.aborted?_o(o.signal):hi(m)?m:new pI({callbackSelector:u,cause:m,data:n,extraData:d,sender:a,urls:c})}}async function eg({data:e,requestOptions:t,sender:r,urls:n}){let o=new Error("An unknown error occurred.");for(let s=0;s<n.length;s++){if(t?.signal?.aborted)throw _o(t.signal);let i=n[s],a=i.includes("{data}")?"GET":"POST",c=a==="POST"?{data:e,sender:r}:void 0,l=a==="POST"?{"Content-Type":"application/json"}:{};try{let u=await fetch(i.replace("{sender}",r.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:l,method:a,...t?.signal?{signal:t.signal}:{}}),d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){o=new ts({body:c,details:d?.error?St(d.error):u.statusText,headers:u.headers,status:u.status,url:i});continue}if(!Ve(d)){o=new fI({result:d,url:i});continue}return d}catch(u){if(t?.signal?.aborted)throw _o(t.signal);if(hi(u))throw u;o=new ts({body:c,details:u.message,url:i})}}throw o}var FD,yI,wI=h(()=>{tg();foe();Wa();Dc();V8();Bc();fa();Nn();Us();rb();To();FD="0x556f1830",yI={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]}});async function Ja(e,t){let{account:r=e.account,authorizationList:n,batch:o=!!e.batch?.multicall,blockHash:s,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,accessList:l,blobs:u,blockOverrides:d,code:p,data:f,factory:m,factoryData:g,gas:y,gasPrice:b,maxFeePerBlobGas:C,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:S,requestOptions:P,to:D,value:U,stateOverride:N,...L}=t,I=r?ct(r):void 0;if(p&&(m||g))throw new K("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(p&&D)throw new K("Cannot provide both `code` & `to` as parameters.");let R=p&&f,A=m&&g&&D&&f,T=R||A,v=R?yoe({code:p,data:f}):A?LOe({data:f,factory:m,factoryData:g,to:D}):f;try{On(t);let E=pa({blockHash:s,blockNumber:i,blockTag:a,requireCanonical:c}),O=d?iI(d):void 0,B=Tw(N),_=e.chain?.formatters?.transactionRequest?.format,F=(_||An)({...bi(L,{format:_}),accessList:l,account:I,authorizationList:n,blobs:u,data:v,gas:y,gasPrice:b,maxFeePerBlobGas:C,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:S,to:T?void 0:D,value:U},"call");if(o&&OOe({request:F})&&!O&&s===void 0)try{let{deployless:Q=!1}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},Y=goe(e,{blockNumber:i,deployless:Q});if(!Y||!UOe(B,Y))return await DOe(e,{...F,blockHash:s,blockNumber:i,blockTag:a,multicallAddress:Y,requestOptions:P,requireCanonical:c,rpcStateOverride:B})}catch(Q){if(!(Q instanceof X1)&&!(Q instanceof _p))throw Q}let q=(()=>{let Q=[F,E];return B&&O?[...Q,B,O]:B?[...Q,B]:O?[...Q,{},O]:Q})(),oe=await e.request({method:"eth_call",params:q},P);return oe==="0x"?{data:void 0}:{data:oe}}
61catch(E){if(P?.signal?.aborted)throw _o(P.signal);if(hi(E))throw E;let O=MOe(E),{offchainLookup:B,offchainLookupSignature:_}=await Promise.resolve().then(()=>(wI(),hoe));if(e.ccipRead!==!1&&O?.slice(0,10)===_&&D)return{data:await B(e,{data:O,requestOptions:P,to:D})};throw T&&O?.slice(0,10)==="0x101bb98d"?new yw({factory:m}):lI(E,{...t,account:I,chain:e.chain})}}function OOe({request:e}){let{data:t,to:r,...n}=e;return!(!t||t.startsWith(doe)||!r||Object.values(n).filter(o=>typeof o<"u").length>0)}function kOe(e){if(!e)return"default";let t=moe.get(e);if(t!==void 0)return t;let r=BOe++;return moe.set(e,r),r}async function DOe(e,t){let{batchSize:r=1024,deployless:n=!1,wait:o=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockHash:s,blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",requireCanonical:c,data:l,multicallAddress:u,requestOptions:d,rpcStateOverride:p,to:f}=t,m=u!==void 0?u:goe(e,{blockNumber:i,deployless:n}),g=pa({blockHash:s,blockNumber:i,blockTag:a,requireCanonical:c}),y=typeof g=="string"?g:JSON.stringify(g),b=p?`.${JSON.stringify(p)}`:"",{schedule:C}=tb({id:`${e.uid}.${y}.${kOe(d)}${b}`,wait:o,shouldSplitBatch(S){return S.reduce((D,{data:U})=>D+(U.length-2),0)>r*2},fn:async S=>{let P=S.map(L=>({allowFailure:!0,callData:L.data,target:L.to})),D=jt({abi:Ya,args:[P],functionName:"aggregate3"}),U={...m===null?{data:yoe({code:Gw,data:D})}:{to:m,data:D}},N=await e.request({method:"eth_call",params:p?[U,g,p]:[U,g]},d);return kn({abi:Ya,args:[P],functionName:"aggregate3",data:N||"0x"})}}),[{returnData:w,success:x}]=await C({data:l,to:f});if(!x)throw new ja({data:w});return w==="0x"?{data:void 0}:{data:w}}function goe(e,t){let{blockNumber:r,deployless:n}=t;if(n)return null;if(e.chain)return vi({blockNumber:r,chain:e.chain,contract:"multicall3"});throw new X1}function UOe(e,t){return e?Object.keys(e).some(r=>Or(r,t)):!1}function yoe(e){let{code:t,data:r}=e;return Np({abi:_y(["constructor(bytes, bytes)"]),bytecode:Zw,args:[t,r]})}function LOe(e){let{data:t,factory:r,factoryData:n,to:o}=e;return Np({abi:_y(["constructor(address, bytes, address, bytes)"]),bytecode:cI,args:[o,t,r,n]})}function MOe(e){if(!(e instanceof K))return;let t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}var BOe,moe,tg=h(()=>{Ry();_D();Wr();po();poe();Yw();ut();Xw();fp();Dc();Fc();b4();Io();fa();Y1();w0();BD();o0();Hc();dI();kS();$c();BOe=0,moe=new WeakMap});async function qt(e,t){let{abi:r,address:n,args:o,functionName:s,...i}=t,a=jt({abi:r,args:o,functionName:s});try{let{data:c}=await ue(e,Ja,"call")({...i,data:a,to:n});return kn({abi:r,args:o,functionName:s,data:c||"0x"})}catch(c){throw Fs(c,{abi:r,address:n,args:o,docsPath:"/docs/contract/readContract",functionName:s})}}var ns=h(()=>{Fc();Io();Vh();Mt();tg()});async function b0(e,t){let{abi:r,address:n,args:o,functionName:s,dataSuffix:i=typeof e.dataSuffix=="string"?e.dataSuffix:e.dataSuffix?.value,...a}=t,c=a.account?ct(a.account):e.account,l=jt({abi:r,args:o,functionName:s});try{let{data:u}=await ue(e,Ja,"call")({batch:!1,data:`${l}${i?i.replace("0x",""):""}`,to:n,...a,account:c}),d=kn({abi:r,args:o,functionName:s,data:u||"0x"}),p=r.filter(f=>"name"in f&&f.name===t.functionName);return{result:d,request:{abi:p,address:n,args:o,dataSuffix:i,functionName:s,...a,account:c}}}catch(u){throw Fs(u,{abi:r,address:n,args:o,docsPath:"/docs/contract/simulateContract",functionName:s,sender:c?.address})}}var v4=h(()=>{Wr();Fc();Io();Vh();Mt();tg()});function os(e,t,r){let n=++HOe,o=()=>bI.get(e)||[],s=()=>{let d=o().filter(p=>p.id!==n);if(d.length===0){bI.delete(e),zD.delete(e);return}bI.set(e,d)},i=()=>{let u=o();if(!u.some(p=>p.id===n))return;let d=zD.get(e);if(u.length===1&&d){let p=d();p instanceof Promise&&p.catch(()=>{})}s()},a=o();if(bI.set(e,[...a,{id:n,fns:t}]),a&&a.length>0)return i;let c={};for(let u in t)c[u]=((...d)=>{let p=o();if(p.length!==0)for(let f of p)f.fns[u]?.(...d)});let l=r(c);return typeof l=="function"&&zD.set(e,l),i}var bI,zD,HOe,x0=h(()=>{bI=new Map,zD=new Map,HOe=0});async function rg(e,{signal:t}={}){return new Promise((r,n)=>{if(t?.aborted){n(_o(t));return}let o=()=>t?.removeEventListener("abort",i),s=setTimeout(()=>{o(),r()},e),i=()=>{clearTimeout(s),o(),n(_o(t))};t?.addEventListener("abort",i,{once:!0})})}var xI=h(()=>{Dc()});function Qa(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0,s=()=>o=!1;return(async()=>{let a;t&&(a=await e({unpoll:s}));let c=await r?.(a)??n;await rg(c);let l=async()=>{o&&(await e({unpoll:s}),await rg(n),l())};l()})(),s}var ng=h(()=>{xI()});function woe(e){let t=(o,s)=>({clear:()=>s.delete(o),get:()=>s.get(o),set:i=>s.set(o,i)}),r=t(e,$Oe),n=t(e,FOe);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function vI(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){let n=woe(t),o=n.response.get();if(o&&r>0&&Date.now()-o.created.getTime()<r)return o.data;let s=n.promise.get();s||(s=e(),n.promise.set(s));try{let i=await s;return n.response.set({created:new Date,data:i}),i}finally{n.promise.clear()}}
61var $Oe,FOe,jD=h(()=>{$Oe=new Map,FOe=new Map});async function Xl(e,{cacheTime:t=e.cacheTime}={}){let r=await vI(()=>e.request({method:"eth_blockNumber"}),{cacheKey:VOe(e.uid),cacheTime:t});return BigInt(r)}var VOe,nb=h(()=>{jD();VOe=e=>`blockNumber.${e}`});async function v0(e,{filter:t}){let r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;let o=n.map(s=>Bn(s));return!("abi"in t)||!t.abi?o:Za({abi:t.abi,logs:o,strict:r})}var E4=h(()=>{J1();Yl()});async function E0(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}var A4=h(()=>{});function EI(e,t){let{abi:r,address:n,args:o,batch:s=!0,eventName:i,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:p}=t;return(typeof u<"u"?u:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{let y=p??!1,b=St(["watchContractEvent",n,o,s,e.uid,i,d,y,a]);return os(b,{onLogs:l,onError:c},C=>{let w;a!==void 0&&(w=a-1n);let x,S=!1,P=Qa(async()=>{if(!S){try{x=await ue(e,ew,"createContractEventFilter")({abi:r,address:n,args:o,eventName:i,strict:y,fromBlock:a})}catch{}S=!0;return}try{let D;if(x)D=await ue(e,v0,"getFilterChanges")({filter:x});else{let U=await ue(e,Xl,"getBlockNumber")({});w&&w<U?D=await ue(e,$w,"getContractEvents")({abi:r,address:n,args:o,eventName:i,fromBlock:w+1n,toBlock:U,strict:y}):D=[],w=U}if(D.length===0)return;if(s)C.onLogs(D);else for(let U of D)C.onLogs([U])}catch(D){x&&D instanceof mi&&(S=!1),C.onError?.(D)}},{emitOnBegin:!0,interval:d});return async()=>{x&&await ue(e,E0,"uninstallFilter")({filter:x}),P()}})})():(()=>{let y=p??!1,b=St(["watchContractEvent",n,o,s,e.uid,i,d,y]),C=!0,w=()=>C=!1;return os(b,{onLogs:l,onError:c},x=>((async()=>{try{let S=(()=>{if(e.transport.type==="fallback"){let U=e.transport.transports.find(N=>N.config.type==="webSocket"||N.config.type==="ipc");return U?U.value:e.transport}return e.transport})(),P=i?za({abi:r,eventName:i,args:o}):[],{unsubscribe:D}=await S.subscribe({params:["logs",{address:n,topics:P}],onData(U){if(!C)return;let N=U.result;try{let{eventName:L,args:I}=Sp({abi:r,data:N.data,topics:N.topics,strict:p}),R=Bn(N,{args:I,eventName:L});x.onLogs([R])}catch(L){let I,R;if(L instanceof Pc||L instanceof kl){if(p)return;I=L.abiItem.name,R=L.abiItem.inputs?.some(T=>!("name"in T&&T.name))}let A=Bn(N,{args:R?[]:{},eventName:I});x.onLogs([A])}},onError(U){x.onError?.(U)}});w=D,C||w()}catch(S){c?.(S)}})(),()=>w()))})()}var qD=h(()=>{zr();Fh();p4();M1();Yl();Mt();x0();ng();To();xS();nb();YS();E4();A4()});var Sn,Xa,eu=h(()=>{ut();Sn=class extends K{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
62`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}},Xa=class extends K{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r,name:"AccountTypeNotSupportedError"})}}});function A0({chain:e,currentChainId:t}){if(!e)throw new Qw;if(t!==e.id)throw new Jw({chain:e,currentChainId:t})}var C4=h(()=>{Xw()});async function ob(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}var AI=h(()=>{});async function C0(e,t){let{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:s,authorizationList:i,blobs:a,data:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:e.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,type:y,value:b,...C}=t;if(typeof r>"u")throw new Sn({docsPath:"/docs/actions/wallet/sendTransaction"});let w=r?ct(r):null,x;try{On(t);let S=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await Zh({authorization:i[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`.")})})();if(w?.type==="json-rpc"||w===null){let P;o!==null&&(P=await ue(e,lo,"getChainId")({}),n&&A0({currentChainId:P,chain:o}));let D=e.chain?.formatters?.transactionRequest?.format,N=(D||An)({...bi(C,{format:D}),accessList:s,account:w,authorizationList:i,blobs:a,chainId:P,data:l?nn([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,to:S,type:y,value:b},"sendTransaction"),L=WD.get(e.uid),I=L?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:I,params:[N]},{retryCount:0})}catch(R){if(L===!1)throw R;let A=R;if(A.name==="InvalidInputRpcError"||A.name==="InvalidParamsRpcError"||A.name==="MethodNotFoundRpcError"||A.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[N]},{retryCount:0}).then(T=>(WD.set(e.uid,!0),T)).catch(T=>{let v=T;throw v.name==="MethodNotFoundRpcError"||v.name==="MethodNotSupportedRpcError"?(WD.set(e.uid,!1),A):v});throw A}}if(w?.type==="local"){if(w.nonceManager&&typeof g>"u"){let N=C.chainId,L=await(async()=>typeof N=="number"?N:o?o.id:ue(e,lo,"getChainId")({}))();x={address:w.address,chainId:L}}let P=await ue(e,Gl,"prepareTransactionRequest")({account:w,accessList:s,authorizationList:i,blobs:a,chain:o,data:l?nn([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,nonceManager:w.nonceManager,parameters:[...u4,"sidecars"],type:y,value:b,...C,to:S}),D=o?.serializers?.transaction,U=await w.signTransaction(P,{serializer:D});return await ue(e,ob,"sendRawTransaction")({serializedTransaction:U})}throw w?.type==="smart"?new Xa({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Xa({docsPath:"/docs/actions/wallet/sendTransaction",type:w?.type})}catch(S){throw S instanceof Xa?S:(x&&w?.nonceManager?.reset(x),f0(S,{...t,account:w,chain:t.chain||void 0}))}}var WD,S4=h(()=>{Wr();eu();ut();e4();C4();Nn();l4();o0();Hc();Mt();hh();$c();Cp();Lw();AI();WD=new Jo(128)});async function ma(e,t){return ma.internal(e,C0,"sendTransaction",t)}var sb=h(()=>{Wr();eu();Io();Vh();Mt();S4();(function(e){async function t(r,n,o,s){let{abi:i,account:a=r.account,address:c,args:l,functionName:u,...d}=s;if(typeof a>"u")throw new Sn({docsPath:"/docs/contract/writeContract"});let p=a?ct(a):null,f=jt({abi:i,args:l,functionName:u});try{return await ue(r,n,o)({data:f,to:c,account:p,...d})}catch(m){throw Fs(m,{abi:i,address:c,args:l,docsPath:"/docs/contract/writeContract",functionName:u,sender:p?.address})}}e.internal=t})(ma||(ma={}))});function boe({abi:e,address:t,client:r}){let n=r,[o,s]=n?"public"in n&&"wallet"in n?[n.public,n.wallet]:"public"in n?[n.public,void 0]:"wallet"in n?[void 0,n.wallet]:[n,n]:[void 0,void 0],i=o!=null,a=s!=null,c={},l=!1,u=!1,d=!1;for(let p of e)if(p.type==="function"?p.stateMutability==="view"||p.stateMutability==="pure"?l=!0:u=!0:p.type==="event"&&(d=!0),l&&u&&d)break;return i&&(l&&(c.read=new Proxy({},{get(p,f){return(...m)=>{let{args:g,options:y}=CI(m);return ue(o,qt,"readContract")({abi:e,address:t,functionName:f,args:g,...y})}}})),u&&(c.simulate=new Proxy({},{get(p,f){return(...m)=>{let{args:g,options:y}=CI(m);return ue(o,b0,"simulateContract")({abi:e,address:t,functionName:f,args:g,...y})}}})),d&&(c.createEventFilter=new Proxy({},{get(p,f){return(...m)=>{let g=e.find(C=>C.type==="event"&&C.name===f),{args:y,options:b}=KD(m,g);return ue(o,ew,"createContractEventFilter")({abi:e,address:t,eventName:f,args:y,...b})}}}),c.getEvents=new Proxy({},{get(p,f){return(...m)=>{let g=e.find(C=>C.type==="event"&&C.name===f),{args:y,options:b}=KD(m,g);return ue(o,$w,"getContractEvents")({abi:e,address:t,eventName:f,args:y,...b})}}}),c.watchEvent=new Proxy({},{get(p,f){return(...m)=>{let g=e.find(C=>C.type==="event"&&C.name===f),{args:y,options:b}=KD(m,g);return ue(o,EI,"watchContractEvent")({abi:e,address:t,eventName:f,args:y,...b})}}}))),a&&u&&(c.write=new Proxy({},{get(p,f){return(...m)=>{let{args:g,options:y}=CI(m);return ue(s,ma,"writeContract")({abi:e,address:t,functionName:f,args:g,...y})}}})),(i||a)&&u&&(c.estimateGas=new Proxy({},{get(p,f){return(...m)=>{let{args:g,options:y}=CI(m);return ue(o??s,h0,"estimateContractGas")({abi:e,address:t,functionName:f,args:g,...y,account:y.account??s.account})}}})),c.address=t,c.abi=e,c}function CI(e){let t=e.length&&Array.isArray(e[0]),r=t?e[0]:[],n=(t?e[1]:e[0])??{};return{args:r,options:n}}function KD(e,t){let r=!1;Array.isArray(e[0])?r=!0:e.length===1?r=t.inputs.some(s=>s.indexed):e.length===2&&(r=!0);let n=r?e[0]:void 0,o=(r?e[1]:e[0])??{};return{args:n,options:o}}var xoe=h(()=>{Mt();xS();d4();YS();ns();v4();qD();sb()});var ib,ZD=h(()=>{ut();ib=class extends K{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}});function Rp(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0,signal:o}={}){return new Promise((s,i)=>{let a=async({count:c=0}={})=>
62{if(o?.aborted){i(_o(o));return}let l=async({error:u})=>{let d=typeof t=="function"?t({count:c,error:u}):t;if(d)try{await rg(d,{signal:o})}catch(p){i(p);return}a({count:c+1})};try{let u=await e();s(u)}catch(u){if(o?.aborted){i(_o(o));return}if(hi(u)){i(u);return}if(c<r&&await n({count:c,error:u}))return l({error:u});i(u)}};a()})}var I4=h(()=>{Dc();xI()});function Op(e,t){let r={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(n=>Bn(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?ht(e.transactionIndex):null,status:e.status?GD[e.status]:null,type:e.type?o4[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}var GD,voe,ab=h(()=>{tn();r4();Yl();Nw();GD={"0x0":"reverted","0x1":"success"};voe=s0("transactionReceipt",Op)});async function SI(e,t){let{account:r=e.account,chain:n=e.chain,experimental_fallback:o,experimental_fallbackDelay:s=32,forceAtomic:i=!1,id:a,version:c="2.0.0"}=t,l=r?ct(r):null,u=t.capabilities;e.dataSuffix&&!t.capabilities?.dataSuffix&&(typeof e.dataSuffix=="string"?u={...t.capabilities,dataSuffix:{value:e.dataSuffix,optional:!0}}:u={...t.capabilities,dataSuffix:{value:e.dataSuffix.value,...e.dataSuffix.required?{}:{optional:!0}}});let d=t.calls.map(p=>{let f=p,m=f.abi?jt({abi:f.abi,functionName:f.functionName,args:f.args}):f.data;return{data:f.dataSuffix&&m?nn([m,f.dataSuffix]):m,to:f.to,value:f.value?re(f.value):void 0}});try{let p=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:i,calls:d,capabilities:u,chainId:re(n.id),from:l?.address,id:a,version:c}]},{retryCount:0});return typeof p=="string"?{id:p}:p}catch(p){let f=p;if(o&&(f.name==="MethodNotFoundRpcError"||f.name==="MethodNotSupportedRpcError"||f.name==="UnknownRpcError"||f.details.toLowerCase().includes("does not exist / is not available")||f.details.toLowerCase().includes("missing or invalid. request()")||f.details.toLowerCase().includes("did not match any variant of untagged enum")||f.details.toLowerCase().includes("account upgraded to unsupported contract")||f.details.toLowerCase().includes("eip-7702 not supported")||f.details.toLowerCase().includes("unsupported wc_ method")||f.details.toLowerCase().includes("feature toggled misconfigured")||f.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(u&&Object.values(u).some(b=>!b.optional)){let b="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new zl(new K(b,{details:b}))}if(i&&d.length>1){let y="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new jl(new K(y,{details:y}))}let m=[];for(let y of d){try{let b=await C0(e,{account:l,chain:n,data:y.data,to:y.to,value:y.value?at(y.value):void 0});m.push({status:"fulfilled",value:b})}catch(b){m.push({reason:b,status:"rejected"})}s>0&&await new Promise(b=>setTimeout(b,s))}if(m.every(y=>y.status==="rejected"))throw m[0].reason;let g=m.map(y=>y.status==="fulfilled"?y.value:JD);return{id:nn([...g,re(n.id,{size:32}),YD])}}throw f0(p,{...t,account:l,chain:t.chain})}}var YD,JD,II=h(()=>{Wr();ut();Fh();Io();Nn();tn();Fe();l4();S4();YD="0x5792579257925792579257925792579257925792579257925792579257925792",JD=re(0,{size:32})});async function TI(e,t){async function r(u){if(u.endsWith(YD.slice(2))){let p=jr(Ll(u,-64,-32)),f=Ll(u,0,-64).slice(2).match(/.{1,64}/g),m=await Promise.all(f.map(y=>JD.slice(2)!==y?e.request({method:"eth_getTransactionReceipt",params:[`0x${y}`]},{dedupe:!0}):void 0)),g=m.some(y=>y===null)?100:m.every(y=>y?.status==="0x1")?200:m.every(y=>y?.status==="0x0")?500:600;return{atomic:!1,chainId:ht(p),receipts:m.filter(Boolean),status:g,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[u]})}let{atomic:n=!1,chainId:o,receipts:s,version:i="2.0.0",...a}
62=await r(t.id),[c,l]=(()=>{let u=a.status;return u>=100&&u<200?["pending",u]:u>=200&&u<300?["success",u]:u>=300&&u<700?["failure",u]:u==="CONFIRMED"?["success",200]:u==="PENDING"?["pending",100]:[void 0,u]})();return{...a,atomic:n,chainId:o?ht(o):void 0,receipts:s?.map(u=>({...u,blockNumber:at(u.blockNumber),gasUsed:at(u.gasUsed),status:GD[u.status]}))??[],statusCode:l,status:c,version:i}}var QD=h(()=>{aa();op();tn();ab();II()});async function _I(e,t){let{id:r,pollingInterval:n=e.pollingInterval,status:o=({statusCode:g})=>g===200||g>=300,retryCount:s=4,retryDelay:i=({count:g})=>~~(1<<g)*200,timeout:a=6e4,throwOnFailure:c=!1}=t,l=St(["waitForCallsStatus",e.uid,r]),{promise:u,resolve:d,reject:p}=eb(),f,m=os(l,{resolve:d,reject:p},g=>{let y=Qa(async()=>{let b=C=>{clearTimeout(f),y(),C(),m()};try{let C=await Rp(async()=>{let w=await ue(e,TI,"getCallsStatus")({id:r});if(c&&w.status==="failure")throw new ib(w);return w},{retryCount:s,delay:i});if(!o(C))return;b(()=>g.resolve(C))}catch(C){b(()=>g.reject(C))}},{interval:n,emitOnBegin:!0});return y});return f=a?setTimeout(()=>{m(),clearTimeout(f),p(new T4({id:r}))},a):void 0,await u}var T4,PI=h(()=>{ut();ZD();Mt();x0();ng();uI();I4();To();QD();T4=class extends K{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}});function OI(e=11){if(!RI||NI+e>256*2){RI="",NI=0;for(let t=0;t<256;t++)RI+=(256+Math.random()*256|0).toString(16).substring(1)}return RI.substring(NI,NI+++e)}var NI,RI,XD=h(()=>{NI=256});function S0(e){let{batch:t,chain:r,ccipRead:n,dataSuffix:o,key:s="base",name:i="Base Client",tokens:a,type:c="base"}=e,l=e.experimental_blockTag??(typeof r?.experimental_preconfirmationTime=="number"?"pending":void 0),u=r?.blockTime??12e3,d=Math.min(Math.max(Math.floor(u/2),500),4e3),p=e.pollingInterval??d,f=e.cacheTime??p,m=e.account?ct(e.account):void 0,{config:g,request:y,value:b}=e.transport({account:m,chain:r,pollingInterval:p}),C={...g,...b},w={account:m,batch:t,cacheTime:f,ccipRead:n,chain:r,dataSuffix:o,key:s,name:i,pollingInterval:p,request:y,tokens:a,transport:C,type:c,uid:OI(),...l?{experimental_blockTag:l}:{}};function x(S){return P=>{let D=P(S);for(let N in w)delete D[N];let U={...S,...D};for(let N in D){let L=S[N],I=D[N];Eoe(L)&&Eoe(I)&&(U[N]={...L,...I})}return Object.assign(U,{extend:x(U)})}}return Object.assign(w,{extend:x(w)})}function Eoe(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function tu(e,t){let r=(n={})=>t(e,n);for(let n of["call","calls","callWithPeriod","estimateGas","prepare","simulate"])if(Object.hasOwn(t,n)){let o=t[n];r[n]=(s={})=>o.length===1?o(s):o(e,s)}for(let n of["extractEvent","extractEvents"])Object.hasOwn(t,n)&&(r[n]=t[n]);return r}function Aoe(){return null}var og=h(()=>{Wr();XD()});function cb(e){if(!(e instanceof K))return!1;let t=e.walk(r=>r instanceof pp);return t instanceof pp?t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile":!1}var BI=h(()=>{ut();fp()});function kI(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;let t=`0x${e.slice(1,65)}`;return Ve(t)?t:null}var eU=h(()=>{Us()});function sg(e){let t=new Uint8Array(32).fill(0);if(!e)return ft(t);let r=e.split(".");for(let n=r.length-1;n>=0;n-=1){let o=kI(r[n]),s=o?rn(o):Ht(sa(r[n]),"bytes");t=Ht(nn([t,s]),"bytes")}return ft(t)}var DI=h(()=>{Nn();Sr();Fe();fi();eU()});function Coe(e){return`[${e.slice(2)}]`}var Soe=h(()=>{});function UI(e){let t=new Uint8Array(32).fill(0);return e?kI(e)||Ht(sa(e)):ft(t)}var tU=h(()=>{Sr();Fe();fi();eU()});function lb(e){let t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);let r=new Uint8Array(sa(t).byteLength+2),n=0,o=t.split(".");for(let s=0;s<o.length;s++){let i=sa(o[s]);i.byteLength>255&&(i=sa(Coe(UI(o[s])))),r[n]=i.length,r.set(i,n+1),n+=i.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}var LI=h(()=>{Sr();Soe();tU()});async function Ioe(e,t){let{blockNumber:r,blockTag:n,coinType:o,name:s,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>
62{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return vi({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c?.ensTlds;if(u&&!u.some(p=>s.endsWith(p)))return null;let d=o!=null?[sg(s),BigInt(o)]:[sg(s)];try{let p=jt({abi:ND,functionName:"addr",args:d}),f={address:l,abi:aI,functionName:"resolveWithGateways",args:[vr(lb(s)),p,i??[Vc]],blockNumber:r,blockTag:n},g=await ue(e,qt,"readContract")(f);if(g[0]==="0x")return null;let y=zOe({coinType:o,data:g[0],args:d});return y==="0x"||jr(y)==="0x00"?null:y}catch(p){if(a)throw p;if(cb(p))return null;throw p}}function zOe({coinType:e,data:t,args:r}){try{return kn({abi:ND,args:r,functionName:"addr",data:t})}catch(n){if(e==null)throw n;let o=jr(t);if(yt(o)===20)return qr(o);throw n}}var Toe=h(()=>{po();Fc();Io();Ms();w0();Go();op();Fe();BI();rb();DI();LI();Mt();ns()});var MI,ru,I0,ub,db,HI=h(()=>{ut();MI=class extends K{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}},ru=class extends K{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}},I0=class extends K{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}},ub=class extends K{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}},db=class extends K{constructor({chainId:t}){super(`Invalid ENSIP-11 chainId: ${t}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}});async function ZOe(e){try{let t=await fetch(e,{method:"HEAD"});return t.status===200?t.headers.get("content-type")?.startsWith("image/"):!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{let n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function _oe(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function rU({uri:e,gatewayUrls:t}){let r=WOe.test(e);
62if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=_oe(t?.ipfs,"https://ipfs.io"),o=_oe(t?.arweave,"https://arweave.net"),s=e.match(jOe),{protocol:i,subpath:a,target:c,subtarget:l=""}=s?.groups||{},u=i==="ipns:/"||a==="ipns/",d=i==="ipfs:/"||a==="ipfs/"||qOe.test(e);if(e.startsWith("http")&&!u&&!d){let f=e;return t?.arweave&&(f=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:f,isOnChain:!1,isEncoded:!1}}if((u||d)&&c)return{uri:`${n}/${u?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(i==="ar:/"&&c)return{uri:`${o}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let p=e.replace(KOe,"");if(p.startsWith("<svg")&&(p=`data:image/svg+xml;base64,${btoa(p)}`),p.startsWith("data:")||p.startsWith("{"))return{uri:p,isOnChain:!0,isEncoded:!1};throw new I0({uri:e})}function nU(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new MI({data:e});return e.image||e.image_url||e.image_data}async function Poe({gatewayUrls:e,uri:t}){try{let r=await fetch(t).then(o=>o.json());return await $I({gatewayUrls:e,uri:nU(r)})}catch{throw new I0({uri:t})}}async function $I({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=rU({uri:t,gatewayUrls:e});if(n||await ZOe(r))return r;throw new I0({uri:t})}function Noe(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,o]=t.split("/"),[s,i]=r.split(":"),[a,c]=n.split(":");if(!s||s.toLowerCase()!=="eip155")throw new ru({reason:"Only EIP-155 supported"});if(!i)throw new ru({reason:"Chain ID not found"});if(!c)throw new ru({reason:"Contract address not found"});if(!o)throw new ru({reason:"Token ID not found"});if(!a)throw new ru({reason:"ERC namespace not found"});return{chainID:Number.parseInt(i,10),namespace:a.toLowerCase(),contractAddress:c,tokenID:o}}async function Roe(e,{nft:t}){if(t.namespace==="erc721")return qt(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return qt(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new ub({namespace:t.namespace})}var jOe,qOe,WOe,KOe,Ooe=h(()=>{ns();HI();jOe=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,qOe=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,WOe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,KOe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/});async function Boe(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?GOe(e,{gatewayUrls:t,record:r}):$I({uri:r,gatewayUrls:t})}async function GOe(e,{gatewayUrls:t,record:r}){let n=Noe(r),o=await Roe(e,{nft:n}),{uri:s,isOnChain:i,isEncoded:a}=rU({uri:o,gatewayUrls:t});if(i&&(s.includes("data:application/json;base64,")||s.startsWith("{"))){let l=a?atob(s.replace("data:application/json;base64,","")):s,u=JSON.parse(l);return $I({uri:nU(u),gatewayUrls:t})}let c=n.tokenID;return n.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Poe({gatewayUrls:t,uri:s.replace(/(?:0x)?{id}/,c)})}var koe=h(()=>{Ooe()});async function FI(e,t){let{blockNumber:r,blockTag:n,key:o,name:s,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return vi({blockNumber:r,chain:c,contract:"ensUniversalResolver"})})(),u=c?.ensTlds;if(u&&!u.some(d=>s.endsWith(d)))return null;try{let d={address:l,abi:aI,args:[vr(lb(s)),jt({abi:PD,functionName:"text",args:[sg(s),o]}),i??[Vc]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},f=await ue(e,qt,"readContract")(d);if(f[0]==="0x")return null;let m=kn({abi:PD,functionName:"text",data:f[0]});return m===""?null:m}catch(d){if(a)throw d;if(cb(d))return null;throw d}}
62var oU=h(()=>{po();Fc();Io();w0();Fe();BI();rb();DI();LI();Mt();ns()});async function Doe(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:o,gatewayUrls:s,strict:i,universalResolverAddress:a}){let c=await ue(e,FI,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:o,universalResolverAddress:a,gatewayUrls:s,strict:i});if(!c)return null;try{return await Boe(e,{record:c,gatewayUrls:n})}catch{return null}}var Uoe=h(()=>{koe();Mt();oU()});async function Loe(e,t){let{address:r,blockNumber:n,blockTag:o,coinType:s=60n,gatewayUrls:i,strict:a}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return vi({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})();try{let u={address:l,abi:ioe,args:[r,s,i??[Vc]],functionName:"reverseWithGateways",blockNumber:n,blockTag:o},d=ue(e,qt,"readContract"),[p]=await d(u);return p||null}catch(u){if(a)throw u;if(cb(u))return null;throw u}}var Moe=h(()=>{po();w0();BI();rb();Mt();ns()});async function Hoe(e,t){let{blockNumber:r,blockTag:n,name:o}=t,{chain:s}=e,i=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!s)throw new Error("client chain not configured. universalResolverAddress is required.");return vi({blockNumber:r,chain:s,contract:"ensUniversalResolver"})})(),a=s?.ensTlds;if(a&&!a.some(l=>o.endsWith(l)))throw new Error(`${o} is not a valid ENS TLD (${a?.join(", ")}) for chain "${s.name}" (id: ${s.id}).`);let[c]=await ue(e,qt,"readContract")({address:i,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[vr(lb(o))],blockNumber:r,blockTag:n});return c}var $oe=h(()=>{w0();Fe();LI();Mt();ns()});async function VI(e,t){let{account:r=e.account,blockNumber:n,blockTag:o="latest",blobs:s,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f,...m}=t,g=r?ct(r):void 0;try{On(t);let b=(typeof n=="bigint"?re(n):void 0)||o,C=e.chain?.formatters?.transactionRequest?.format,x=(C||An)({...bi(m,{format:C}),account:g,blobs:s,data:i,gas:a,gasPrice:c,maxFeePerBlobGas:l,maxFeePerGas:u,maxPriorityFeePerGas:d,to:p,value:f},"createAccessList"),S=await e.request({method:"eth_createAccessList",params:[x,b]});if(S.error)throw new K(S.error,{details:S.error});return{accessList:S.accessList,gasUsed:BigInt(S.gasUsed)}}catch(y){throw lI(y,{...t,account:g,chain:e.chain})}}var sU=h(()=>{Wr();ut();Fe();BD();o0();Hc();$c()});async function Foe(e){let t=mh(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}var Voe=h(()=>{D8()});async function zI(e,{address:t,args:r,event:n,events:o,fromBlock:s,strict:i,toBlock:a}={}){let c=o??(n?[n]:void 0),l=mh(e,{method:"eth_newFilter"}),u=[];c&&(u=[c.flatMap(f=>za({abi:[f],eventName:f.name,args:r}))],n&&(u=u[0]));let d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof s=="bigint"?re(s):s,toBlock:typeof a=="bigint"?re(a):a,...u.length?{topics:u}:{}}]});return{abi:c,args:r,eventName:n?n.name:void 0,fromBlock:s,id:d,request:l(d),strict:!!i,toBlock:a,type:"event"}}var iU=h(()=>{M1();Fe();D8()});async function jI(e){let t=mh(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}var aU=h(()=>{D8()});async function zoe(e,{address:t,blockHash:r,blockNumber:n,blockTag:o=e.experimental_blockTag??"latest",requireCanonical:s}){let i=pa({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s});if(e.batch?.multicall&&e.chain?.contracts?.multicall3){let c=e.chain.contracts.multicall3.address,l=jt({abi:Ya,functionName:"getEthBalance",args:[t]}),{data:u}=await ue(e,Ja,"call")({to:c,data:l,blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s});return kn({abi:Ya,functionName:"getEthBalance",args:[t],data:u||"0x"})}let a=await e.request({method:"eth_getBalance",params:[t,i]});return BigInt(a)}var joe=h(()=>{po();Fc();Io();Y1();Mt();tg()});async function qoe(e){let t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}var Woe=h(()=>{});async function Koe(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}={}){let o=r!==void 0?re(r):void 0,s=await e.request({method:"eth_getBlockReceipts",params:[t||o||n]},{dedupe:!!(t||o)});if(!s)throw new Zl({blockHash:t,blockNumber:r});let i=e.chain?.formatters?.transactionReceipt?.format||Op;return s.map(a=>i(a,"getBlockReceipts"))}var Zoe=h(()=>{n4();Fe();ab()});async function Goe(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let o=r!==void 0?re(r):void 0,s;return t?s=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):s=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||n]},{dedupe:!!o}),ht(s)}var Yoe=h(()=>{tn();Fe()});async function ig(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:s}){let i=pa({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s}),a=await e.request({method:"eth_getCode",params:[t,i]},{dedupe:typeof n=="bigint"||r!==void 0});if(a!=="0x")return a}var qI=h(()=>{Y1()});async function Joe(e,{address:t,blockNumber:r,blockTag:n="latest"}){let o=await ig(e,{address:t,...r!==void 0?{blockNumber:r}:{blockTag:n}});if(o&&yt(o)===23&&o.startsWith("0xef0100"))return qr(so(o,3,23))}var Qoe=h(()=>{Ms();Go();aa();qI()});var WI,Xoe=h(()=>{ut();WI=class extends K{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}});async function ese(e,t){let{address:r,factory:n,factoryData:o}=t;try{let[s,i,a,c,l,u,d]=await ue(e,qt,"readContract")({abi:YOe,address:r,functionName:"eip712Domain",factory:n,factoryData:o});return{domain:{name:i,version:a,chainId:Number(c),verifyingContract:l,salt:u},extensions:d,fields:s}}catch(s){let i=s;throw i.name==="ContractFunctionExecutionError"&&i.cause.name==="ContractFunctionZeroDataError"?new WI({address:r}):i}}var YOe,tse=h(()=>{Xoe();Mt();ns();YOe=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}]});function rse(e){return{baseFeePerGas:e.baseFeePerGas.map(t=>BigInt(t)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.olde
62stBlock),reward:e.reward?.map(t=>t.map(r=>BigInt(r)))}}var nse=h(()=>{});async function ose(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:o}){let s=typeof r=="bigint"?re(r):void 0,i=await e.request({method:"eth_feeHistory",params:[re(t),s||n,o]},{dedupe:!!s});return rse(i)}var sse=h(()=>{Fe();nse()});async function ise(e,{filter:t}){let r=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(s=>Bn(s));return t.abi?Za({abi:t.abi,logs:o,strict:r}):o}var ase=h(()=>{J1();Yl()});function cse(e,t){if(e.length!==t.length)throw new ah({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n];r.push(lse(o,s))}return ur(r)}function lse(e,t,r=!1){if(e==="address"){let i=t;if(!Dt(i))throw new mr({address:i});return Yo(i.toLowerCase(),{size:r?32:null})}if(e==="string")return Fa(t);if(e==="bytes")return t;if(e==="bool")return Yo(B1(t),{size:r?32:1});let n=e.match(Xy);if(n){let[i,a,c="256"]=n,l=Number.parseInt(c,10)/8;return re(t,{size:r?32:l,signed:a==="int"})}let o=e.match(wS);if(o){let[i,a]=o;if(Number.parseInt(a,10)!==(t.length-2)/2)throw new uh({expectedSize:Number.parseInt(a,10),givenSize:(t.length-2)/2});return Yo(t,{dir:"right",size:r?32:null})}let s=e.match(Ree);if(s&&Array.isArray(t)){let[i,a]=s,c=[];for(let l=0;l<t.length;l++)c.push(lse(a,t[l],!0));return c.length===0?"0x":ur(c)}throw new Fy(e)}var use=h(()=>{zr();Va();Hs();Nn();ph();Fe();bS()});function _4(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}var cU=h(()=>{});function dse(e){return e.opcode==="CREATE2"?uU(e):lU(e)}function lU(e){let t=rn(qr(e.from)),r=rn(e.nonce);return r[0]===0&&(r=new Uint8Array([])),qr(`0x${Ht(Ws([t,r],"bytes")).slice(26)}`)}function uU(e){let t=rn(qr(e.from)),r=Yo(_4(e.salt)?e.salt:rn(e.salt),{size:32}),n="bytecodeHash"in e?_4(e.bytecodeHash)?e.bytecodeHash:rn(e.bytecodeHash):Ht(e.bytecode,"bytes");return qr(so(Ht(nn([rn("0xff"),t,r,n])),12))}var pse=h(()=>{Nn();cU();ph();aa();Sr();X8();fi();Ms()});function KI(e){let{authorizationList:t}=e;if(t)for(let r of t){let{chainId:n}=r,o=r.address;if(!Dt(o))throw new mr({address:o});if(n<0)throw new Pp({chainId:n})}T0(e)}function ZI(e){let{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new kw;for(let r of t){let n=yt(r),o=ht(so(r,0,1));if(n!==32)throw new zS({hash:r,size:n});if(o!==1)throw new jS({hash:r,version:o})}}T0(e)}function T0(e){let{chainId:t,maxPriorityFeePerGas:r,maxFeePerGas:n,to:o}=e;if(t<=0)throw new Pp({chainId:t});if(o&&!Dt(o))throw new mr({address:o});if(n&&n>i0)throw new yi({maxFeePerGas:n});if(r&&n&&r>n)throw new Ka({maxFeePerGas:n,maxPriorityFeePerGas:r})}function pb(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:s}=e;if(t<=0)throw new Pp({chainId:t});if(s&&!Dt(s))throw new mr({address:s});if(r||o)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>i0)throw new yi({maxFeePerGas:n})}function fb(e){let{chainId:t,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:o,to:s}=e;if(s&&!Dt(s))throw new mr({address:s});if(typeof t<"u"&&t<=0)throw new Pp({chainId:t});if(r||o)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>i0)throw new yi({maxFeePerGas:n})}var GI=h(()=>{DS();Va();ut();gD();Xw();Wl();Hs();Go();aa();tn()});function ag(e){if(!e||e.length===0)return[];let t=[];for(let r=0;r<e.length;r++){let{address:n,storageKeys:o}=e[r];for(let s=0;s<o.length;s++)if(o[s].length-2!==64)throw new fw({storageKey:o[s]});if(!Dt(n,{strict:!1}))throw new mr({address:n});t.push([n,o])}return t}var dU=h(()=>{Va();es();Hs()});function YI(e,t){let r=Dw(e);return r==="eip1559"?XOe(e,t):r==="eip2930"?eBe(e,t):r==="eip4844"?QOe(e,t):r==="eip7702"?JOe(e,t):tBe(e,t)}function JOe(e,t){let{authorizationList:r,chainId:n,gas:o,nonce:s,to:i,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;KI(e);let p=ag(u),f=fse(r);return ur(["0x04",Ws([re(n),s?re(s):"0x",l?re(l):"0x",c?re(c):"0x",o?re(o):"0x",i??"0x",a?re(a):"0x",d??"0x",p,f,...hb(e,t)])])}function QOe(e,t){let{chainId:r,gas:n,nonce:o,to:s,value:i,maxFeePerBlobGas:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;ZI(e);let p=e.blobVersionedHashes,f=e.sidecars;if(e.blobs&&(typeof p>"u"||typeof f>"u")){let w=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(P=>ft(P)),x=e.kzg,S=u0({blobs:w,kzg:x});if(typeof p>"u"&&(p=Bw({commitments:S})),typeof f>"u"){let P=d0({blobs:w,commitments:S,kzg:x});f=p0({blobs:w,commitments:S,proofs:P})}}let m=ag(u),g=[re(r),o?re(o):"0x",l?re(l):"0x",c?re(c):"0x",n?re(n):"0x",s??"0x",i?re(i):"0x",d??"0x",m,a?re(a):"0x",p??[],...hb(e,t)],y=[],b=[],C=[];if(f)for(let w=0;w<f.length;w++){let{blob:x,commitment:S,proof:P}=f[w];y.push(x),b.push(S),C.push(P)}return ur(["0x03",f?Ws([g,y,b,C]):Ws(g)])}function XOe(e,t){let{chainId:r,gas:n,nonce:o,to:s,value:i,maxFeePerGas:a,maxPriorityFeePerGas:c,accessList:l,data:u}=e;T0(e);let d=ag(l),p=[re(r),o?re(o):"0x",c?re(c):"0x",a?re(a):"0x",n?re(n):"0x",s??"0x",i?re(i):"0x",u??"0x",d,...hb(e,t)];return ur(["0x02",Ws(p)])}function eBe(e,t){let{chainId:r,gas:n,data:o,nonce:s,to:i,value:a,accessList:c,gasPrice:l}=e;pb(e);let u=ag(c),d=[re(r),s?re(s):"0x",l?re(l):"0x",n?re(n):"0x",i??"0x",a?re(a):"0x",o??"0x",u,...hb(e,t)];return ur(["0x01",Ws(d)])}function tBe(e,t){let{chainId:r=0,gas:n,data:o,nonce:s,to:i,value:a,gasPrice:c}=e;fb(e);let l=[s?re(s):"0x",c?re(c):"0x",n?re(n):"0x",i??"0x",a?re(a):"0x",o??"0x"];if(t){let u=(()=>
62{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+t.v-27n);let f=27n+(t.v===27n?0n:1n);if(t.v!==f)throw new bh({v:t.v});return f})(),d=jr(t.r),p=jr(t.s);l=[...l,re(u),d==="0x00"?"0x":d,p==="0x00"?"0x":p]}else r>0&&(l=[...l,re(r),"0x","0x"]);return Ws(l)}function hb(e,t){let r=t??e,{v:n,yParity:o}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof o>"u")return[];let s=jr(r.r),i=jr(r.s);return[typeof o=="number"?o?re(1):"0x":n===0n?"0x":n===1n?re(1):n===27n?"0x":re(1),s==="0x00"?"0x":s,i==="0x00"?"0x":i]}var JI=h(()=>{es();hse();i4();a4();FS();c4();Nn();op();Fe();X8();GI();WS();dU()});function fse(e){if(!e||e.length===0)return[];let t=[];for(let r of e){let{chainId:n,nonce:o,...s}=r,i=r.address;t.push([n?vr(n):"0x",i,o?vr(o):"0x",...hb({},s)])}return t}var hse=h(()=>{Fe();JI()});async function mse({address:e,authorization:t,signature:r}){return Or(qr(e),await Zh({authorization:t,signature:r}))}var gse=h(()=>{Ms();fa();e4()});function yse(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(QI.get(r))return QI.get(r);let n=e().finally(()=>QI.delete(r));return QI.set(r,n),n}var QI,wse=h(()=>{hh();QI=new Jo(8192)});function bse(e,t={}){return async(r,n={})=>{let{dedupe:o=!1,methods:s,retryDelay:i=150,retryCount:a=3,signal:c,uid:l}={...t,...n},{method:u}=r;if(s?.exclude?.includes(u))throw new Vl(new Error("method not supported"),{method:u});if(s?.include&&!s.include.includes(u))throw new Vl(new Error("method not supported"),{method:u});if(c?.aborted)throw _o(c);let d=o?nBe(`${l}.${St(r)}`):void 0;return yse(()=>Rp(async()=>{try{return await e(r,c?{signal:c}:void 0)}catch(p){if(c?.aborted)throw _o(c);if(hi(p))throw p;let f=p;switch(f.code){case Ah.code:throw new Ah(f);case Ch.code:throw new Ch(f);case Sh.code:throw new Sh(f,{method:r.method});case Ih.code:throw new Ih(f);case Uc.code:throw new Uc(f);case mi.code:throw new mi(f);case Th.code:throw new Th(f);case _h.code:throw new _h(f);case Fl.code:throw new Fl(f);case Vl.code:throw new Vl(f,{method:r.method});case gp.code:throw new gp(f);case Ph.code:throw new Ph(f);case Lc.code:throw new Lc(f);case Nh.code:throw new Nh(f);case Rh.code:throw new Rh(f);case Oh.code:throw new Oh(f);case Bh.code:throw new Bh(f);case kh.code:throw new kh(f);case zl.code:throw new zl(f);case Dh.code:throw new Dh(f);case Uh.code:throw new Uh(f);case Lh.code:throw new Lh(f);case Mh.code:throw new Mh(f);case Hh.code:throw new Hh(f);case jl.code:throw new jl(f);case 5e3:throw new Lc(f);case $h.code:throw new $h(f);default:throw p instanceof K?p:new ww(f)}}},{delay:({count:p,error:f})=>{if(f&&f instanceof ts){let m=f?.headers?.get("Retry-After");if(m?.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<<p)*i},retryCount:a,signal:c,shouldRetry:({error:p})=>rBe(p)}),{enabled:o,id:d})}}function rBe(e){return hi(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===gp.code||e.code===Uc.code||e.code===429:e instanceof ts&&e.status?e.status===403||e.status===408||e.status===4
6213||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function nBe(e,t=0){let r=3735928559^t,n=1103547991^t;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);r=Math.imul(r^s,2654435761),n=Math.imul(n^s,1597334677)}return r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),(4294967296*(2097151&n)+(r>>>0)).toString(36)}var xse=h(()=>{ut();Wa();Fh();Dc();wse();I4();To()});function vse({batchGateways:e,ccipRequest:t=eg}){return{async request({data:r,sender:n,urls:o}){if(o.includes(Vc))return t({data:r,sender:n,urls:e});{let[s,i]=kn({abi:y0,functionName:"query",data:await t({data:jt({abi:y0,functionName:"query",args:[[{sender:n,data:r,urls:o}]]}),sender:n,urls:e})});if(s[0]){let a;try{let c=yh({abi:[...y0,tw],data:i[0]});if(c.errorName==="HttpError")a=new ts({body:{message:c.args[1]},status:c.args[0],url:o.join(" | ")});else{let l=c.args[0];l&&(a=new Error(l))}}catch{}throw a??new Error("An unknown error occurred.")}return i[0]}}}}var Ese=h(()=>{po();U8();Wa();V8();Fc();Io();wI();rb()});function Ase(e){let t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return o=>{let s=typeof o=="function"?o(n):o,i={...n,...s};return Object.assign(i,{extend:r(i)})}}return Object.assign(t,{extend:r(t)})}function Cse(){return{}}var Sse=h(()=>{});function Ise({chains:e,id:t}){return e.find(r=>r.id===t)}var Tse=h(()=>{});function P4(e,t="hex"){let r=(()=>{if(typeof e=="string"){if(e.length>3&&e.length%2!==0)throw new qy(e);return zt(e)}return e})(),n=kc(r,{recursiveReadLimit:Number.POSITIVE_INFINITY}),o=Nse(n,t);if(n.position<n.bytes.length)throw new Zy({count:n.bytes.length-n.position});return o}function Nse(e,t="hex",r=0){if(r>=_se)throw new Wy({limit:_se});if(e.bytes.length===0)return t==="hex"?ft(e.bytes):e.bytes;let n=e.readByte();if(n<128&&e.decrementPosition(1),n<192){let s=Pse(e,n,128),i=e.readBytes(s);return t==="hex"?ft(i):i}let o=Pse(e,n,192);return oBe(e,o,t,r+1)}function Pse(e,t,r){if(r===128&&t<128)return 1;if(t<=r+55)return t-r;if(t===r+55+1)return e.readUint8();if(t===r+55+2)return e.readUint16();if(t===r+55+3)return e.readUint24();if(t===r+55+4)return e.readUint32();throw new K("Invalid RLP prefix")}function oBe(e,t,r,n){let o=e.position,s=[];for(;e.position-o<t;)s.push(Nse(e,r,n));if(e.position-o!==t)throw new Ky({consumed:e.position-o,declared:t});return s}var _se,pU=h(()=>{ut();O1();nw();Sr();Fe();_se=1024});function XI(e){return Ve(e)&&yt(e)===32}var fU=h(()=>{Us();Go()});function Rse(e,t,r,n){return e===0?t^r^n:e===1?t&r|~t&n:e===2?(t|~r)^n:e===3?t&n|r&~n:t^(r|~n)}var sBe,Ose,iBe,Bse,kse,Dse,Use,aBe,cBe,lBe,uBe,e9,t9,Lse,Mse=h(()=>{kk();ap();sBe=Uint8Array.from([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),Ose=Uint8Array.from(new Array(16).fill(0).map((e,t)=>t)),iBe=Ose.map(e=>(9*e+5)%16),Bse=(()=>{let r=[[Ose],[iBe]];for(let n=0;n<4;n++)for(let o of r)o.push(o[n].map(s=>sBe[s]));return r})(),kse=Bse[0],Dse=Bse[1],Use=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(e=>Uint8Array.from(e)),aBe=kse.map((e,t)=>e.map(r=>Use[t][r])),cBe=Dse.map((e,t)=>e.map(r=>Use[t][r])),lBe=Uint32Array.from([0,1518500249,1859775393,2400959708,2840853838]),uBe=Uint32Array.from([1352829926,1548603684,1836072691,2053994217,0]);e9=new Uint32Array(16),t9=class extends bw{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:t,h1:r,h2:n,h3:o,h4:s}=this;return[t,r,n,o,s]}set(t,r,n,o,s){this.h0=t|0,this.h1=r|0,this.h2=n|0,this.h3=o|0,this.h4=s|0}process(t,r){for(let f=0;f<16;f++,r+=4)e9[f]=t.getUint32(r,!0);let n=this.h0|0,o=n,s=this.h1|0,i=s,a=this.h2|0,c=a,l=this.h3|0,u=l,d=this.h4|0,p=d;for(let f=0;f<5;f++){let m=4-f,g=lBe[f],y=uBe[f],b=kse[f],C=Dse[f],w=aBe[f],x=cBe[f];for(let S=0;S<16;S++){let P=N8(n+Rse(f,s,a,l)+e9[b[S]]+g,w[S])+d|0;n=d,d=l,l=N8(a,10)|0,a=s,s=P}for(let S=0;S<16;S++){let P=N8(o+Rse(m,i,c,u)+e9[C[S]]+y,x[S])+p|0;o=p,p=u,u=N8(c,10)|0,c=i,i=P}}
62this.set(this.h1+a+u|0,this.h2+l+p|0,this.h3+d+o|0,this.h4+n+i|0,this.h0+s+c|0)}roundClean(){ia(e9)}destroy(){this.destroyed=!0,ia(this.buffer),this.set(0,0,0,0,0)}},Lse=Jy(()=>new t9)});var Hse,$se=h(()=>{Mse();Hse=Lse});function Fse(e,t){let r=t||"hex",n=Hse(Ve(e,{strict:!1})?rn(e):e);return r==="bytes"?n:vr(n)}var Vse=h(()=>{$se();Us();Sr();Fe()});var zse=h(()=>{O8()});var jse=h(()=>{yS()});var qse=h(()=>{O8()});var Wse=h(()=>{yS()});function hU(e){let{source:t}=e,r=new Map,n=new Jo(8192),o=new Map,s=({address:a,chainId:c})=>`${a}.${c}`,i=a=>{r.delete(a),o.delete(a)};return{async consume({address:a,chainId:c,client:l}){let u=s({address:a,chainId:c}),d=this.get({address:a,chainId:c,client:l});this.increment({address:a,chainId:c});let p=await d;return await t.set({address:a,chainId:c},p),n.set(u,p),p},async increment({address:a,chainId:c}){let l=s({address:a,chainId:c}),u=r.get(l)??0;r.set(l,u+1)},async get({address:a,chainId:c,client:l}){let u=s({address:a,chainId:c}),d=o.get(u);return d||(d=(async()=>{try{let f=await t.get({address:a,chainId:c,client:l}),m=n.get(u)??0;return m>0&&f<=m?m+1:(n.delete(u),f)}finally{i(u)}})(),o.set(u,d)),(r.get(u)??0)+await d},reset({address:a,chainId:c}){let l=s({address:a,chainId:c});n.delete(l),i(l)}}}function dBe(){return{async get(e){let{address:t,client:r}=e;return l0(r,{address:t,blockTag:"pending"})},set(){}}}var Kse,Zse=h(()=>{s4();hh();Kse=hU({source:dBe()})});function mb(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((o,s)=>{(async()=>{let i,a=new AbortController;try{r>0&&(i=setTimeout(()=>{n?a.abort():s(t)},r)),o(await e({signal:a?.signal||null}))}catch(c){if(a?.signal.aborted&&hi(c)){s(t);return}s(c)}finally{clearTimeout(i)}})()})}var r9=h(()=>{Dc()});function pBe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}var N4,mU=h(()=>{N4=pBe()});function Gse(e,t={}){let{url:r,headers:n}=mBe(e);return{async request(o){let{body:s,fetchFn:i=t.fetchFn??fetch,maxResponseBodySize:a=t.maxResponseBodySize??fBe,onRequest:c=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=o,d={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:p,method:f,signal:m}=d;try{let g=await mb(async({signal:C})=>{let w={...d,body:Array.isArray(s)?St(s.map(D=>({jsonrpc:"2.0",id:D.id??N4.take(),...D}))):St({jsonrpc:"2.0",id:s.id??N4.take(),...s}),headers:{...n,"Content-Type":"application/json",...p},method:f||"POST",signal:m||(u>0?C:null)},x=new Request(r,w),S=await c?.(x,w)??{...w,url:r};return await i(S.url??r,S)},{errorInstance:new mp({body:s,url:r}),timeout:u,signal:!0});l&&await l(g);let y,b=await hBe(g,{maxResponseBodySize:a});if(g.headers.get("Content-Type")?.startsWith("application/json"))y=JSON.parse(b);else{y=b;try{y=JSON.parse(y||"{}")}catch(C){if(g.ok)throw C;y={error:y}}}if(!g.ok){if(typeof y.error?.code=="number"&&typeof y.error?.message=="string")return y;throw new ts({body:s,details:St(y.error)||g.statusText,headers:g.headers,status:g.status,url:r})}return y}catch(g){throw m?.aborted?_o(m):hi(g)||g instanceof ts||g instanceof hp||g instanceof mp?g:new ts({body:s,cause:g,url:r})}}}}async function hBe(e,{maxResponseBodySize:t}){if(t===!1)return e.text();let r=e.headers.get("Content-Length");if(r){let a=Number(r);if(a>t)throw new hp({maxSize:t,size:a})}if(!e.body){let a=await e.text(),c=new TextEncoder().encode(a).length;if(c>t)throw new hp({maxSize:t,size:c});return a}let n=e.body.getReader(),o=new TextDecoder,s="",i=0;try{for(;;){let{done:a,value:c}=await n.read();if(a)break;if(i+=c.byteLength,i>t)throw await n.cancel(),new hp({maxSize:t,size:i});s+=o.decode(c,{stream:!0})}return s+=o.decode(),s}finally{n.releaseLock()}}function mBe(e){try{let t=new URL(e),r=(()=>{if(t.username){let n=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(n)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}var fBe,Yse=h(()=>{Wa();Dc();r9();To();mU();fBe=10485760});async function Jse(e){let{getSocket:t,keepAlive:r=!0,key:n="socket",reconnect:o=!0,url:s}=e,{interval:i=3e4}=typeof r=="object"?r:{},{attempts:a=5,delay:c=2e3}=typeof o=="object"?o:{},l=JSON.stringify({keepAlive:r,key:n,url:s,reconnect:o}),u=gU.get(l);if(u)return u;let d=0,{schedule:p}=tb({id:l,fn:async()=>{let g=new Map,y=new Map,b,C,w,x,S=!1,P=!1;
62function D(){if(o&&!P&&d<a){if(S)return;S=!0,d++,C?.close(),x=setTimeout(async()=>{if(x=void 0,P){S=!1;return}await U().catch(console.error),S=!1},c)}else g.clear(),y.clear()}async function U(){let N=await t({onClose(){for(let L of g.values())L.onError?.(new $l({url:s}));for(let L of y.values())L.onError?.(new $l({url:s}));D()},onError(L){b=L;for(let I of g.values())I.onError?.(b);for(let I of y.values())I.onError?.(b);D()},onOpen(){b=void 0,d=0},onResponse(L){let I=L.method==="eth_subscription",R=I?L.params.subscription:L.id,A=I?y:g,T=A.get(R);T&&T.onResponse(L),I||A.delete(R)}});if(P)return N.close(),N;if(C=N,r&&(w&&clearInterval(w),w=setInterval(()=>C.ping?.(),i)),o&&y.size>0){let L=y.entries();for(let[I,{onResponse:R,body:A,onError:T}]of L)A&&(y.delete(I),u?.request({body:A,onResponse:R,onError:T}))}return N}return await U(),b=void 0,u={close(){P=!0,w&&clearInterval(w),x&&(clearTimeout(x),x=void 0,S=!1),C.close(),gU.delete(l)},get socket(){return C},request({body:N,onError:L,onResponse:I}){b&&L&&L(b);let R=N.id??N4.take(),A=T=>{typeof T.id=="number"&&R!==T.id||(N.method==="eth_subscribe"&&typeof T.result=="string"&&y.set(T.result,{onResponse:A,onError:L,body:N}),I(T))};N.method==="eth_unsubscribe"&&y.delete(N.params?.[0]),g.set(R,{onResponse:A,onError:L});try{C.request({body:{jsonrpc:"2.0",id:R,...N}})}catch(T){L?.(T)}},requestAsync({body:N,timeout:L=1e4}){return mb(()=>new Promise((I,R)=>this.request({body:N,onError:R,onResponse:I})),{errorInstance:new mp({body:N,url:s}),timeout:L})},requests:g,subscriptions:y,url:s},gU.set(l,u),[u]}}),[f,[m]]=await p();return m}var gU,Qse=h(()=>{Wa();dI();r9();mU();gU=new Map});function Xse(){if(typeof WebSocket<"u")return WebSocket;if(typeof global.WebSocket<"u")return global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}var eie=h(()=>{});var tie={};Ce(tie,{WebSocket:()=>gBe});var gBe,rie=h(()=>{eie();gBe=Xse()});async function gb(e,t={}){let{keepAlive:r,reconnect:n}=t;return Jse({async getSocket({onClose:o,onError:s,onOpen:i,onResponse:a}){let c=await Promise.resolve().then(()=>(rie(),tie)).then(f=>f.WebSocket),l=new c(e);function u(){l.removeEventListener("close",u),l.removeEventListener("message",d),l.removeEventListener("error",s),l.removeEventListener("open",i),o()}function d({data:f}){if(!(typeof f=="string"&&f.trim().length===0))try{let m=JSON.parse(f);a(m)}catch(m){s(m)}}l.addEventListener("close",u),l.addEventListener("message",d),l.addEventListener("error",s),l.addEventListener("open",i),l.readyState===c.CONNECTING&&await new Promise((f,m)=>{l&&(l.onopen=f,l.onerror=m)});let{close:p}=l;return Object.assign(l,{close(){p.bind(l)(),u()},ping(){try{if(l.readyState===l.CLOSED||l.readyState===l.CLOSING)throw new z1({url:l.url,cause:new $l({url:l.url})});let f={jsonrpc:"2.0",id:null,method:"net_version",params:[]};l.send(JSON.stringify(f))}catch(f){s(f)}},request({body:f}){if(l.readyState===l.CLOSED||l.readyState===l.CLOSING)throw new z1({body:f,url:l.url,cause:new $l({url:l.url})});return l.send(JSON.stringify(f))}})},keepAlive:r,reconnect:n,url:e})}var yU=h(()=>{Wa();Qse()});async function nie(e){let t=await gb(e);return Object.assign(t.socket,{requests:t.requests,subscriptions:t.subscriptions})}var oie=h(()=>{yU()});var n9,wU=h(()=>{n9=`�Ethereum Signed Message:
63`});function o9(e){let t=typeof e=="string"?Fa(e):typeof e.raw=="string"?e.raw:ft(e.raw),r=Fa(`${n9}${yt(t)}`);return nn([r,t])}var bU=h(()=>{wU();Nn();Go();Fe()});function _0(e,t){return Ht(o9(e),t)}var R4=h(()=>{fi();bU()});var yb,wb,bb,xU=h(()=>{To();ut();yb=class extends K{constructor({domain:t}){super(`Invalid domain "${St(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}},wb=class extends K{constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}},bb=class extends K{constructor({type:t}){super(`Struct type "${t}
63" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}});function s9(e){let{domain:t,message:r,primaryType:n,types:o}=e,s=(c,l)=>{let u={...l};for(let d of c){let{name:p,type:f}=d;f==="address"&&(u[p]=u[p].toLowerCase())}return u},i=o.EIP712Domain?t?s(o.EIP712Domain,t):{}:{},a=(()=>{if(n!=="EIP712Domain")return s(o[n],r)})();return St({domain:i,message:a,primaryType:n,types:o})}function xb(e){let{domain:t,message:r,primaryType:n,types:o}=e,s=(i,a)=>{for(let c of i){let{name:l,type:u}=c,d=a[l],p=u.match(Xy);if(p&&(typeof d=="number"||typeof d=="bigint")){let[g,y,b]=p;re(d,{signed:y==="int",size:Number.parseInt(b,10)/8})}if(u==="address"&&typeof d=="string"&&!Dt(d))throw new mr({address:d});let f=u.match(wS);if(f){let[g,y]=f;if(y&&yt(d)!==Number.parseInt(y,10))throw new uh({expectedSize:Number.parseInt(y,10),givenSize:yt(d)})}let m=o[u];m&&(yBe(u),s(m,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new yb({domain:t});s(o.EIP712Domain,t)}if(n!=="EIP712Domain")if(o[n])s(o[n],r);else throw new wb({primaryType:n,types:o})}function cg({domain:e}){return[typeof e?.name=="string"&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},(typeof e?.chainId=="number"||typeof e?.chainId=="bigint")&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}function sie({domain:e}){return O4({domain:e,types:{EIP712Domain:cg({domain:e})}})}function yBe(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new bb({type:e})}var i9=h(()=>{zr();Va();xU();Hs();Go();Fe();bS();B4();To()});function vb(e){let{domain:t={},message:r,primaryType:n}=e,o={EIP712Domain:cg({domain:t}),...e.types};xb({domain:t,message:r,primaryType:n,types:o});let s=["0x1901"];return t&&s.push(O4({domain:t,types:o})),n!=="EIP712Domain"&&s.push(a9({data:r,primaryType:n,types:o})),Ht(nn(s))}function O4({domain:e,types:t}){return a9({data:e,primaryType:"EIP712Domain",types:t})}function a9({data:e,primaryType:t,types:r}){let n=iie({data:e,primaryType:t,types:r});return Ht(n)}function iie({data:e,primaryType:t,types:r}){let n=[{type:"bytes32"}],o=[wBe({primaryType:t,types:r})];for(let s of r[t]){let[i,a]=cie({types:r,name:s.name,type:s.type,value:e[s.name]});n.push(i),o.push(a)}return Kn(n,o)}function wBe({primaryType:e,types:t}){let r=vr(bBe({primaryType:e,types:t}));return Ht(r)}function bBe({primaryType:e,types:t}){let r="",n=aie({primaryType:e,types:t});n.delete(e);let o=[e,...Array.from(n).sort()];for(let s of o)r+=`${s}(${t[s].map(({name:i,type:a})=>`${a} ${i}`).join(",")})`;return r}function aie({primaryType:e,types:t},r=new Set){let o=e.match(/^\w*/u)?.[0];if(r.has(o)||t[o]===void 0)return r;r.add(o);for(let s of t[o])aie({primaryType:s.type,types:t},r);return r}function cie({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},Ht(iie({data:n,primaryType:r,types:e}))];if(r==="bytes")return[{type:"bytes32"},Ht(n)];if(r==="string")return[{type:"bytes32"},Ht(vr(n))];if(r.lastIndexOf("]")===r.length-1){let o=r.slice(0,r.lastIndexOf("[")),s=n.map(i=>cie({name:t,type:o,types:e,value:i}));return[{type:"bytes32"},Ht(Kn(s.map(([i])=>i),s.map(([,i])=>i)))]}return[{type:r},n]}var B4=h(()=>{Bc();Nn();Fe();fi();i9()});var c9,lie,l9=h(()=>{c9="0x6492649264926492649264926492649264926492649264926492649264926492",lie="0x0000000000000000000000000000000000000000000000000000000000000000"});function u9(e){return Ll(e,-32)===c9}var vU=h(()=>{l9();aa()});var d9,uie=h(()=>{d9=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});var xBe,p9,die=h(()=>{uie();xBe={checksum:new d9(8192)},p9=xBe.checksum});function lg(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=gS(Gne(e));return r==="Bytes"?n:Cn(n)}var f9=h(()=>{bk();m0();uo()});function pie(e,t={}){let{compressed:r}=t,{prefix:n,x:o,y:s}=e;if(r===!1||typeof o=="bigint"&&typeof s=="bigint"){if(n!==4)throw new h9({prefix:n,cause:new SU});return}if(r===!0||typeof o=="bigint"&&typeof s>"u"){if(n!==3&&n!==2)throw new h9({prefix:n,cause:new CU});return}throw new AU({publicKey:e})}function fie(e){let t=(()=>
63{if(y4(e))return hie(e);if(toe(e))return EBe(e);let{prefix:r,x:n,y:o}=e;return typeof n=="bigint"&&typeof o=="bigint"?{prefix:r??4,x:n,y:o}:{prefix:r,x:n}})();return pie(t),t}function EBe(e){return hie(Cn(e))}function hie(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new IU({publicKey:e});if(e.length===130){let n=BigInt(Zr(e,0,32)),o=BigInt(Zr(e,32,64));return{prefix:4,x:n,y:o}}if(e.length===132){let n=Number(Zr(e,0,1)),o=BigInt(Zr(e,1,33)),s=BigInt(Zr(e,33,65));return{prefix:n,x:o,y:s}}let t=Number(Zr(e,0,1)),r=BigInt(Zr(e,1,33));return{prefix:t,x:r}}function TU(e,t={}){pie(e);let{prefix:r,x:n,y:o}=e,{includePrefix:s=!0}=t;return on(s?Qt(r,{size:1}):"0x",Qt(n,{size:32}),typeof o=="bigint"?Qt(o,{size:32}):"0x")}var AU,h9,CU,SU,IU,_U=h(()=>{m0();xi();uo();m4();AU=class extends ze{constructor({publicKey:t}){super(`Value \`${g0(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}},h9=class extends ze{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}},CU=class extends ze{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}},SU=class extends ze{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}},IU=class extends ze{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${Kr(qw(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}});function ug(e,t={}){let{strict:r=!0}=t;if(!ABe.test(e))throw new m9({address:e,cause:new PU});if(r){if(e.toLowerCase()===e)return;if(g9(e)!==e)throw new m9({address:e,cause:new NU})}}function g9(e){if(p9.has(e))return p9.get(e);ug(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=lg(Yne(t),{as:"Bytes"}),n=t.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(r[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());let o=`0x${n.join("")}`;return p9.set(e,o),o}function CBe(e,t={}){let{checksum:r=!1}=t;return ug(e),r?g9(e):e}function gie(e,t={}){let r=lg(`0x${TU(e).slice(4)}`).substring(26);return CBe(`0x${r}`,t)}function y9(e,t={}){let{strict:r=!0}=t??{};try{return ug(e,{strict:r}),!0}catch{return!1}}var ABe,m9,PU,NU,k4=h(()=>{m0();die();xi();f9();_U();ABe=/^0x[a-fA-F0-9]{40}$/;m9=class extends ze{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},PU=class extends ze{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},NU=class extends ze{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}});var yie,wie,b9,l3t,u3t,d3t,p3t,f3t,h3t,m3t,g3t,y3t,w3t,b3t,x3t,v3t,E3t,A3t,C3t,S3t,I3t,T3t,_3t,P3t,N3t,R3t,O3t,B3t,k3t,D3t,U3t,L3t,M3t,H3t,$3t,F3t,V3t,z3t,j3t,q3t,W3t,K3t,Z3t,G3t,Y3t,J3t,Q3t,X3t,evt,tvt,rvt,nvt,ovt,svt,ivt,avt,cvt,lvt,uvt,dvt,pvt,fvt,hvt,mvt,gvt,yvt,wvt,bvt,xvt,vvt,Evt,Avt,Cvt,Svt,Ivt,Tvt,_vt,Pvt,Nvt,Rvt,Ovt,Bvt,kvt,Dvt,Uvt,Lvt,Mvt,Hvt,$vt,Fvt,Vvt,zvt,jvt,qvt,Wvt,Kvt,Zvt,Gvt,RU,x9=h(()=>{yie=/^(.*)\[([0-9]*)\]$/,wie=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,b9=/^(u?int)(8|
6316|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,l3t=2n**(8n-1n)-1n,u3t=2n**(16n-1n)-1n,d3t=2n**(24n-1n)-1n,p3t=2n**(32n-1n)-1n,f3t=2n**(40n-1n)-1n,h3t=2n**(48n-1n)-1n,m3t=2n**(56n-1n)-1n,g3t=2n**(64n-1n)-1n,y3t=2n**(72n-1n)-1n,w3t=2n**(80n-1n)-1n,b3t=2n**(88n-1n)-1n,x3t=2n**(96n-1n)-1n,v3t=2n**(104n-1n)-1n,E3t=2n**(112n-1n)-1n,A3t=2n**(120n-1n)-1n,C3t=2n**(128n-1n)-1n,S3t=2n**(136n-1n)-1n,I3t=2n**(144n-1n)-1n,T3t=2n**(152n-1n)-1n,_3t=2n**(160n-1n)-1n,P3t=2n**(168n-1n)-1n,N3t=2n**(176n-1n)-1n,R3t=2n**(184n-1n)-1n,O3t=2n**(192n-1n)-1n,B3t=2n**(200n-1n)-1n,k3t=2n**(208n-1n)-1n,D3t=2n**(216n-1n)-1n,U3t=2n**(224n-1n)-1n,L3t=2n**(232n-1n)-1n,M3t=2n**(240n-1n)-1n,H3t=2n**(248n-1n)-1n,$3t=2n**(256n-1n)-1n,F3t=-(2n**(8n-1n)),V3t=-(2n**(16n-1n)),z3t=-(2n**(24n-1n)),j3t=-(2n**(32n-1n)),q3t=-(2n**(40n-1n)),W3t=-(2n**(48n-1n)),K3t=-(2n**(56n-1n)),Z3t=-(2n**(64n-1n)),G3t=-(2n**(72n-1n)),Y3t=-(2n**(80n-1n)),J3t=-(2n**(88n-1n)),Q3t=-(2n**(96n-1n)),X3t=-(2n**(104n-1n)),evt=-(2n**(112n-1n)),tvt=-(2n**(120n-1n)),rvt=-(2n**(128n-1n)),nvt=-(2n**(136n-1n)),ovt=-(2n**(144n-1n)),svt=-(2n**(152n-1n)),ivt=-(2n**(160n-1n)),avt=-(2n**(168n-1n)),cvt=-(2n**(176n-1n)),lvt=-(2n**(184n-1n)),uvt=-(2n**(192n-1n)),dvt=-(2n**(200n-1n)),pvt=-(2n**(208n-1n)),fvt=-(2n**(216n-1n)),hvt=-(2n**(224n-1n)),mvt=-(2n**(232n-1n)),gvt=-(2n**(240n-1n)),yvt=-(2n**(248n-1n)),wvt=-(2n**(256n-1n)),bvt=2n**8n-1n,xvt=2n**16n-1n,vvt=2n**24n-1n,Evt=2n**32n-1n,Avt=2n**40n-1n,Cvt=2n**48n-1n,Svt=2n**56n-1n,Ivt=2n**64n-1n,Tvt=2n**72n-1n,_vt=2n**80n-1n,Pvt=2n**88n-1n,Nvt=2n**96n-1n,Rvt=2n**104n-1n,Ovt=2n**112n-1n,Bvt=2n**120n-1n,kvt=2n**128n-1n,Dvt=2n**136n-1n,Uvt=2n**144n-1n,Lvt=2n**152n-1n,Mvt=2n**160n-1n,Hvt=2n**168n-1n,$vt=2n**176n-1n,Fvt=2n**184n-1n,Vvt=2n**192n-1n,zvt=2n**200n-1n,jvt=2n**208n-1n,qvt=2n**216n-1n,Wvt=2n**224n-1n,Kvt=2n**232n-1n,Zvt=2n**240n-1n,Gvt=2n**248n-1n,RU=2n**256n-1n});function dg(e,t,r){let{checksumAddress:n,staticPosition:o}=r,s=kU(t.type);if(s){let[i,a]=s;return IBe(e,{...t,type:a},{checksumAddress:n,length:i,staticPosition:o})}if(t.type==="tuple")return NBe(e,t,{checksumAddress:n,staticPosition:o});if(t.type==="address")return SBe(e,{checksum:n});if(t.type==="bool")return TBe(e);if(t.type.startsWith("bytes"))return _Be(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return PBe(e,t);if(t.type==="string")return RBe(e,{staticPosition:o});throw new Eb(t.type)}function SBe(e,t={}){let{checksum:r=!1}=t,n=e.readBytes(32);return[(s=>r?g9(s):s)(Cn(Jne(n,-20))),32]}function IBe(e,t,r){let{checksumAddress:n,length:o,staticPosition:s}=r;if(!o){let c=Jl(e.readBytes(OU)),l=s+c,u=l+xie;e.setPosition(l);let d=Jl(e.readBytes(xie)),p=D4(t),f=0,m=[];for(let g=0;g<d;++g){e.setPosition(u+(p?g*32:f));let[y,b]=dg(e,t,{checksumAddress:n,staticPosition:u});f+=b,m.push(y)}return e.setPosition(s+32),[m,32]}if(D4(t)){let c=Jl(e.readBytes(OU)),l=s+c,u=[];for(let d=0;d<o;++d){e.setPosition(l+d*32);let[p]=dg(e,t,{checksumAddress:n,staticPosition:l});u.push(p)}return e.setPosition(s+32),[u,32]}let i=0,a=[];for(let c=0;c<o;++c){let[l,u]=dg(e,t,{checksumAddress:n,staticPosition:s+i});i+=u,a.push(l)}return[a,i]}function TBe(e){return[Xne(e.readBytes(32),{size:32}),32]}function _Be(e,t,{staticPosition:r}){let[n,o]=t.type.split("bytes");if(!o){let i=Jl(e.readBytes(32));e.setPosition(r+i);let a=Jl(e.readBytes(32));if(a===0)return e.setPosition(r+32),["0x",32];let c=e.readBytes(a);return e.setPosition(r+32),[Cn(c),32]}return[Cn(e.readBytes(Number.parseInt(o,10),32)),32]}function PBe(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256",10),o=e.readBytes(32);return[n>48?Qne(o,{signed:r}):Jl(o,{signed:r}),32]}function NBe(e,t,r){let{checksumAddress:n,staticPosition:o}=r,s=t.components.length===0||t.components.some(({name:c})=>!c),i=s?[]:{},a=0;if(D4(t)){let c=Jl(e.readBytes(OU)),l=o+c;for(let u=0;u<t.components.length;++u){let d=t.components[u];e.setPosition(l+a);let[p,f]=dg(e,d,{checksumAddress:n,staticPosition:l});a+=f,i[s?u:d?.name]=p}return e.setPosition(o+32),[i,32]}for(let c=0;c<t.components.length;++c){let l=t.components[c],[u,d]=dg(e,l,{checksumAddress:n,staticPosition:o});i[s?c:l?.name]=u,a+=d}return[i,a]}function RBe(e,{staticPosition:t}){let r=Jl(e.readBytes(32)),n=t+r;e.setPosition(n);let o=Jl(e.readBytes(32));if(o===0)return e.setPosition(t+32),["",32];let s=e.readBytes(o,32),i=eoe(SD(s));return e.setPosition(t+32),[i,32]}function vie({checksumAddress:e,parameters:t,values:r}){let n=[];for(let o=0;o<t.length;o++)n.push(BU({checksumAddress:e,parameter:t[o],value:r[o]}));return n}function BU({checksumAddress:e=!1,parameter:t,value:r}){let n=t,o=kU(n.type);if(o){let[s,i]=o;return BBe(r,{checksumAddress:e,length:s,parameter:{...n,type:i}})}if(n.type==="tuple")return MBe(r,{checksumAddress:e,parameter:n});if(n.type==="address")return OBe(r,{checksum:e});if(n.type==="bool")return DBe(r);if(n.type.startsWith("uint")||n.type.startsWith("int")){let s=n.type.startsWith("int"),[,,i="256"]=b9.exec(n.type)??[];return UBe(r,{signed:s,size:Number(i)})}if(n.type.startsWith("bytes"))return kBe(r,{type:n.type});if(n.type==="string")return LBe(r);throw new Eb(n.type)}function v9(e){let t=0;for(let s=0;s<e.length;s++){let{dynamic:i,encoded:a}=e[s];i?t+=32:t+=Kr(a)}let r=[],n=[],o=0;for(let s=0;s<e.length;s++){let{dynamic:i,encoded:a}=e[s];i?(r.push(Qt(t+o,{size:32})),n.push(a),o+=Kr(a)):r.push(a)}return on(...r,...n)}function OBe(e,t){let{checksum:r=!1}=t;return ug(e,{strict:r}),{dynamic:!1,encoded:Tp(e.toLowerCase())}}function BBe(e,t){let{checksumAddress:r,length:n,parameter:o}=t,s=n===null;if(!Array.isArray(e))throw new A9(e);
63if(!s&&e.length!==n)throw new E9({expectedLength:n,givenLength:e.length,type:`${o.type}[${n}]`});let i=!1,a=[];for(let c=0;c<e.length;c++){let l=BU({checksumAddress:r,parameter:o,value:e[c]});l.dynamic&&(i=!0),a.push(l)}if(s||i){let c=v9(a);if(s){let l=Qt(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?on(l,c):l}}if(i)return{dynamic:!0,encoded:c}}return{dynamic:!1,encoded:on(...a.map(({encoded:c})=>c))}}function kBe(e,{type:t}){let[,r]=t.split("bytes"),n=Kr(e);if(!r){let o=e;return n%32!==0&&(o=Ql(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:on(Tp(Qt(n,{size:32})),o)}}if(n!==Number.parseInt(r,10))throw new U4({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:Ql(e)}}function DBe(e){if(typeof e!="boolean")throw new ze(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Tp(sI(e))}}function UBe(e,{signed:t,size:r}){if(typeof r=="number"){let n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||e<o)throw new g4({max:n.toString(),min:o.toString(),signed:t,size:r/8,value:e.toString()})}return{dynamic:!1,encoded:Qt(e,{size:32,signed:t})}}function LBe(e){let t=Ww(e),r=Math.ceil(Kr(t)/32),n=[];for(let o=0;o<r;o++)n.push(Ql(Zr(t,o*32,(o+1)*32)));return{dynamic:!0,encoded:on(Ql(Qt(Kr(t),{size:32})),...n)}}function MBe(e,t){let{checksumAddress:r,parameter:n}=t,o=!1,s=[];for(let i=0;i<n.components.length;i++){let a=n.components[i],c=Array.isArray(e)?i:a.name,l=BU({checksumAddress:r,parameter:a,value:e[c]});s.push(l),l.dynamic&&(o=!0)}return{dynamic:o,encoded:o?v9(s):on(...s.map(({encoded:i})=>i))}}function kU(e){let t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function D4(e){let{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(D4);let r=kU(e.type);return!!(r&&D4({...e,type:r[1]}))}var xie,OU,Eie=h(()=>{Ab();k4();m0();xi();uo();x9();xie=32,OU=32});function S9(e,{recursiveReadLimit:t=8192}={}){let r=Object.create($Be);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}var $Be,C9,DU,UU,LU=h(()=>{xi();$Be={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new UU({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new DU({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new C9({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new C9({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};C9=class extends ze{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}},DU=class extends ze{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}},UU=class extends ze{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}});function Cb(e,t,r={}){let{as:n="Array",checksumAddress:o=!1}=r,s=typeof t=="string"?jw(t):t,i=S9(s);if(Ga(s)===0&&e.length>0)throw new $U;if(Ga(s)&&Ga(s)<32)throw new HU({data:typeof t=="string"?t:Cn(t),parameters:e,size:Ga(s)});let a=0,c=n==="Array"?[]:{};for(let l=0;l<e.length;++l){let u=e[l];i.setPosition(a);let[d,p]=dg(i,u,{checksumAddress:o,staticPosition:0});a+=p,n==="Array"?c.push(d):c[u.name??l]=d}return c}function P0(e,t,r){let{checksumAddress:n=!1}=r??{};if(e.length!==t.length)throw new I9({expectedLength:e.length,givenLength:t.length});let o=vie({checksumAddress:n,parameters:e,values:t}),s=v9(o);return s.length===0?"0x":s}function MU(e,t){if(e.length!==t.length)throw new I9({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n];
63r.push(MU.encode(o,s))}return on(...r)}function M4(e){return Array.isArray(e)&&typeof e[0]=="string"?Ny(e):typeof e=="string"?Ny(e):e}var HU,$U,E9,U4,I9,A9,Eb,Ab=h(()=>{Ry();k4();m0();xi();uo();Eie();LU();x9();(function(e){function t(r,n,o=!1){if(r==="address"){let c=n;return ug(c),Tp(c.toLowerCase(),o?32:0)}if(r==="string")return Ww(n);if(r==="bytes")return n;if(r==="bool")return Tp(sI(n),o?32:1);let s=r.match(b9);if(s){let[c,l,u="256"]=s,d=Number.parseInt(u,10)/8;return Qt(n,{size:o?32:d,signed:l==="int"})}let i=r.match(wie);if(i){let[c,l]=i;if(Number.parseInt(l,10)!==(n.length-2)/2)throw new U4({expectedSize:Number.parseInt(l,10),value:n});return Ql(n,o?32:0)}let a=r.match(yie);if(a&&Array.isArray(n)){let[c,l]=a,u=[];for(let d=0;d<n.length;d++)u.push(t(l,n[d],!0));return u.length===0?"0x":on(...u)}throw new Eb(r)}e.encode=t})(MU||(MU={}));HU=class extends ze{constructor({data:t,parameters:r,size:n}){super(`Data size of ${n} bytes is too small for given parameters.`,{metaMessages:[`Params: (${rp(r)})`,`Data:   ${t} (${n} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}},$U=class extends ze{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}},E9=class extends ze{constructor({expectedLength:t,givenLength:r,type:n}){super(`Array length mismatch for type \`${n}\`. Expected: \`${t}\`. Given: \`${r}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}},U4=class extends ze{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${Kr(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},I9=class extends ze{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(`
64`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},A9=class extends ze{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}},Eb=class extends ze{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}});function FBe(e,t){let{as:r}=t,n=Sie(e),o=S9(new Uint8Array(n.length));return n.encode(o),r==="Hex"?Cn(o.bytes):o.bytes}function Cie(e,t={}){let{as:r="Hex"}=t;return FBe(e,{as:r})}function Sie(e){return Array.isArray(e)?VBe(e.map(t=>Sie(t))):zBe(e)}function VBe(e){let t=e.reduce((o,s)=>o+s.length,0),r=Iie(t);return{length:t<=55?1+t:1+r+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+r),r===1?o.pushUint8(t):r===2?o.pushUint16(t):r===3?o.pushUint24(t):o.pushUint32(t));for(let{encode:s}of e)s(o)}}}function zBe(e){let t=typeof e=="string"?jw(e):e,r=Iie(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+r),r===1?o.pushUint8(t.length):r===2?o.pushUint16(t.length):r===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function Iie(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new ze("Length is too large.")}var Tie=h(()=>{m0();xi();uo();LU()});function qU(e,t={}){let{recovered:r}=t;if(typeof e.r>"u")throw new H4({signature:e});if(typeof e.s>"u")throw new H4({signature:e});if(r&&typeof e.yParity>"u")throw new H4({signature:e});if(e.r<0n||e.r>RU)throw new VU({value:e.r});if(e.s<0n||e.s>RU)throw new zU({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new $4({value:e.yParity})}function qBe(e){return _ie(Cn(e))}function _ie(e){if(e.length!==130&&e.length!==132)throw new FU({signature:e});let t=BigInt(Zr(e,0,32)),r=BigInt(Zr(e,32,64)),n=(()=>{let o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return ZU(o)}catch{throw new $4({value:o})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function WU(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return KU(e)}function KU(e){let t=typeof e=="string"?_ie(e):e instanceof Uint8Array?qBe(e):typeof e.r=="string"?KBe(e):e.v?WBe(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return qU(t),t}function WBe(e){return{r:e.r,s:e.s,yParity:ZU(e.v)}}function KBe(e){let t=(()=>{let r=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=ZU(r)),typeof n!="number")throw new $4({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function Pie(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":TD(Qt(t)),r===0n?"0x":TD(Qt(r))]}function ZU(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new jU({value:e})}var FU,H4,VU,zU,$4,jU,GU=h(()=>{xi();uo();m4();x9();FU=class extends ze{constructor({signature:t}){super(`Value \`${t}
64\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Kr(qw(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}},H4=class extends ze{constructor({signature:t}){super(`Signature \`${g0(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}},VU=class extends ze{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}},zU=class extends ze{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}},$4=class extends ze{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}},jU=class extends ze{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}});function Rie(e,t={}){return typeof e.chainId=="string"?ZBe(e):{...e,...t.signature}}function ZBe(e){let{address:t,chainId:r,nonce:n}=e,o=WU(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...o}}function Oie(e){return GBe(e,{presign:!0})}function GBe(e,t={}){let{presign:r}=t;return lg(on("0x05",Cie(YBe(r?{address:e.address,chainId:e.chainId,nonce:e.nonce}:e))))}function YBe(e){let{address:t,chainId:r,nonce:n}=e,o=WU(e);return[r?Qt(r):"0x",t,n?Qt(n):"0x",...o?Pie(o):[]]}var Bie=h(()=>{f9();uo();Tie();GU()});function kie(e){return gie(QBe(e))}function QBe(e){let{payload:t,signature:r}=e,{r:n,s:o,yParity:s}=r,a=new js.Signature(BigInt(n),BigInt(o)).addRecoveryBit(s).recoverPublicKey(qw(t).substring(2));return fie(a)}var Die=h(()=>{Z1();k4();uo();_U()});var zc={};Ce(zc,{InvalidWrappedSignatureError:()=>T9,assert:()=>_9,from:()=>eke,magicBytes:()=>YU,suffixParameters:()=>JU,unwrap:()=>Uie,validate:()=>rke,wrap:()=>tke});function _9(e){if(typeof e=="string"){if(Zr(e,-32)!==YU)throw new T9(e)}else qU(e.authorization)}function eke(e){return typeof e=="string"?Uie(e):e}function Uie(e){_9(e);let t=rI(Zr(e,-64,-32)),r=Zr(e,-t-64,-64),n=Zr(e,0,-t-64),[o,s,i]=Cb(JU,r);return{authorization:Rie({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:n,...i&&i!=="0x"?{data:i,to:s}:{}}}function tke(e){let{data:t,signature:r}=e;_9(e);let n=kie({payload:Oie(e.authorization),signature:KU(e.authorization)}),o=P0(JU,[{...e.authorization,delegation:e.authorization.address,chainId:BigInt(e.authorization.chainId)},e.to??n,t??"0x"]),s=Qt(Kr(o),{size:32});return on(r,o,s,YU)}function rke(e){try{return _9(e),!0}catch{return!1}}var YU,JU,T9,Lie=h(()=>{Ab();Bie();xi();uo();Die();GU();YU="0x8010801080108010801080108010801080108010801080108010801080108010",JU=M4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");T9=class extends ze{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}}});var F4=h(()=>{Lie()});function P9(e){return zc.validate(e)}var QU=h(()=>{F4()});function Mie(e){if(!u9(e))return{signature:e};let[t,r,n]=$s([{type:"address"},{type:"bytes"},{type:"bytes"}],e);return{address:t,data:r,signature:n}}var Hie=h(()=>{gh();vU()});function $ie(e){if(!P9(e))return{signature:e};let{authorization:t,to:r,...n}=zc.unwrap(e);return{authorization:{address:t.address,chainId:t.chainId,nonce:Number(t.nonce),r:re(t.r,{size:32}),s:re(t.s,{size:32}),yParity:t.yParity},...r?{address:r}:{},...n}}var Fie=h(()=>{F4();Fe();QU()});async function N9({message:e,signature:t}){return qs({hash:_0(e),signature:t})}var XU=h(()=>{R4();Kh()});async function R9(e){let{domain:t,message:r,primaryType:n,signature:o,types:s}=e;return qs({hash:vb({domain:t,message:r,primaryType:n,types:s}),signature:o})}var eL=h(()=>{B4();Kh()});function Vie(e){let{address:t,data:r,signature:n,to:o="hex"}
64=e,s=ur([Kn([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,r,n]),c9]);return o==="hex"?s:zt(s)}var zie=h(()=>{l9();Bc();Nn();Sr()});function jie(e){let{address:t,data:r,signature:n,to:o="hex"}=e,s=zc.wrap({authorization:{address:e.authorization.address,chainId:e.authorization.chainId,nonce:BigInt(e.authorization.nonce),r:BigInt(e.authorization.r),s:BigInt(e.authorization.s),yParity:e.authorization.yParity},data:r,signature:n,to:t});return o==="hex"?s:zt(s)}var qie=h(()=>{F4();Sr()});async function Wie({address:e,hash:t,signature:r}){return Or(qr(e),await qs({hash:t,signature:r}))}var Kie=h(()=>{Ms();fa();Kh()});async function Zie({address:e,message:t,signature:r}){return Or(qr(e),await N9({message:t,signature:r}))}var Gie=h(()=>{Ms();fa();XU()});async function Yie(e){let{address:t,domain:r,message:n,primaryType:o,signature:s,types:i}=e;return Or(qr(t),await R9({domain:r,message:n,primaryType:o,signature:s,types:i}))}var Jie=h(()=>{Ms();fa();eL()});function O9(e){let t=Ll(e,0,1);if(t==="0x04")return"eip7702";if(t==="0x03")return"eip4844";if(t==="0x02")return"eip1559";if(t==="0x01")return"eip2930";if(t!=="0x"&&ht(t)>=192)return"legacy";throw new pw({serializedType:t})}var tL=h(()=>{es();aa();tn()});function B9(e){let t=O9(e);return t==="eip1559"?ske(e):t==="eip2930"?ike(e):t==="eip4844"?oke(e):t==="eip7702"?nke(e):ake(e)}function nke(e){let t=k9(e),[r,n,o,s,i,a,c,l,u,d,p,f,m]=t;if(t.length!==10&&t.length!==13)throw new Ml({attributes:{chainId:r,nonce:n,maxPriorityFeePerGas:o,maxFeePerGas:s,gas:i,to:a,value:c,data:l,accessList:u,authorizationList:d,...t.length>9?{v:p,r:f,s:m}:{}},serializedTransaction:e,type:"eip7702"});let g={chainId:ht(r),type:"eip7702"};return Ve(a)&&a!=="0x"&&(g.to=a),Ve(i)&&i!=="0x"&&(g.gas=at(i)),Ve(l)&&l!=="0x"&&(g.data=l),Ve(n)&&(g.nonce=n==="0x"?0:ht(n)),Ve(c)&&c!=="0x"&&(g.value=at(c)),Ve(s)&&s!=="0x"&&(g.maxFeePerGas=at(s)),Ve(o)&&o!=="0x"&&(g.maxPriorityFeePerGas=at(o)),u.length!==0&&u!=="0x"&&(g.accessList=D9(u)),d.length!==0&&d!=="0x"&&(g.authorizationList=cke(d)),KI(g),{...t.length===13?V4(t):void 0,...g}}function oke(e){let t=k9(e),r=t.length===4,n=r?t[0]:t,o=r?t.slice(1):[],[s,i,a,c,l,u,d,p,f,m,g,y,b,C]=n,[w,x,S]=o;if(!(n.length===11||n.length===14))throw new Ml({attributes:{chainId:s,nonce:i,maxPriorityFeePerGas:a,maxFeePerGas:c,gas:l,to:u,value:d,data:p,accessList:f,...n.length>9?{v:y,r:b,s:C}:{}},serializedTransaction:e,type:"eip4844"});let P={blobVersionedHashes:g,chainId:ht(s),to:u,type:"eip4844"};return Ve(l)&&l!=="0x"&&(P.gas=at(l)),Ve(p)&&p!=="0x"&&(P.data=p),Ve(i)&&(P.nonce=i==="0x"?0:ht(i)),Ve(d)&&d!=="0x"&&(P.value=at(d)),Ve(m)&&m!=="0x"&&(P.maxFeePerBlobGas=at(m)),Ve(c)&&c!=="0x"&&(P.maxFeePerGas=at(c)),Ve(a)&&a!=="0x"&&(P.maxPriorityFeePerGas=at(a)),f.length!==0&&f!=="0x"&&(P.accessList=D9(f)),w&&x&&S&&(P.sidecars=p0({blobs:w,commitments:x,proofs:S})),ZI(P),{...n.length===14?V4(n):void 0,...P}}function ske(e){let t=k9(e),[r,n,o,s,i,a,c,l,u,d,p,f]=t;if(!(t.length===9||t.length===12))throw new Ml({attributes:{chainId:r,nonce:n,maxPriorityFeePerGas:o,maxFeePerGas:s,gas:i,to:a,value:c,data:l,accessList:u,...t.length>9?{v:d,r:p,s:f}:{}},serializedTransaction:e,type:"eip1559"});let m={chainId:ht(r),type:"eip1559"};return Ve(a)&&a!=="0x"&&(m.to=a),Ve(i)&&i!=="0x"&&(m.gas=at(i)),Ve(l)&&l!=="0x"&&(m.data=l),Ve(n)&&(m.nonce=n==="0x"?0:ht(n)),Ve(c)&&c!=="0x"&&(m.value=at(c)),Ve(s)&&s!=="0x"&&(m.maxFeePerGas=at(s)),Ve(o)&&o!=="0x"&&(m.maxPriorityFeePerGas=at(o)),u.length!==0&&u!=="0x"&&(m.accessList=D9(u)),T0(m),{...t.length===12?V4(t):void 0,...m}}function ike(e){let t=k9(e),[r,n,o,s,i,a,c,l,u,d,p]=t;if(!(t.length===8||t.length===11))throw new Ml({attributes:{chainId:r,nonce:n,gasPrice:o,gas:s,to:i,value:a,data:c,accessList:l,...t.length>8?{v:u,r:d,s:p}:{}},serializedTransaction:e,type:"eip2930"});let f={chainId:ht(r),type:"eip2930"};return Ve(i)&&i!=="0x"&&(f.to=i),Ve(s)&&s!=="0x"&&(f.gas=at(s)),Ve(c)&&c!=="0x"&&(f.data=c),Ve(n)&&(f.nonce=n==="0x"?0:ht(n)),Ve(a)&&a!=="0x"&&(f.value=at(a)),Ve(o)&&o!=="0x"&&(f.gasPrice=at(o)),l.length!==0&&l!=="0x"&&(f.accessList=D9(l)),pb(f),{...t.length===11?V4(t):void 0,...f}}function ake(e){let t=P4(e,"hex"),[r,n,o,s,i,a,c,l,u]=t;if(!(t.length===6||t.length===9))throw new Ml({attributes:{nonce:r,gasPrice:n,gas:o,to:s,value:i,data:a,...t.length>6?{v:c,r:l,s:u}:{}},serializedTransaction:e,type:"legacy"});let d={type:"legacy"};
64if(Ve(s)&&s!=="0x"&&(d.to=s),Ve(o)&&o!=="0x"&&(d.gas=at(o)),Ve(a)&&a!=="0x"&&(d.data=a),Ve(r)&&(d.nonce=r==="0x"?0:ht(r)),Ve(i)&&i!=="0x"&&(d.value=at(i)),Ve(n)&&n!=="0x"&&(d.gasPrice=at(n)),fb(d),t.length===6)return d;let p=Ve(c)&&c!=="0x"?at(c):0n;if(u==="0x"&&l==="0x")return p>0&&(d.chainId=Number(p)),d;let f=p,m=Number((f-35n)/2n);if(m>0)d.chainId=m;else if(f!==27n&&f!==28n)throw new bh({v:f});return d.v=f,d.s=u,d.r=l,d.yParity=f%2n===0n?1:0,d}function k9(e){return P4(`0x${e.slice(4)}`,"hex")}function D9(e){let t=[];for(let r=0;r<e.length;r++){let[n,o]=e[r];if(!Dt(n,{strict:!1}))throw new mr({address:n});t.push({address:n,storageKeys:o.map(s=>XI(s)?s:jr(s))})}return t}function cke(e){let t=[];for(let r=0;r<e.length;r++){let[n,o,s,i,a,c]=e[r];t.push({address:o,chainId:n==="0x"?0:ht(n),nonce:s==="0x"?0:ht(s),...V4([i,a,c])})}return t}function V4(e){let t=e.slice(-3),r=t[0]==="0x"?0n:at(t[0]);if(r!==0n&&r!==1n)throw new uw({yParity:r});let n=r===0n?27n:28n;return{r:pi(t[1],{size:32}),s:pi(t[2],{size:32}),v:n,yParity:n===27n?0:1}}var rL=h(()=>{Va();es();Hs();c4();Us();ph();op();tn();pU();fU();GI();tL()});var Sb,nL=h(()=>{ut();Sb=class extends K{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}});function N0(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new Sb({value:e});let[r,n="0"]=e.split("."),o=r.startsWith("-");if(o&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),t===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>t){let[s,i,a]=[n.slice(0,t-1),n.slice(t-1,t),n.slice(t)],c=Math.round(+`${i}.${a}`);c>9?n=`${BigInt(s)+BigInt(1)}0`.padStart(s.length+1,"0"):n=`${s}${c}`,n.length>t&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,t)}else n=n.padEnd(t,"0");return BigInt(`${o?"-":""}${r}${n}`)}var z4=h(()=>{nL()});function Qie(e,t="wei"){return N0(e,sw[t])}var Xie=h(()=>{aw();z4()});function eae(e,t="wei"){return N0(e,iw[t])}var tae=h(()=>{aw();z4()});var U9=h(()=>{Io();tn()});function lke(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function rae(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?ht(e.nonce):void 0,storageProof:e.storageProof?lke(e.storageProof):void 0}}var nae=h(()=>{U9()});async function oae(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:s,storageKeys:i}){let a=pa({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s}),c=await e.request({method:"eth_getProof",params:[t,i,a]});return rae(c)}var sae=h(()=>{Y1();nae()});async function iae(e,{hash:t}){let r=await e.request({method:"eth_getRawTransactionByHash",params:[t]},{dedupe:!0});if(!r)throw new Hl({hash:t});return r}var aae=h(()=>{es()});async function cae(e,{address:t,blockHash:r,blockNumber:n,blockTag:o="latest",requireCanonical:s,slot:i}){let a=pa({blockHash:r,blockNumber:n,blockTag:o,requireCanonical:s});return await e.request({method:"eth_getStorageAt",params:[t,i,a]})}var lae=h(()=>{Y1()});async function Ib(e,{blockHash:t,blockNumber:r,blockTag:n,hash:o,index:s,sender:i,nonce:a}){let c=n||"latest",l=r!==void 0?re(r):void 0,u=null;if(o?u=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?u=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,re(s)]},{dedupe:!0}):(l||c)&&typeof s=="number"?u=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[l||c,re(s)]},{dedupe:!!l}):i&&typeof a=="number"&&(u=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[i,re(a)]},{dedupe:!0})),!u)throw new Hl({blockHash:t,blockNumber:r,blockTag:c,hash:o,index:s});return(e.chain?.formatters?.transaction?.format||Ap)(u,"getTransaction")}var L9=h(()=>{es();Fe();Nw()});async function uae(e,{hash:t,transactionReceipt:r}){let[n,o]=await Promise.all([ue(e,Xl,"getBlockNumber")({}),t?ue(e,Ib,"getTransaction")({hash:t}):void 0]),s=r?.blockNumber||o?.blockNumber;return s?n-s+1n:0n}var dae=h(()=>{Mt();nb();L9()});async function Tb(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new xh({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||Op)(r,"getTransactionReceipt")}var oL=h(()=>{es();ab()});async function pae(e,t){let{account:r,authorizationList:n,allowF
64ailure:o=!0,blockHash:s,blockNumber:i,blockOverrides:a,blockTag:c,requireCanonical:l,stateOverride:u}=t,d=t.contracts,p=typeof e.batch?.multicall=="object"?e.batch.multicall:{},f=t.batchSize??p.batchSize??1024,m=t.deployless??p.deployless??!1,g=(()=>{if(t.multicallAddress)return t.multicallAddress;if(m)return null;if(e.chain)return vi({blockNumber:i,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),y=[[]],b=0,C=0;for(let S=0;S<d.length;S++){let{abi:P,address:D,args:U,functionName:N}=d[S];try{let L=jt({abi:P,args:U,functionName:N});C+=(L.length-2)/2,f>0&&C>f&&y[b].length>0&&(b++,C=(L.length-2)/2,y[b]=[]),y[b]=[...y[b],{allowFailure:!0,callData:L,target:D}]}catch(L){let I=Fs(L,{abi:P,address:D,args:U,docsPath:"/docs/contract/multicall",functionName:N,sender:r});if(!o)throw I;y[b]=[...y[b],{allowFailure:!0,callData:"0x",target:D}]}}let w=await Promise.allSettled(y.map(S=>ue(e,qt,"readContract")({...g===null?{code:Gw}:{address:g},abi:Ya,account:r,args:[S],authorizationList:n,blockHash:s,blockNumber:i,blockOverrides:a,blockTag:c,functionName:"aggregate3",requireCanonical:l,stateOverride:u}))),x=[];for(let S=0;S<w.length;S++){let P=w[S];if(P.status==="rejected"){if(!o)throw P.reason;for(let U=0;U<y[S].length;U++)x.push({status:"failure",error:P.reason,result:void 0});continue}let D=P.value;for(let U=0;U<D.length;U++){let{returnData:N,success:L}=D[U],{callData:I}=y[S][U],{abi:R,address:A,functionName:T,args:v}=d[x.length];try{if(I==="0x")throw new di;if(!L)throw new ja({data:N});let E=kn({abi:R,args:v,data:N,functionName:T});x.push(o?{result:E,status:"success"}:E)}catch(E){let O=Fs(E,{abi:R,address:A,args:v,docsPath:"/docs/contract/multicall",functionName:T});if(!o)throw O;x.push({error:O,result:void 0,status:"failure"})}}}if(x.length!==d.length)throw new K("multicall results mismatch");return x}var fae=h(()=>{po();Yw();zr();ut();fp();Fc();Io();w0();Vh();Mt();ns()});async function j4(e,t){let{blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",blocks:o,returnFullTransactions:s,traceTransfers:i,validation:a}=t;try{let c=[];for(let p of o){let f=p.blockOverrides?iI(p.blockOverrides):void 0,m=p.calls.map(y=>{let b=y,C=b.account?ct(b.account):void 0,w=b.abi?jt(b):b.data,x={...b,account:C,data:b.dataSuffix?nn([w||"0x",b.dataSuffix]):w,from:b.from??C?.address};return On(x),An(x)}),g=p.stateOverrides?Tw(p.stateOverrides):void 0;c.push({blockOverrides:f,calls:m,stateOverrides:g})}let u=(typeof r=="bigint"?re(r):void 0)||n;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:c,returnFullTransactions:s,traceTransfers:i,validation:a},u]})).map((p,f)=>({...G1(p),calls:p.calls.map((m,g)=>{let{abi:y,args:b,functionName:C,to:w}=o[f].calls[g],x=m.error?.data??m.returnData,S=BigInt(m.gasUsed),P=m.logs?.map(L=>Bn(L)),D=m.status==="0x1"?"success":"failure",U=y&&D==="success"&&x!=="0x"?kn({abi:y,data:x,functionName:C}):null,N=(()=>{if(D==="success")return;let L;if(x==="0x"?L=new di:x&&(L=new ja({data:x})),!!L)return Fs(L,{abi:y??[],address:w??"0x",args:b,functionName:C??"<unknown>"})})();return{data:x,gasUsed:S,logs:P,status:D,...D==="success"?{result:U}:{error:N}}})}))}catch(c){let l=c,u=n0(l,{});throw u instanceof wi?l:u}}var sL=h(()=>{_D();Wr();zr();fp();Wl();Fc();Io();Nn();Fe();Vh();t4();US();Yl();Hc();kS();$c()});function H9(e){let t=!0,r="",n=0,o="",s=!1;for(let i=0;i<e.length;i++){let a=e[i];if(["(",")",","].includes(a)&&(t=!0),a==="("&&n++,a===")"&&n--,!!t){if(n===0){if(a===" "&&["event","function","error",""].includes(o))o="";else if(o+=a,a===")"){s=!0;break}continue}if(a===" "){e[i-1]!==","&&r!==","&&r!==",("&&(r="",t=!1);continue}o+=a,r+=a}}if(!s)throw new ze("Unable to normalize signature.");return o}function M9(e,t){let r=typeof e,n=t.type;switch(n){case"address":return y9(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,s)=>M9(Object.values(e)[s],o)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>M9(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function iL(e,t,r){for(let n in e){let o=e[n],s=t[n];if(o.type==="tuple"&&s.type==="tuple"&&"components"in o&&"components"in s)return iL(o.c
64omponents,s.components,r[n]);let i=[o.type,s.type];if(i.includes("address")&&i.includes("bytes20")?!0:i.includes("address")&&i.includes("string")?y9(r[n],{strict:!1}):i.includes("address")&&i.includes("bytes")?y9(r[n],{strict:!1}):!1)return i}}var hae=h(()=>{k4();xi()});function $9(e,t={}){let{prepare:r=!0}=t,n=Array.isArray(e)?Py(e):typeof e=="string"?Py(e):e;return{...n,...r?{hash:_b(n)}:{}}}function q4(e,t,r){let{args:n=[],prepare:o=!0}=r??{},s=y4(t,{strict:!1}),i=e.filter(l=>s?l.type==="function"||l.type==="error"?cL(l)===Zr(t,0,4):l.type==="event"?_b(l)===t:!1:"name"in l&&l.name===t);if(i.length===0)throw new R0({name:t});if(i.length===1)return{...i[0],...o?{hash:_b(i[0])}:{}};let a;for(let l of i){if(!("inputs"in l))continue;if(!n||n.length===0){if(!l.inputs||l.inputs.length===0)return{...l,...o?{hash:_b(l)}:{}};continue}if(!l.inputs||l.inputs.length===0||l.inputs.length!==n.length)continue;if(n.every((d,p)=>{let f="inputs"in l&&l.inputs[p];return f?M9(d,f):!1})){if(a&&"inputs"in a&&a.inputs){let d=iL(l.inputs,a.inputs,n);if(d)throw new aL({abiItem:l,type:d[0]},{abiItem:a,type:d[1]})}a=l}}let c=(()=>{if(a)return a;let[l,...u]=i;return{...l,overloads:u}})();if(!c)throw new R0({name:t});return{...c,...o?{hash:_b(c)}:{}}}function cL(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return q4(r,n)}return e[0]})();return Zr(_b(t),0,4)}function dke(...e){let t=(()=>{if(Array.isArray(e[0])){let[n,o]=e;return q4(n,o)}return e[0]})(),r=typeof t=="string"?t:p1(t);return H9(r)}function _b(...e){let t=(()=>{if(Array.isArray(e[0])){let[r,n]=e;return q4(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:lg(Ww(dke(t)))}var aL,R0,lL=h(()=>{Ry();xi();f9();uo();hae();aL=class extends ze{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${H9(p1(t.abiItem))}\`, and`,`\`${r.type}\` in \`${H9(p1(r.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}},R0=class extends ze{constructor({name:t,data:r,type:n="item"}){let o=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}});function gae(...e){let[t,r]=(()=>{if(Array.isArray(e[0])){let[s,i]=e;return[pke(s),i]}return e})(),{bytecode:n,args:o}=r;return on(n,t.inputs?.length&&o?.length?P0(t.inputs,o):"0x")}function yae(e){return $9(e)}function pke(e){let t=e.find(r=>r.type==="constructor");if(!t)throw new R0({name:"constructor"});return t}var wae=h(()=>{lL();Ab();uo()});function xae(...e){let[t,r=[]]=(()=>{if(Array.isArray(e[0])){let[l,u,d]=e;return[bae(l,u,{args:d}),d]}let[a,c]=e;return[a,c]})(),{overloads:n}=t,o=n?bae([t,...n],t.name,{args:r}):t,s=hke(o),i=r.length>0?P0(o.inputs,r):void 0;return i?on(s,i):s}function pg(e,t={}){return $9(e,t)}function bae(e,t,r){let n=q4(e,t,r);if(n.type!=="function")throw new R0({name:t,type:"function"});return n}function hke(e){return cL(e)}var vae=h(()=>{lL();Ab();uo()});var F9,Ei,uL=h(()=>{F9="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",Ei="0x0000000000000000000000000000000000000000"});async function Eae(e,t){let{blockNumber:r,blockTag:n,calls:o,stateOverrides:s,traceAssetChanges:i,traceTransfers:a,validation:c}=t,l=t.account?ct(t.account):void 0;if(i&&!l)throw new K("`account` is required when `traceAssetChanges` is true");let u=l?gae(yae("constructor(bytes, bytes)"),{bytecode:Zw,args:[gke,xae(pg("function getBalance(address)"),[l.address])]}):void 0,d=i?await Promise.all(t.calls.map(async B=>{if(!B.data&&!B.abi)return;let{accessList:_}=await VI(e,{account:l.address,...B,data:B.abi?jt(B):B.data});return _.map(({address:M,storageKeys:F})=>F.length>0?M:null)})).then(B=>B.flat().filter(Boolean)):[],p=await j4(e,{blockNumber:r,blockTag:n,blocks:[...i?[{calls:[{data:u}],stateOverrides:s},{calls:d.map((B,_)=>({abi:[pg("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:B,from:Ei,nonce:_})),stateOverrides:[{address:Ei,nonce:0}]}]:[],{calls:[...o,{to:Ei}].map(B=>({...B,from:l?.address})),stateOverrides:s},...i?[{calls:[{data:u}]},{calls:d.map((B,_)=>({abi:[pg("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[l.address],to:B,from:Ei,nonce:_})),stateOverrides:[{address:Ei,nonce:0}]},{calls:d.map((B,_)=>({to:B,abi:[pg("function decimals() returns (uint256)")],functionName:"decimals",from:Ei,nonce:_})),stateOverrides:[{address:Ei,nonce:0}]},{calls:d.map((B,_)=>({to:B,abi:[pg("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:Ei,nonce:_})),stateOverrides:[{address:Ei,nonce:0}]},{calls:d.map((B,_)=>({to:B,abi:[pg("function symbol() returns (string)")],functionName:"symbol",from:Ei,nonce:_})),stateOverrides:[{address:Ei,nonce:0}]}]:[]],traceTransfers:a,validation:c}),f=i?p[2]:p[0],[m,g,,y,b,C,w,x]=i?p:[],{calls:S,...P}=f,D=S.slice(0,-1)??[],U=m?.calls??[],N=g?.calls??[],L=[...U,...N].map(B=>B.status==="success"?at(B.data):null),I=y?.calls??[],R=b?.calls??[],A=[...I,...R].map(B=>B.status==="success"?at(B.data):null),T=(C?.calls??[]).map(B=>B.status==="success"?B.result:null),v=(x?.calls??[]).map(B=>B.status==="success"?B.result:null),E=(w?.calls??[]).map(B=>B.status==="success"?B.result:null),O=[];for(let[B,_]of A.entries()){let M=L[B];if(typeof _!="bigint"||typeof M!="bigint")continue;let F=T[B-1],q=v[B-1],oe=E[B-1],Q=B===0?{address:F9,decimals:18,symbol
64:"ETH"}:{address:d[B-1],decimals:oe||F?Number(F??1):void 0,symbol:q??void 0};O.some(Y=>Y.token.address===Q.address)||O.push({token:Q,value:{pre:M,post:_,diff:_-M}})}return{assetChanges:O,block:P,results:D}}var gke,Aae=h(()=>{wae();vae();Wr();uL();Yw();ut();Io();U9();sU();sL();gke="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033"});var W4={};Ce(W4,{InvalidWrappedSignatureError:()=>V9,assert:()=>pL,from:()=>bke,magicBytes:()=>dL,universalSignatureValidatorAbi:()=>wke,universalSignatureValidatorBytecode:()=>yke,unwrap:()=>Cae,validate:()=>vke,wrap:()=>xke});function pL(e){if(Zr(e,-32)!==dL)throw new V9(e)}function bke(e){return typeof e=="string"?Cae(e):e}function Cae(e){pL(e);let[t,r,n]=Cb(M4("address, bytes, bytes"),e);return{data:r,signature:n,to:t}}function xke(e){let{data:t,signature:r,to:n}=e;return on(P0(M4("address, bytes, bytes"),[n,t,r]),dL)}function vke(e){try{return pL(e),!0}catch{return!1}}var dL,yke,wke,V9,Sae=h(()=>{Ab();xi();uo();dL="0x6492649264926492649264926492649264926492649264926492649264926492",yke="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848
64603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",wke=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}];V9=class extends ze{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}});var Iae=h(()=>{Sae()});function K4({r:e,s:t,to:r="hex",v:n,yParity:o}){let s=(()=>{if(o===0||o===1)return o;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),i=`0x${new js.Signature(at(e),at(t)).toCompactHex()}${s===0?"1b":"1c"}`;return r==="hex"?i:zt(i)}var fL=h(()=>{Z1();tn();Sr()});async function O0(e,t){let{address:r,chain:n=e.chain,hash:o,erc6492VerifierAddress:s=t.universalSignatureVerifierAddress??n?.contracts?.erc6492Verifier?.address,multicallAddress:i=t.multicallAddress??n?.contracts?.multicall3?.address,mode:a="auto"}=t;if(n?.verifyHash)return await n.verifyHash(e,t);let c=(()=>{let l=t.signature;return Ve(l)?l:typeof l=="object"&&"r"in l&&"s"in l?K4(l):ft(l)})();try{if(a==="eoa")try{if(Or(qr(r),await qs({hash:o,signature:c})))return!0}catch{}return zc.validate(c)?await Eke(e,{...t,multicallAddress:i,signature:c}):await Ake(e,{...t,verifierAddress:s,signature:c})}catch(l){if(a!=="eoa")try{if(Or(qr(r),await qs({hash:o,signature:c})))return!0}catch{}if(l instanceof Bp)return!1;throw l}}async function Eke(e,t){let{address:r,blockHash:n,blockNumber:o,blockTag:s,hash:i,multicallAddress:a,requireCanonical:c}=t,{authorization:l,data:u,signature:d,to:p}=zc.unwrap(t.signature);if(await ig(e,{address:r,blockHash:n,blockNumber:o,blockTag:s,requireCanonical:c})===ur(["0xef0100",l.address]))return await Cke(e,{...t,signature:d});let m={address:l.address,chainId:Number(l.chainId),nonce:Number(l.nonce),r:re(l.r,{size:32}),s:re(l.s,{size:32}),yParity:l.yParity};if(!await mse({address:r,authorization:m}))throw new Bp;let y=await ue(e,qt,"readContract")({...a?{address:a}:{code:Gw},authorizationList:[m],abi:Ya,blockHash:n,blockNumber:o,blockTag:"pending",functionName:"aggregate3",requireCanonical:c,args:[[...u?[{allowFailure:!0,target:p??r,callData:u}]:[],{allowFailure:!0,target:r,callData:jt({abi:RD,functionName:"isValidSignature",args:[i,d]})}]]});if(y[y.length-1]?.returnData?.startsWith("0x1626ba7e"))return!0;throw new Bp}async function Ake(e,t){let{address:r,factory:n,factoryData:o,hash:s,signature:i,verifierAddress:a,...c}=t,l=await(async()=>!n&&!o||W4.validate(i)?i:W4.wrap({data:o,signature:i,to:n}))(),u=a?{to:a,data:jt({abi:Kw,functionName:"isValidSig",args:[r,s,l]}),...c}:{data:Np({abi:Kw,args:[r,s,l],bytecode:w4}),...c},{data:d}=await ue(e,Ja,"call")(u).catch(p=>{throw p instanceof vh?new Bp:p});if(Yy(d??"0x0"))return!0;throw new Bp}async function Cke(e,t){let{address:r,blockHash:n,blockNumber:o,blockTag:s,hash:i,requireCanonical:a,signature:c}=t;if((await ue(e,qt,"readContract")({address:r,abi:RD,args:[i,c],blockHash:n,blockNumber:o,blockTag:s,functionName:"isValidSignature",requireCanonical:a}).catch(u=>{throw u instanceof Eh?new Bp:u})).startsWith("0x1626ba7e"))return!0;throw new Bp}var Bp,Z4=h(()=>{Iae();F4();po();Yw();fp();b4();Io();Ms();fa();gse();Nn();Us();tn();Fe();Mt();Kh();fL();tg();qI();ns();
64Bp=class extends Error{}});async function Tae(e,{address:t,message:r,factory:n,factoryData:o,signature:s,...i}){let a=_0(r);return ue(e,O0,"verifyHash")({address:t,factory:n,factoryData:o,hash:a,signature:s,...i})}var _ae=h(()=>{Mt();R4();Z4()});async function Pae(e,t){let{address:r,factory:n,factoryData:o,signature:s,message:i,primaryType:a,types:c,domain:l,...u}=t,d=vb({message:i,primaryType:a,types:c,domain:l});return ue(e,O0,"verifyHash")({address:r,factory:n,factoryData:o,hash:d,signature:s,...u})}var Nae=h(()=>{Mt();B4();Z4()});function z9(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:o,poll:s,pollingInterval:i=e.pollingInterval}){let a=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),c;return a?(()=>{let d=St(["watchBlockNumber",e.uid,t,r,i]);return os(d,{onBlockNumber:n,onError:o},p=>Qa(async()=>{try{let f=await ue(e,Xl,"getBlockNumber")({cacheTime:0});if(c!==void 0){if(f===c)return;if(f-c>1&&r)for(let m=c+1n;m<f;m++)p.onBlockNumber(m,c),c=m}(c===void 0||f>c)&&(p.onBlockNumber(f,c),c=f)}catch(f){p.onError?.(f)}},{emitOnBegin:t,interval:i}))})():(()=>{let d=St(["watchBlockNumber",e.uid,t,r]);return os(d,{onBlockNumber:n,onError:o},p=>{let f=!0,m=()=>f=!1;return(async()=>{try{let g=(()=>{if(e.transport.type==="fallback"){let b=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),{unsubscribe:y}=await g.subscribe({params:["newHeads"],onData(b){if(!f)return;let C=at(b.result?.number);p.onBlockNumber(C,c),c=C},onError(b){p.onError?.(b)}});m=y,f||m()}catch(g){o?.(g)}})(),()=>m()})})()}var hL=h(()=>{tn();Mt();x0();ng();To();nb()});async function j9(e,t){let{checkReplacement:r=e.chain?.supportsTransactionReplacementDetection??!0,confirmations:n=1,hash:o,onReplaced:s,retryCount:i=6,retryDelay:a=({count:S})=>~~(1<<S)*200,timeout:c=18e4}=t,l=St(["waitForTransactionReceipt",e.uid,o]),u=t.pollingInterval?t.pollingInterval:e.chain?.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval,d,p,f,m=!1,g,y,{promise:b,resolve:C,reject:w}=eb(),x=c?setTimeout(()=>{y?.(),g?.(),w(new mw({hash:o}))},c):void 0;return g=os(l,{onReplaced:s,resolve:C,reject:w},async S=>{if(f=await ue(e,Tb,"getTransactionReceipt")({hash:o}).catch(()=>{}),f&&n<=1){clearTimeout(x),S.resolve(f),g?.();return}y=ue(e,z9,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:u,async onBlockNumber(P){let D=N=>{clearTimeout(x),y?.(),N(),g?.()},U=P;if(!m)try{if(f){if(n>1&&(!f.blockNumber||U-f.blockNumber+1n<n))return;D(()=>S.resolve(f));return}if(r&&!d&&(m=!0,await Rp(async()=>{d=await ue(e,Ib,"getTransaction")({hash:o}),d.blockNumber&&(U=d.blockNumber)},{delay:a,retryCount:i}),m=!1),f=await ue(e,Tb,"getTransactionReceipt")({hash:o}),n>1&&(!f.blockNumber||U-f.blockNumber+1n<n))return;D(()=>S.resolve(f))}catch(N){if(N instanceof Hl||N instanceof xh){if(!d){m=!1;return}try{p=d,m=!0;let L=await Rp(()=>ue(e,co,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:a,retryCount:i,shouldRetry:({error:A})=>A instanceof Zl});m=!1;let I=L.transactions.find(({from:A,nonce:T})=>A===p.from&&T===p.nonce);if(!I||(f=await ue(e,Tb,"getTransactionReceipt")({hash:I.hash}),n>1&&(!f.blockNumber||U-f.blockNumber+1n<n)))return;let R="replaced";I.to===p.to&&I.value===p.value&&I.input===p.input?R="repriced":I.from===I.to&&I.value===0n&&(R="cancelled"),D(()=>{S.onReplaced?.({reason:R,replacedTransaction:p,transaction:I,transactionReceipt:f}),S.resolve(f)})}catch(L){D(()=>S.reject(L))}}else D(()=>S.reject(N))}}})}),b}var mL=h(()=>{n4();es();Mt();x0();uI();I4();To();c0();L9();oL();hL()});function Rae(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:o,onError:s,includeTransactions:i,poll:a,pollingInterval:c=e.pollingInterval}){let l=typeof a<"u"?a:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
64onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),u=i??!1,d;return l?(()=>{let m=St(["watchBlocks",e.uid,t,r,n,u,c]);return os(m,{onBlock:o,onError:s},g=>Qa(async()=>{try{let y=await ue(e,co,"getBlock")({blockTag:t,includeTransactions:u});if(y.number!==null&&d?.number!=null){if(y.number===d.number)return;if(y.number-d.number>1&&r)for(let b=d?.number+1n;b<y.number;b++){let C=await ue(e,co,"getBlock")({blockNumber:b,includeTransactions:u});g.onBlock(C,d),d=C}}(d?.number==null||t==="pending"&&y?.number==null||y.number!==null&&y.number>d.number)&&(g.onBlock(y,d),d=y)}catch(y){g.onError?.(y)}},{emitOnBegin:n,interval:c}))})():(()=>{let m=!0,g=!0,y=()=>m=!1;return(async()=>{try{n&&ue(e,co,"getBlock")({blockTag:t,includeTransactions:u}).then(w=>{m&&g&&(o(w,void 0),g=!1)}).catch(s);let b=(()=>{if(e.transport.type==="fallback"){let w=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return w?w.value:e.transport}return e.transport})(),{unsubscribe:C}=await b.subscribe({params:["newHeads"],async onData(w){if(!m)return;let x=await ue(e,co,"getBlock")({blockNumber:w.result?.number,includeTransactions:u}).catch(()=>{});m&&(o(x,d),g=!1,d=x)},onError(w){s?.(w)}});y=C,m||y()}catch(b){s?.(b)}})(),()=>y()})()}var Oae=h(()=>{Mt();x0();ng();To();c0()});function Bae(e,{address:t,args:r,batch:n=!0,event:o,events:s,fromBlock:i,onError:a,onLogs:c,poll:l,pollingInterval:u=e.pollingInterval,strict:d}){let p=typeof l<"u"?l:typeof i=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].c
64onfig.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),f=d??!1;return p?(()=>{let y=St(["watchEvent",t,r,n,e.uid,o,u,i]);return os(y,{onLogs:c,onError:a},b=>{let C;i!==void 0&&(C=i-1n);let w,x=!1,S=Qa(async()=>{if(!x){try{w=await ue(e,zI,"createEventFilter")({address:t,args:r,event:o,events:s,strict:f,fromBlock:i})}catch{}x=!0;return}try{let P;if(w)P=await ue(e,v0,"getFilterChanges")({filter:w});else{let D=await ue(e,Xl,"getBlockNumber")({});C&&C!==D?P=await ue(e,Hw,"getLogs")({address:t,args:r,event:o,events:s,fromBlock:C+1n,toBlock:D}):P=[],C=D}if(P.length===0)return;if(n)b.onLogs(P);else for(let D of P)b.onLogs([D])}catch(P){w&&P instanceof mi&&(x=!1),b.onError?.(P)}},{emitOnBegin:!0,interval:u});return async()=>{w&&await ue(e,E0,"uninstallFilter")({filter:w}),S()}})})():(()=>{let y=!0,b=()=>y=!1;return(async()=>{try{let C=(()=>{if(e.transport.type==="fallback"){let P=e.transport.transports.find(D=>D.config.type==="webSocket"||D.config.type==="ipc");return P?P.value:e.transport}return e.transport})(),w=s??(o?[o]:void 0),x=[];w&&(x=[w.flatMap(D=>za({abi:[D],eventName:D.name,args:r}))],o&&(x=x[0]));let{unsubscribe:S}=await C.subscribe({params:["logs",{address:t,topics:x}],onData(P){if(!y)return;let D=P.result;try{let{eventName:U,args:N}=Sp({abi:w??[],data:D.data,topics:D.topics,strict:f}),L=Bn(D,{args:N,eventName:U});c([L])}catch(U){let N,L;if(U instanceof Pc||U instanceof kl){if(d)return;N=U.abiItem.name,L=U.abiItem.inputs?.some(R=>!("name"in R&&R.name))}let I=Bn(D,{args:L?[]:{},eventName:N});c([I])}},onError(P){a?.(P)}});b=S,y||b()}catch(C){a?.(C)}})(),()=>b()})()}var kae=h(()=>{zr();Fh();p4();M1();Yl();Mt();x0();ng();To();iU();nb();E4();GS();A4()});function Dae(e,{batch:t=!0,onError:r,onTransactions:n,poll:o,pollingInterval:s=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{let l=St(["watchPendingTransactions",e.uid,t,s]);return os(l,{onTransactions:n,onError:r},u=>{let d,p=Qa(async()=>{try{if(!d)try{d=await ue(e,jI,"createPendingTransactionFilter")({});return}catch(m){throw p(),m}let f=await ue(e,v0,"getFilterChanges")({filter:d});if(f.length===0)return;if(t)u.onTransactions(f);else for(let m of f)u.onTransactions([m])}catch(f){u.onError?.(f)}},{emitOnBegin:!0,interval:s});return async()=>{d&&await ue(e,E0,"uninstallFilter")({filter:d}),p()}})})():(()=>{let l=!0,u=()=>l=!1;return(async()=>{try{let{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(p){if(!l)return;let f=p.result;n([f])},onError(p){r?.(p)}});u=d,l||u()}catch(d){r?.(d)}})(),()=>u()})()}var Uae=h(()=>{Mt();x0();ng();To();aU();E4();A4()});function Lae(e){let{scheme:t,statement:r,...n}=e.match(Ske)?.groups??{},{chainId:o,expirationTime:s,issuedAt:i,notBefore:a,requestId:c,...l}=e.match(Ike)?.groups??{},u=e.split("Resources:")[1]?.split(`
65- `).slice(1);return{...n,...l,...o?{chainId:Number(o)}:{},...s?{expirationTime:new Date(s)}:{},...i?{issuedAt:new Date(i)}:{},...a?{notBefore:new Date(a)}:{},...c?{requestId:c}:{},...u?{resources:u}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}var Ske,Ike,Mae=h(()=>{Ske=/^(?:(?<scheme>[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?<domain>[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?<address>0x[a-fA-F0-9]{40})\n\n(?:(?<statement>.*)\n\n)?/,Ike=/(?:URI: (?<uri>.+))\n(?:Version: (?<version>.+))\n(?:Chain ID: (?<chainId>\d+))\n(?:Nonce: (?<nonce>[a-zA-Z0-9]+))\n(?:Issued At: (?<issuedAt>.+))(?:\nExpiration Time: (?<expirationTime>.+))?(?:\nNot Before: (?<notBefore>.+))?(?:\nRequest ID: (?<requestId>.+))?/});function Hae(e){let{address:t,domain:r,message:n,nonce:o,scheme:s,time:i=new Date}=e;if(r&&n.domain!==r||o&&n.nonce!==o||s&&n.scheme!==s||n.expirationTime&&i>=n.expirationTime||n.notBefore&&i<n.notBefore)return!1;try{if(!n.address||!Dt(n.address,{strict:!1})||t&&!Or(n.address,t))return!1}catch{return!1}return!0}var $ae=h(()=>{Hs();fa()});async function Fae(e,t){let{address:r,domain:n,message:o,nonce:s,scheme:i,signature:a,time:c=new Date,...l}=t,u=Lae(o);
65if(!u.address||!Hae({address:r,domain:n,message:u,nonce:s,scheme:i,time:c}))return!1;let p=_0(o);return O0(e,{address:u.address,hash:p,signature:a,...l})}var Vae=h(()=>{R4();Mae();$ae();Z4()});function Pb(e,t){return{amount:e,decimals:t,formatted:Xo(e,t)}}function q9(e,t){if(typeof e=="bigint")return e;let r=e.decimals??t;return N0(e.formatted,Tke(r))}function Tke(e){if(e===void 0)throw new Error("Token decimals are required. Pass `amount.decimals` or select a declared token.");return e}function W9(e,t){return typeof e=="bigint"?t:e.decimals??t}function No(e,t){let{decimals:r,token:n}=t,o=yL(e,n);if(o)return{address:o.address,decimals:r??o.decimals};if(Dt(n,{strict:!1}))return{address:n,decimals:r??Pke(e,n)};throw new Error(`Token "${n}" is not a declared ERC-20 token on the client's \`tokens\` array (with an address for the client's chain), and is not a valid address.`)}function yL(e,t){let r=e.tokens,n=e.chain?.id;if(!r||n===void 0)return;let o=_ke(r,t);if(o)return gL(o,n);if(Dt(t,{strict:!1}))for(let s of r){let i=gL(s,n);if(i&&Or(i.address,t))return i}}function gL(e,t){let r=e.addresses[t];if(r)return{address:r,currency:e.currency,decimals:e.decimals,name:e.name,popular:e.popular,symbol:e.symbol}}function _ke(e,t){let r=t.toLowerCase();for(let n of e)if(n.symbol?.toLowerCase()===r)return n}function Pke(e,t){let r=e.tokens,n=e.chain?.id;if(r&&n!==void 0)for(let o of r){let s=gL(o,n);if(s&&Or(s.address,t))return s.decimals}}async function Nb(e,t){let{address:r,decimals:n}=No(e,t);return n!==void 0?{address:r,decimals:n}:{address:r,decimals:await qt(e,{abi:Br,address:r,functionName:"decimals"})}}function Rb(e){let{account:t,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:s,nonce:i}=e;return{account:t,chain:r,gas:n,maxFeePerGas:o,maxPriorityFeePerGas:s,nonce:i}}function nu(e){return{...e,data:jt(e),to:e.address}}var kp=h(()=>{po();Hs();fa();U9();H1();z4();ns()});async function Dp(e,t){return Dp.inner(ma,e,t)}function Nke(e,t){let{amount:r,spender:n,token:o}=t,{address:s,decimals:i}=No(e,{token:o});return{abi:Br,address:s,args:[n,q9(r,i)],functionName:"approve"}}var wL=h(()=>{po();J1();d4();v4();sb();kp();(function(e){async function t(i,a,c){return await i(a,{...c,...e.call(a,c)})}e.inner=t;function r(i,a){return nu(Nke(i,a))}e.call=r;async function n(i,a){return h0(i,{...Rb(a),...e.call(i,a)})}e.estimateGas=n;async function o(i,a){return b0(i,{...Rb(a),...e.call(i,a)})}e.simulate=o;function s(i){let[a]=Za({abi:Br,logs:i,eventName:"Approval",strict:!0});if(!a)throw new Error("`Approval` event not found.");return a}e.extractEvent=s})(Dp||(Dp={}))});async function Ob(e,{serializedTransaction:t,throwOnReceiptRevert:r,timeout:n}){let o=await e.request({method:"eth_sendRawTransactionSync",params:n?[t,n]:[t]},{retryCount:0}),i=(e.chain?.formatters?.transactionReceipt?.format||Op)(o);if(i.status==="reverted"&&r)throw new F1({receipt:i});return i}var K9=h(()=>{es();ab()});async function Z9(e,t){let{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:s,authorizationList:i,blobs:a,data:c,dataSuffix:l=typeof e.dataSuffix=="string"?e.dataSuffix:e.dataSuffix?.value,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,pollingInterval:y,throwOnReceiptRevert:b,type:C,value:w,...x}=t,S=t.timeout??Math.max((o?.blockTime??0)*3,5e3);if(typeof r>"u")throw new Sn({docsPath:"/docs/actions/wallet/sendTransactionSync"});let P=r?ct(r):null,D;try{On(t);let U=await(async()=>{if(t.to)return t.to;if(t.to!==null&&i&&i.length>0)return await Zh({authorization:i[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`.")})})();if(P?.type==="json-rpc"||P===null){let N;o!==null&&(N=await ue(e,lo,"getChainId")({}),n&&A0({currentChainId:N,chain:o}));let L=e.chain?.formatters?.transactionRequest?.format,R=(L||An)({...bi(x,{format:L}),accessList:s,account:P,authorizationList:i,blobs:a,chainId:N,data:l?nn([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,to:U,type:C,value:w},"sendTransaction"),A=bL.get(e.uid),T=A?"wallet_sendTransaction":"eth_sendTransaction",v=await(async()=>{try{return await e.request({method:T,params:[R]},{retryCount:0})}catch(O){if(A===!1)throw O;let B=O;if(B.name==="InvalidInputRpcError"||B.name==="InvalidParamsRpcError"||B.name==="MethodNotFoundRpcError"||B.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[R]},{retryCount:0}).then(_=>(bL.set(e.uid,!0),_)).catch(_=>{let M=_;throw M.name==="MethodNotFoundRpcError"||M.name==="MethodNotSupportedRpcError"?(bL.set(e.uid,!1),B):M});throw B}})(),E=await ue(e,j9,"waitForTransactionReceipt")({checkReplacement:!1,hash:v,pollingInterval:y,timeout:S});if(b&&E.status==="reverted")throw new F1({receipt:E});return E}if(P?.type==="local"){if(P.nonceManager&&typeof g>"u"){let R=x.chainId,A=await(async()=>typeof R=="number"?R:o?o.id:ue(e,lo,"getChainId")({}))();D={address:P.address,chainId:A}}let N=await ue(e,Gl,"prepareTransactionRequest")({account:P,accessList:s,authorizationList:i,blobs:a,chain:o,data:l?nn([c??"0x",l]):c,gas:u,gasPrice:d,maxFeePerBlobGas:p,maxFeePerGas:f,maxPriorityFeePerGas:m,nonce:g,nonceManager:P.nonceManager,parameters:[...u4,"sidecars"],type:C,value:w,...x,to:U}),L=o?.serializers?.transaction,I=await P.signTransaction(N,{seri
65alizer:L});return await ue(e,Ob,"sendRawTransactionSync")({serializedTransaction:I,throwOnReceiptRevert:b,timeout:t.timeout})}throw P?.type==="smart"?new Xa({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new Xa({docsPath:"/docs/actions/wallet/sendTransactionSync",type:P?.type})}catch(U){throw U instanceof Xa?U:(D&&!(U instanceof F1)&&P?.nonceManager?.reset(D),f0(U,{...t,account:P,chain:t.chain||void 0}))}}var bL,xL=h(()=>{Wr();eu();ut();es();e4();C4();Nn();l4();o0();Hc();Mt();hh();$c();Cp();mL();Lw();K9();bL=new Jo(128)});async function Bb(e,t){return ma.internal(e,Z9,"sendTransactionSync",t)}var G9=h(()=>{xL();sb()});async function vL(e,t){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=t,{decimals:s}=No(e,{token:n}),i=W9(r,s),a=await Dp.inner(Bb,e,{...t,throwOnReceiptRevert:o}),{args:c}=Dp.extractEvent(a.logs);return{...c,...i===void 0?{}:{decimals:i,formatted:Xo(c.value,i)},receipt:a}}var zae=h(()=>{H1();G9();wL();kp()});async function kb(e,t){let{account:r,decimals:n,spender:o,token:s,...i}=t,[a,{decimals:c}]=await Promise.all([qt(e,{...i,...kb.call(e,{account:r,spender:o,token:s})}),Nb(e,{decimals:n,token:s})]);return Pb(a,c)}var jae=h(()=>{po();ns();kp();(function(e){function t(r,n){return nu({address:No(r,n).address,abi:Br,functionName:"allowance",args:[n.account,n.spender]})}e.call=t})(kb||(kb={}))});async function Db(e,t){let{account:r=e.account,decimals:n,token:o,...s}=t;if(!r)throw new Sn;let i=ct(r).address,[a,{decimals:c}]=await Promise.all([qt(e,{...s,...Db.call(e,{account:i,token:o})}),Nb(e,{decimals:n,token:o})]);return Pb(a,c)}var qae=h(()=>{Wr();po();eu();ns();kp();(function(e){function t(r,n){let o=n.account??r.account;if(!o)throw new Sn;let s=ct(o).address;return nu({address:No(r,n).address,abi:Br,functionName:"balanceOf",args:[s]})}e.call=t})(Db||(Db={}))});async function EL(e,t){let{token:r,...n}=t,{address:o}=No(e,{token:r}),s=yL(e,r),[i,a,c]=await Promise.all([s?.decimals??qt(e,{...n,abi:Br,address:o,functionName:"decimals"}),s?.name??qt(e,{...n,abi:Br,address:o,functionName:"name"}),s?.symbol??qt(e,{...n,abi:Br,address:o,functionName:"symbol"})]);return{decimals:i,name:a,symbol:c}}var Wae=h(()=>{po();ns();kp()});async function Ub(e,t){let{decimals:r,token:n,...o}=t,[s,{decimals:i}]=await Promise.all([qt(e,{...o,...Ub.call(e,{token:n})}),Nb(e,{decimals:r,token:n})]);return Pb(s,i)}var Kae=h(()=>{po();ns();kp();(function(e){function t(r,n){return nu({address:No(r,n).address,abi:Br,args:[],functionName:"totalSupply"})}e.call=t})(Ub||(Ub={}))});async function Up(e,t){return Up.inner(ma,e,t)}function Rke(e,t){let{amount:r,from:n,to:o,token:s}=t,{address:i,decimals:a}=No(e,{token:s}),c=q9(r,a);return n?{abi:Br,address:i,args:[n,o,c],functionName:"transferFrom"}:{abi:Br,address:i,args:[o,c],functionName:"transfer"}}var AL=h(()=>{po();J1();d4();v4();sb();kp();(function(e){async function t(i,a,c){return await i(a,{...c,...e.call(a,c)})}e.inner=t;function r(i,a){return nu(Rke(i,a))}e.call=r;async function n(i,a){return h0(i,{...Rb(a),...e.call(i,a)})}e.estimateGas=n;async function o(i,a){return b0(i,{...Rb(a),...e.call(i,a)})}e.simulate=o;function s(i){let[a]=Za({abi:Br,logs:i,eventName:"Transfer",strict:!0});if(!a)throw new Error("`Transfer` event not found.");return a}e.extractEvent=s})(Up||(Up={}))});async function CL(e,t){let{amount:r,token:n,throwOnReceiptRevert:o=!0}=t,{decimals:s}=No(e,{token:n}),i=W9(r,s),a=await Up.inner(Bb,e,{...t,throwOnReceiptRevert:o}),{args:c}=Up.extractEvent(a.logs);return{...c,...i===void 0?{}:{decimals:i,formatted:Xo(c.value,i)},receipt:a}}var Zae=h(()=>{H1();G9();kp();AL()});var SL=h(()=>{wL();zae();jae();qae();Wae();Kae();AL();Zae()});function Y9(e){return{call:t=>Ja(e,t),createAccessList:t=>VI(e,t),createBlockFilter:()=>Foe(e),createContractEventFilter:t=>ew(e,t),createEventFilter:t=>zI(e,t),createPendingTransactionFilter:()=>jI(e),estimateContractGas:t=>h0(e,t),estimateGas:t=>Mw(e,t),getBalance:t=>zoe(e,t),getBlobBaseFee:()=>qoe(e),getBlock:t=>co(e,t),getBlockNumber:t=>Xl(e,t),getBlockReceipts:t=>Koe(e,t),getBlockTransactionCount:t=>Goe(e,t),getBytecode:t=>ig(e,t),getChainId:()=>lo(e),getCode:t=>ig(e,t),getContractEvents:t=>$w(e,t),getDelegation:t=>Joe(e,t),getEip712Domain:t=>ese(e,t),getEnsAddress:t=>Ioe(e,t),getEnsAvatar:t=>Doe(e,t),getEnsName:t=>Loe(e,t),getEnsResolver:t=>Hoe(e,t),getEnsText:t=>FI(e,t),getFeeHistory:t=>ose(e,t),estimateFeesPerGas:t=>Rne(e,t),getFilterChanges:t=>v0(e,t),getFilterLogs:t=>ise(e,t),getGasPrice:()=>Rw(e),getLogs:t=>Hw(e,t),getProof:t=>oae(e,t),estimateMaxPriorityFeePerGas:t=>Nne(e,t),fillTransaction:t=>Uw(e,t),getRawTransaction:t=>iae(e,t),getStorageAt:t=>cae(e,t),getTransaction:t=>Ib(e,t),getTransactionConfirmations:t=>uae(e,t),getTransactionCount:t=>l0(e,t),getTransactionReceipt:t=>Tb(e,t),multicall:t=>pae(e,t),prepareTransactionRequest:t=>Gl(e,t),readContract:t=>qt(e,t),sendRawTransaction:t=>ob(e,t),sendRawTransactionSync:t=>Ob(e,t),simulate:t=>j4(e,t),simulateBlocks:t=>j4(e,t),simulateCalls:t=>Eae(e,t),simulateContract:t=>b0(e,t),verifyHash:t=>O0(e,t),verifyMessage:t=>Tae(e,t),verifySiweMessage:t=>Fae(e,t),verifyTypedData:t=>Pae(e,t),uninstallFilter:t=>E0(e,t),waitForTransactionReceipt:t=>j9(e,t),watchBlocks:t=>Rae(e,t),watchBlockNumber:t=>z9(e,t),watchContractEvent:t=>EI(e,t),watchEvent:t=>Bae(e,t),watchPendingTransactions:t=>Dae(e,t),token:Oke(e)}}function Oke(e){return{getAllowance:tu(e,kb),getBalance:tu(e,Db),getMetadata:tu(e,EL),getTotalSupply:tu(e,Ub)}}var IL=h(()=>{Toe();Uoe();Moe();$oe();oU();tg();sU();Voe();xS();iU();aU();d4();hD();ZS();fD();KS();joe();Woe();c0();nb();Zoe();Yoe();Cp();qI();YS();Qoe();tse();sse();E4();ase();LS();GS();sae();aae();lae();L9();dae();s4();oL();fae();ns();sL();Aae();v4();A4();Z4();_ae();Nae();mL();hL();Oae();qD();kae();Uae();Vae();SL();Lw();AI();K9();og()});function Gae(e){let{key:t="public",name:r="Public Client"}=e;return S0({...e,key:t,name:r,type:"publicClient"}).extend(Y9)}var Yae=h(()=>{og();IL()});async function Jae(e,{hash:t}){await e.request({method:`${e.mode}_dropTransaction`,params:[t]})}var Qae=h(()=>{});async function Xae(e){return e.request({method:`${e.mode}_dumpState`})}var ece=h(()=>{});async function tce(e){return e.mode==="ganache"?await e.request({method:"eth_mining"}):await e.request({method:`${e.mode}_getAutomine`})}var rce=h(()=>{});async function nce(e){return await e.request({method:"txpool_content"})}var oce=h(()=>{});async function sce(e){let{pending:t,queued:r}=await e.request({method:"txpool_status"});return{pending:ht(t),queued:ht(r)}}var ice=h(()=>{tn()});async function ace(e,{address:t}){await e.request({method:`${e.mode}_impersonateAccount`,params:[t]})}var cce=h(()=>{});async function lce(e,{seconds:t}){return await e.request({method:"evm_increaseTime",params:[re(t)]})}var uce=h(()=>{Fe()});async function dce(e){return await e.request({method:"txpool_inspect"})}var pce=h(()=>{});async function fce(e,{state:t}){await e.request({method:`${e.mode}_loadState`,params:[t]})}var hce=h(()=>{});async function mce(e,{blocks:t,interval:r}){e.mode==="ganache"?await e.request({method:"evm_mine",params:[{blocks:re(t)}]}):await e.request({method:`${e.mode}_mine`,params:[re(t),re(r||0)]})}var gce=h(()=>{Fe()});async function yce(e){await e.request({method:`${e.mode}_removeBlockTimestampInterval`})}var wce=h(()=>{});async function bce(e,{blockNumber:t,jsonRpcUrl:r}={}){await e.request({method:`${e.mode}_reset`,params:[{forking:{blockNumber:Number(t),jsonRpcUrl:r}}]})}var xce=h(()=>{});async function vce(e,{id:t}){await e.request({method:"evm_revert",params:[t]})}var Ece=h(()=>{});async function Ace(e,t){let{accessList:r,data:n,from:o,gas:s,gasPrice:i,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:d,...p}=t,f=e.chain?.formatters?.transactionRequest?.format,g=(f||An)({...bi(p,{format:f}),accessList:r,data:n,from:o,gas:s,gasPrice:i,maxFeePerGas:a,maxPriorityFeePerGas:c,nonce:l,to:u,value:d},"sendUnsignedTransaction");return await e.request({method:"eth_sendUnsignedTransaction",params:[g]})}var Cce=h(()=>{o0();Hc()});async function Sce(e,t){e.mode==="ganache"?t?await e.request({method:"miner_start"}):await e.request({method:"miner_stop"}):await e.request({method:"evm_setAutomine",params:[t]})}var Ice=h(()=>{});async function Tce(e,{address:t,value:r}){e.mode==="ganache"?await e.request({method:"evm_setAccountBalance",params:[t,re(r)]}):await e.request({method:`${e.mode}_setBalance`,params:[t,re(r)]})}var _ce=h(()=>{Fe()});async function Pce(e,{gasLimit:t}){await e.request({method:"evm_setBlockGasLimit",params:[re(t)]})}var Nce=h(()=>{Fe()});async function Rce(e,{interval:t}){let r=e.mode==="hardhat"?t*1e3:t;await e.request({method:`${e.mode}_setBlockTimestampInterval`,params:[r]})}var Oce=h(()=>{});async function Bce(e,{address:t,bytecode:r}){e.mode==="ganache"?await e.request({method:"evm_setAccountCode",params:[t,r]}):await e.request({method:`${e.mode}_setCode`,params:[t,r]})}var kce=h(()=>{});async function Dce(e,{address:t}){await e.request({method:`${e.mode}_setCoinbase`,params:[t]})}var Uce=h(()=>{});async function Lce(e,{interval:t}){let r=e.mode==="hardhat"?t*1e3:t;await e.request({method:"evm_setIntervalMining",params:[r]})}var Mce=h(()=>{});async function Hce(e,t){await e.request({method:`${e.mode}_setLoggingEnabled`,params:[t]})}var $ce=h(()=>{});async function Fce(e,{gasPrice:t}){await e.request({method:`${e.mode}_setMinGasPrice`,params:[re(t)]})}var Vce=h(()=>{Fe()});async function zce(e,{baseFeePerGas:t}){await e.request({method:`${e.mode}_setNextBlockBaseFeePerGas`,params:[re(t)]})}var jce=h(()=>{Fe()});async function qce(e,{timestamp:t}){await e.request({method:"evm_setNextBlockTimestamp",params:[re(t)]})}var Wce=h(()=>{Fe()});async function Kce(e,{address:t,nonce:r}){await e.request({method:`${e.mode}_setNonce`,params:[t,re(r)]})}var Zce=h(()=>{Fe()});async function Gce(e,t){await e.request({method:`${e.mode}_setRpcUrl`,params:[t]})}var Yce=h(()=>{});
65async function Jce(e,{address:t,index:r,value:n}){await e.request({method:`${e.mode}_setStorageAt`,params:[t,typeof r=="number"?re(r):r,n]})}var Qce=h(()=>{Fe()});async function Xce(e){return await e.request({method:"evm_snapshot"})}var ele=h(()=>{});async function tle(e,{address:t}){await e.request({method:`${e.mode}_stopImpersonatingAccount`,params:[t]})}var rle=h(()=>{});function J9({mode:e}){return t=>{let r=t.extend(()=>({mode:e}));return{dropTransaction:n=>Jae(r,n),dumpState:()=>Xae(r),getAutomine:()=>tce(r),getTxpoolContent:()=>nce(r),getTxpoolStatus:()=>sce(r),impersonateAccount:n=>ace(r,n),increaseTime:n=>lce(r,n),inspectTxpool:()=>dce(r),loadState:n=>fce(r,n),mine:n=>mce(r,n),removeBlockTimestampInterval:()=>yce(r),reset:n=>bce(r,n),revert:n=>vce(r,n),sendUnsignedTransaction:n=>Ace(r,n),setAutomine:n=>Sce(r,n),setBalance:n=>Tce(r,n),setBlockGasLimit:n=>Pce(r,n),setBlockTimestampInterval:n=>Rce(r,n),setCode:n=>Bce(r,n),setCoinbase:n=>Dce(r,n),setIntervalMining:n=>Lce(r,n),setLoggingEnabled:n=>Hce(r,n),setMinGasPrice:n=>Fce(r,n),setNextBlockBaseFeePerGas:n=>zce(r,n),setNextBlockTimestamp:n=>qce(r,n),setNonce:n=>Kce(r,n),setRpcUrl:n=>Gce(r,n),setStorageAt:n=>Jce(r,n),snapshot:()=>Xce(r),stopImpersonatingAccount:n=>tle(r,n)}}}var TL=h(()=>{Qae();ece();rce();oce();ice();cce();uce();pce();hce();gce();wce();xce();Ece();Cce();Ice();_ce();Nce();Oce();kce();Uce();Mce();$ce();Vce();jce();Wce();Zce();Yce();Qce();ele();
65rle()});function nle(e){let{key:t="test",name:r="Test Client",mode:n}=e;return S0({...e,key:t,name:r,type:"testClient"}).extend(s=>({mode:n,...J9({mode:n})(s)}))}var ole=h(()=>{og();TL()});async function sle(e,{chain:t}){let{id:r,name:n,nativeCurrency:o,rpcUrls:s,blockExplorers:i}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:re(r),chainName:n,nativeCurrency:o,rpcUrls:s.default.http,blockExplorerUrls:i?Object.values(i).map(({url:a})=>a):void 0}]},{dedupe:!0,retryCount:0})}var ile=h(()=>{Fe()});function ale(e,t){let{abi:r,args:n,bytecode:o,...s}=t,i=Np({abi:r,args:n,bytecode:o});return C0(e,{...s,...s.authorizationList?{to:null}:{},data:i})}var cle=h(()=>{b4();S4()});async function lle(e){return e.account?.type==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(r=>Oc(r))}var ule=h(()=>{Ms()});async function dle(e,t={}){let{account:r=e.account,chainId:n}=t,o=r?ct(r):void 0,s=n?[o?.address,[re(n)]]:[o?.address],i=await e.request({method:"wallet_getCapabilities",params:s}),a={};for(let[c,l]of Object.entries(i)){a[Number(c)]={};for(let[u,d]of Object.entries(l))u==="addSubAccount"&&(u="unstable_addSubAccount"),a[Number(c)][u]=d}return typeof n=="number"?a[n]:a}var ple=h(()=>{Wr();Fe()});async function fle(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}var hle=h(()=>{});async function Q9(e,t){let{account:r=e.account,chainId:n,nonce:o}=t;if(!r)throw new Sn({docsPath:"/docs/eip7702/prepareAuthorization"});let s=ct(r),i=(()=>{if(t.executor)return t.executor==="self"?t.executor:ct(t.executor)})(),a={address:t.contractAddress??t.address,chainId:n,nonce:o};return typeof a.chainId>"u"&&(a.chainId=e.chain?.id??await ue(e,lo,"getChainId")({})),typeof a.nonce>"u"&&(a.nonce=await ue(e,l0,"getTransactionCount")({address:s.address,blockTag:"pending"}),(i==="self"||i?.address&&Or(i.address,s.address))&&(a.nonce+=1)),a}var _L=h(()=>{Wr();eu();fa();Mt();Cp();s4()});async function mle(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>qr(r))}var gle=h(()=>{Ms()});async function yle(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}var wle=h(()=>{});async function ble(e,t){let{chain:r=e.chain}=t,n=t.timeout??Math.max((r?.blockTime??0)*3,5e3),o=await ue(e,SI,"sendCalls")(t);return await ue(e,_I,"waitForCallsStatus")({...t,id:o.id,timeout:n})}var xle=h(()=>{Mt();II();PI()});async function vle(e,t){let{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}var Ele=h(()=>{});async function Ale(e,t){let{account:r=e.account}=t;if(!r)throw new Sn({docsPath:"/docs/eip7702/signAuthorization"});let n=ct(r);if(!n.signAuthorization)throw new Xa({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});let o=await Q9(e,t);return n.signAuthorization(o)}var Cle=h(()=>{Wr();eu();_L()});async function Sle(e,{account:t=e.account,message:r}){if(!t)throw new Sn({docsPath:"/docs/actions/wallet/signMessage"});let n=ct(t);if(n.signMessage)return n.signMessage({message:r});let o=typeof r=="string"?Fa(r):r.raw instanceof Uint8Array?vr(r.raw):r.raw;return e.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}var Ile=h(()=>{Wr();eu();Fe()});async function Tle(e,t){let{account:r=e.account,chain:n=e.chain,...o}=t;if(!r)throw new Sn({docsPath:"/docs/actions/wallet/signTransaction"});let s=ct(r);On({account:s,...t});let i=await ue(e,lo,"getChainId")({});n!==null&&A0({currentChainId:i,chain:n});let c=(n?.formatters||e.chain?.formatters)?.transactionRequest?.format||An;return s.signTransaction?s.signTransaction({...o,account:s,chainId:i},{serializer:e.chain?.serializers?.transaction}):await e.request({method:"eth_signTransaction",params:[{...c({...o,account:s},"signTransaction"),chainId:re(i),from:s.address}]},{retryCount:0})}var _le=h(()=>{Wr();eu();C4();Fe();Hc();Mt();$c();Cp()});async function Ple(e,t){let{account:r=e.account,domain:n,message:o,primaryType:s}=t;if(!r)throw new Sn({docsPath:"/docs/actions/wallet/signTypedData"});let i=ct(r),a={EIP712Domain:cg({domain:n}),...t.types};if(xb({domain:n,message:o,primaryType:s,types:a}),i.signTypedData)return i.signTypedData({domain:n,message:o,primaryType:s,types:a});let c=s9({domain:n,message:o,primaryType:s,types:a});return e.request({method:"eth_signTypedData_v4",params:[i.address,c]},{retryCount:0})}var Nle=h(()=>{Wr();eu();i9()});async function Rle(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:re(t)}]},{retryCount:0})}var Ole=h(()=>{Fe()});async function Ble(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}var kle=h(()=>{});function X9(e){return{addChain:t=>sle(e,t),deployContract:t=>ale(e,t),fillTransaction:t=>Uw(e,t),getAddresses:()=>lle(e),getCallsStatus:t=>TI(e,t),getCapabilities:t=>dle(e,t),getChainId:()=>lo(e),getPermissions:()=>fle(e),prepareAuthorization:t=>Q9(e,t),prepareTransactionRequest:t=>Gl(e,t),requestAddresses:()=>mle(e),requestPermissions:t=>yle(e,t),sendCalls:t=>SI(e,t),sendCallsSync:t=>ble(e,t),sendRawTransaction:t=>ob(e,t),sendRawTransactionSync:t=>Ob(e,t),sendTransaction:t=>C0(e,t),sendTransactionSync:t=>Z9(e,t),showCallsStatus:t=>vle(e,t),signAuthorization:t=>Ale(e,t),signMessage:t=>Sle(e,t),signTransaction:t=>Tle(e,t),signTypedData:t=>Ple(e,t),switchChain:t=>Rle(e,t),waitForCallsStatus:t=>_I(e,t),watchAsset:t=>Ble(e,t),writeContract:t=>ma(e,t),writeContractSync:t=>Bb(e,t),token:{approve:tu(e,Dp),approveSync:tu(e,vL),transfer:tu(e,Up),transferSync:tu(e,CL)}}}var PL=h(()=>{KS();Cp();SL();ile();cle();ule();QD();ple();hle();_L();Lw();gle();wle();II();
65xle();AI();K9();S4();xL();Ele();Cle();Ile();_le();Nle();Ole();PI();kle();sb();G9();og()});function Dle(e){let{key:t="wallet",name:r="Wallet Client",transport:n}=e;return S0({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(X9)}var Ule=h(()=>{og();PL()});function ou({key:e,methods:t,name:r,request:n,retryCount:o=3,retryDelay:s=150,timeout:i,type:a},c){let l=OI();return{config:{key:e,methods:t,name:r,request:n,retryCount:o,retryDelay:s,timeout:i,type:a},request:bse(n,{methods:t,retryCount:o,retryDelay:s,uid:l}),value:c}}var Lb=h(()=>{xse();XD()});function Lle(e,t={}){let{key:r="custom",methods:n,name:o="Custom Provider",retryDelay:s}=t;return({retryCount:i})=>ou({key:r,methods:n,name:o,request:e.request.bind(e),retryCount:t.retryCount??i,retryDelay:s,type:"custom"})}var Mle=h(()=>{Lb()});function G4(e,t={}){let{key:r="fallback",name:n="Fallback",rank:o=!1,shouldThrow:s=NL,retryCount:i,retryDelay:a}=t;return(({chain:c,pollingInterval:l=4e3,timeout:u,...d})=>{let p=e,f=()=>{},m=ou({key:r,name:n,async request({method:g,params:y}){let b,C=async(w=0)=>{let x=p[w]({...d,chain:c,retryCount:0,timeout:u});try{let S=await x.request({method:g,params:y});return f({method:g,params:y,response:S,transport:x,status:"success"}),S}catch(S){if(f({error:S,method:g,params:y,transport:x,status:"error"}),s(S)||w===p.length-1||(b??=p.slice(w+1).some(P=>{let{include:D,exclude:U}=P({chain:c}).config.methods||{};return D?D.includes(g):U?!U.includes(g):!0}),!b))throw S;return C(w+1)}};return C()},retryCount:i,retryDelay:a,type:"fallback"},{onResponse:g=>f=g,transports:p.map(g=>g({chain:c,retryCount:0}))});if(o){let g=typeof o=="object"?o:{};Bke({chain:c,interval:g.interval??l,onTransports:y=>p=y,ping:g.ping,sampleCount:g.sampleCount,timeout:g.timeout,transports:p,weights:g.weights})}return m})}function NL(e){return!!("code"in e&&typeof e.code=="number"&&(e.code===Fl.code||e.code===Lc.code||e.code===$h.code||da.nodeMessage.test(e.message)||e.code===5e3))}function Bke({chain:e,interval:t=4e3,onTransports:r,ping:n,sampleCount:o=10,timeout:s=1e3,transports:i,weights:a={}}){let{stability:c=.7,latency:l=.3}=a,u=[],d=async()=>{let p=await Promise.all(i.map(async g=>{let y=g({chain:e,retryCount:0,timeout:s}),b=Date.now(),C,w;try{await(n?n({transport:y}):y.request({method:"net_listening"})),w=1}catch{w=0}finally{C=Date.now()}return{latency:C-b,success:w}}));u.push(p),u.length>o&&u.shift();let f=Math.max(...u.map(g=>Math.max(...g.map(({latency:y})=>y)))),m=i.map((g,y)=>{let b=u.map(P=>P[y].latency),w=1-b.reduce((P,D)=>P+D,0)/b.length/f,x=u.map(P=>P[y].success),S=x.reduce((P,D)=>P+D,0)/x.length;return S===0?[0,y]:[l*w+c*S,y]}).sort((g,y)=>y[0]-g[0]);r(m.map(([,g])=>i[g])),await rg(t),d()};d()}var Hle=h(()=>{Wl();Fh();xI();Lb()});var B0,eT=h(()=>{ut();B0=class extends K{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}});function Dke(e){if(!e)return"default";let t=$le.get(e);if(t!==void 0)return t;let r=kke++;return $le.set(e,r),r}function fg(e,t={}){let{batch:r,fetchFn:n,fetchOptions:o,key:s="http",maxResponseBodySize:i,methods:a,name:c="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:u,retryDelay:d,raw:p}=t;return({chain:f,retryCount:m,timeout:g})=>{let{batchSize:y=1e3,wait:b=0}=typeof r=="object"?r:{},C=t.retryCount??m,w=g??t.timeout??1e4,x=e||f?.rpcUrls.default.http[0];if(!x)throw new B0;let S=Gse(x,{fetchFn:n,fetchOptions:o,maxResponseBodySize:i,onRequest:l,onResponse:u,timeout:w});return ou({key:s,methods:a,name:c,async request({method:P,params:D},U){let N={method:P,params:D},L=U?.signal?{signal:U.signal}:void 0,{schedule:I}=tb({id:`${x}.${Dke(U?.signal)}`,wait:b,shouldSplitBatch(v){return v.length>y},fn:v=>S.request({body:v,fetchOptions:L}),sort:(v,E)=>v.id-E.id}),R=async v=>r?I(v):[await S.request({body:v,fetchOptions:L})],[{error:A,result:T}]=await R(N);if(p)return{error:A,result:T};if(A)throw new qa({body:N,error:A,url:x});return T},retryCount:C,retryDelay:d,timeout:w,type:"http"},{fetchOptions:o,url:x})}}var kke,$le,Fle=h(()=>{Wa();eT();dI();Yse();Lb();kke=0,$le=new WeakMap});function Vle(e,t={}){let{keepAlive:r,key:n="webSocket",methods:o,name:s="WebSocket JSON-RPC",reconnect:i,retryDelay:a}=t;return({chain:c,retryCount:l,timeout:u})=>{let d=t.retryCount??l,p=u??t.timeout??1e4,f=e||c?.rpcUrls.default.webSocket?.[0],m={keepAlive:r,reconnect:i};if(!f)throw new B0;return ou({key:n,methods:o,name:s,async request({method:g,params:y}){let b={method:g,params:y},C=await gb(f,m),{error:w,result:x}=await C.requestAsync({body:b,timeout:p});if(w)throw new qa({body:b,error:w,url:f});return x},retryCount:d,retryDelay:a,timeout:p,type:"webSocket"},{getSocket(){return nie(f)},getRpcClient(){return gb(f,m)},async subscribe({params:g,onData:y,onError:b}){let C=await gb(f,m),{result:w}=await new Promise((x,S)=>C.request({body:{method:"eth_subscribe",params:g},onError(P){S(P),b?.(P)},onResponse(P){if(P.error){S(P.error),b?.(P.error);return}if(typeof P.id=="number"){x(P);return}P.method==="eth_subscription"&&y(P.params)}}));return{subscriptionId:w,async unsubscribe(){return new Promise(x=>C.request({body:{method:"eth_unsubscribe",params:[w]},onResponse:x}))}}}})}}var zle=h(()=>{Wa();eT();oie();yU();Lb()});var tT,jle=h(()=>
65{tT=class extends Error{constructor(t,r){super(r),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.details=r}}});function qle(e){let{abi:t,bytecode:r,data:n}=e;if(n===r)return{bytecode:r};let o=t.find(i=>"type"in i&&i.type==="constructor");if(!o)throw new sh({docsPath:RL});if(!("inputs"in o))throw new Bl({docsPath:RL});if(!o.inputs||o.inputs.length===0)throw new Bl({docsPath:RL});return{args:$s(o.inputs,`0x${n.replace(r,"")}`),bytecode:r}}var RL,Wle=h(()=>{zr();gh();RL="/docs/contract/decodeDeployData"});function Kle(e){let t=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>zt(a)):e.blobs,n=r.reduce((a,c)=>a+c.length,0),o=kc(new Uint8Array(n)),s=!0;for(let a of r){let c=kc(a);for(;s&&c.position<a.length;){c.incrementPosition(1);let l=31;a.length-c.position<31&&(l=a.length-c.position);for(let u in Array.from({length:l})){let d=c.readByte();if(d===128&&!c.inspectBytes(c.remaining).includes(128)){s=!1;break}o.pushByte(d)}}}let i=o.bytes.slice(0,o.position);return t==="hex"?ft(i):i}var Zle=h(()=>{nw();Sr();Fe()});function Gle(e){let{sidecars:t,version:r}=e,n=e.to??(typeof t[0].blob=="string"?"hex":"bytes"),o=[];for(let{commitment:s}of t)o.push(Ow({commitment:s,to:n,version:r}));return o}var Yle=h(()=>{$S()});function Jle(e){if(e===1)return 60n;if(e>=Uke||e<0)throw new db({chainId:e});return BigInt((2147483648|e)>>>0)}var Uke,Qle=h(()=>{HI();Uke=2147483648});function rT({blobToKzgCommitment:e,computeBlobKzgProof:t}){return{blobToKzgCommitment:e,computeBlobKzgProof:t}}var OL=h(()=>{});function Xle(e,t){try{e.loadTrustedSetup(t)}catch(r){let n=r;if(!n.message.includes("trusted setup is already loaded"))throw n}return rT(e)}var eue=h(()=>{OL()});function tue({r:e,yParityAndS:t}){let r=zt(t),n=r[0]&128?1:0,o=r;return n===1&&(o[0]&=127),{r:e,s:ft(o),yParity:n}}var rue=h(()=>{Sr();Fe()});function BL(e){let{r:t,s:r}=js.Signature.fromCompact(e.slice(2,130));return{r:re(t,{size:32}),yParityAndS:re(r,{size:32})}}var nue=h(()=>{Z1();Fe()});function kL(e){let{r:t,s:r}=js.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[o,s]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof o<"u"?{r:re(t,{size:32}),s:re(r,{size:32}),v:o,yParity:s}:{r:re(t,{size:32}),s:re(r,{size:32}),yParity:s}}var oue=h(()=>{Z1();Fe()});async function sue(e){let{serializedTransaction:t,signature:r}=e,n=B9(t),o=r??{r:n.r,s:n.s,v:n.v,yParity:n.yParity},s=YI({...n,r:void 0,s:void 0,v:void 0,yParity:void 0,sidecars:void 0});return await qs({hash:Ht(s),signature:o})}var iue=h(()=>{fi();rL();JI();Kh()});function DL({r:e,yParityAndS:t}){return`0x${new js.Signature(at(e),at(t)).toCompactHex()}`}var aue=h(()=>{Z1();tn()});function cue(e){let{r:t,s:r,v:n,yParity:o}=e,s=Number(o??n-27n),i=r;if(s===1){let a=zt(r);a[0]|=128,i=ft(a)}return{r:t,yParityAndS:i}}var lue=h(()=>{Sr();Fe()});var uue={};Ce(uue,{AbiConstructorNotFoundError:()=>sh,AbiConstructorParamsNotFoundError:()=>Bl,AbiDecodingDataSizeInvalidError:()=>lS,AbiDecodingDataSizeTooSmallError:()=>ih,AbiDecodingZeroDataError:()=>di,AbiEncodingArrayLengthMismatchError:()=>By,AbiEncodingBytesSizeMismatchError:()=>ky,AbiEncodingLengthMismatchError:()=>ah,AbiErrorInputsNotFoundError:()=>Dy,AbiErrorNotFoundError:()=>_1,AbiErrorSignatureNotFoundError:()=>ch,AbiEventNotFoundError:()=>P1,AbiEventSignatureEmptyTopicsError:()=>Uy,AbiEventSignatureNotFoundError:()=>Ly,AbiFunctionNotFoundError:()=>oa,AbiFunctionOutputsNotFoundError:()=>lh,AbiFunctionSignatureNotFoundError:()=>My,AccountStateConflictError:()=>cw,AtomicReadyWalletRejectedUpgradeError:()=>Hh,AtomicityNotSupportedError:()=>jl,BaseError:()=>K,BaseFeeScalarError:()=>a0,BlockNotFoundError:()=>Zl,BundleFailedError:()=>ib,BundleTooLargeError:()=>Mh,BytesSizeMismatchError:()=>uh,CallExecutionError:()=>vh,ChainDisconnectedError:()=>Bh,ChainDoesNotSupportContract:()=>_p,ChainMismatchError:()=>Jw,ChainNotFoundError:()=>Qw,CircularReferenceError:()=>S1,ClientChainNotConfiguredError:()=>X1,ContractFunctionExecutionError:()=>Eh,ContractFunctionRevertedError:()=>pp,ContractFunctionZeroDataError:()=>gw,CounterfactualDeploymentFailedError:()=>yw,DecodeLogDataMismatch:()=>Pc,DecodeLogTopicsMismatch:()=>kl,DuplicateIdError:()=>Uh,EIP1193ProviderRpcError:()=>tT,Eip1559FeesNotSupportedError:()=>Kl,EnsAvatarInvalidNftUriError:()=>ru,EnsAvatarUnsupportedNamespaceError:()=>ub,EnsAvatarUriResolutionError:()=>I0,EnsInvalidChainIdError:()=>db,EstimateGasExecutionError:()=>Iw,ExecutionRevertedError:()=>da,FeeCapTooHighError:()=>yi,FeeCapTooLowError:()=>Gh,FeeConflictError:()=>CS,FilterTypeNotSupportedError:()=>Vy,HttpRequestError:()=>ts,InsufficientFundsError:()=>Xh,IntegerOutOfRangeError:()=>Dl,InternalRpcError:()=>Uc,IntrinsicGasTooHighError:()=>e0,IntrinsicGasTooLowError:()=>t0,InvalidAbiDecodingTypeError:()=>$y,InvalidAbiEncodingTypeError:()=>Hy,InvalidAbiItemError:()=>h1,InvalidAbiParameterError:()=>g1,InvalidAbiParametersError:()=>y1,InvalidAbiTypeParameterError:()=>E1,InvalidAddressError:()=>mr,InvalidArrayError:()=>dh,InvalidBytesBooleanError:()=>zy,InvalidChainIdError:()=>Pp,InvalidDecimalNumberError:()=>Sb,InvalidDefinitionTypeError:()=>Oy,InvalidDomainError:()=>yb,InvalidFunctionModifierError:()=>v1,InvalidHexBooleanError:()=>jy,InvalidHexValueError:()=>qy,InvalidInputRpcError:()=>mi,InvalidLegacyVError:()=>bh,InvalidModifierError:()=>x1,InvalidParameterError:()=>w1,InvalidParamsRpcError:()=>Ih,InvalidParenthesisError:()=>I1,InvalidPrimaryTypeError:()=>wb,InvalidRequestRpcError:()=>Ch,InvalidSerializableTransactionError:()=>dw,InvalidSerializedTransactionError:()=>Ml,InvalidSerializedTransactionTypeError:()=>pw,InvalidSignatureError:()=>na,InvalidStorageKeySizeError:()=>fw,InvalidStructSignatureError:()=>C1,InvalidStructTypeError:()=>bb,InvalidYParityError:()=>uw,JsonRpcVersionUnsupportedError:()=>Ph,LimitExceededRpcError:()=>gp,MaxFeePerGasTooLowError:()=>_w,MethodNotFoundRpcError:()=>Sh,MethodNotSupportedRpcError:()=>Vl,NonceMaxValueError:()=>Qh,NonceTooHighError:()=>Yh,NonceTooLowError:()=>Jh,ParseRpcError:()=>Ah,ProviderDisconnectedError:()=>Oh,ProviderRpcError:()=>ao,RawContractError:()=>ja,ResourceNotFoundRpcError:()=>Th,ResourceUnavailableRpcError:()=>_h,ResponseBodyTooLargeError:()=>
65hp,RlpDepthLimitExceededError:()=>Wy,RlpListBoundaryExceededError:()=>Ky,RlpTrailingBytesError:()=>Zy,RpcError:()=>io,RpcRequestError:()=>qa,SizeExceedsPaddingSizeError:()=>R1,SizeOverflowError:()=>Gy,SliceOffsetOutOfBoundsError:()=>N1,SocketClosedError:()=>$l,SolidityProtectedKeywordError:()=>b1,StateAssignmentConflictError:()=>lw,SwitchChainError:()=>kh,TimeoutError:()=>mp,TipAboveFeeCapError:()=>Ka,TransactionExecutionError:()=>hw,TransactionNotFoundError:()=>Hl,TransactionReceiptNotFoundError:()=>xh,TransactionRejectedRpcError:()=>Fl,TransactionTypeNotSupportedError:()=>r0,UnauthorizedProviderError:()=>Nh,UnknownBundleIdError:()=>Lh,UnknownNodeError:()=>wi,UnknownRpcError:()=>ww,UnknownSignatureError:()=>A1,UnknownTypeError:()=>m1,UnsupportedChainIdError:()=>Dh,UnsupportedNonOptionalCapabilityError:()=>zl,UnsupportedPackedAbiType:()=>Fy,UnsupportedProviderMethodError:()=>Rh,UrlRequiredError:()=>B0,UserRejectedRequestError:()=>Lc,WaitForCallsStatusTimeoutError:()=>T4,WaitForTransactionReceiptTimeoutError:()=>mw,WebSocketRequestError:()=>z1,assertCurrentChain:()=>A0,assertRequest:()=>On,assertTransactionEIP1559:()=>T0,assertTransactionEIP2930:()=>pb,assertTransactionLegacy:()=>fb,blobsToCommitments:()=>u0,blobsToProofs:()=>d0,boolToBytes:()=>mk,boolToHex:()=>B1,bytesToBigInt:()=>M8,bytesToBool:()=>H8,bytesToHex:()=>ft,bytesToNumber:()=>la,bytesToRlp:()=>Rte,bytesToString:()=>$8,ccipFetch:()=>eg,ccipReadTunnel:()=>vse,ccipRequest:()=>eg,checksumAddress:()=>Oc,commitmentToVersionedHash:()=>Ow,commitmentsToVersionedHashes:()=>Bw,compactSignatureToHex:()=>DL,compactSignatureToSignature:()=>tue,concat:()=>nn,concatBytes:()=>Ek,concatHex:()=>ur,createClient:()=>S0,createNonceManager:()=>hU,createPublicClient:()=>Gae,createTestClient:()=>nle,createTransport:()=>ou,createWalletClient:()=>Dle,custom:()=>Lle,decodeAbiParameters:()=>$s,decodeDeployData:()=>qle,decodeErrorResult:()=>yh,decodeEventLog:()=>Sp,decodeFunctionData:()=>mI,decodeFunctionResult:()=>kn,defineBlock:()=>Pne,defineChain:()=>Ase,defineKzg:()=>rT,defineTransaction:()=>_ne,defineTransactionReceipt:()=>voe,defineTransactionRequest:()=>Hte,deploylessCallViaBytecodeBytecode:()=>Zw,deploylessCallViaFactoryBytecode:()=>cI,domainSeparator:()=>sie,encodeAbiParameters:()=>Kn,encodeDeployData:()=>Np,encodeErrorResult:()=>x4,encodeEventTopics:()=>za,encodeFunctionData:()=>jt,encodeFunctionResult:()=>gI,encodePacked:()=>cse,erc1155Abi:()=>coe,erc20Abi:()=>Br,erc20Abi_bytes32:()=>aoe,erc4626Abi:()=>uoe,erc6492SignatureValidatorAbi:()=>Kw,erc6492SignatureValidatorByteCode:()=>w4,erc721Abi:()=>loe,ethAddress:()=>F9,etherUnits:()=>sw,extendSchema:()=>Cse,extractChain:()=>Ise,fallback:()=>G4,formatBlock:()=>G1,formatEther:()=>wh,formatGwei:()=>vn,formatLog:()=>Bn,formatTransaction:()=>Ap,formatTransactionReceipt:()=>Op,formatTransactionRequest:()=>An,formatUnits:()=>Xo,fromBlobs:()=>Kle,fromBytes:()=>Mee,fromHex:()=>hk,fromRlp:()=>P4,getAbiItem:()=>Qo,getAddress:()=>qr,getChainContractAddress:()=>vi,getContract:()=>boe,getContractAddress:()=>dse,getContractError:()=>Fs,getCreate2Address:()=>uU,getCreateAddress:()=>lU,getEventSelector:()=>Rc,getEventSignature:()=>cp,getFunctionSelector:()=>ca,getFunctionSignature:()=>cp,getSerializedTransactionType:()=>O9,getTransactionType:()=>Dw,getTypesForEIP712Domain:()=>cg,gweiUnits:()=>iw,hashDomain:()=>O4,hashMessage:()=>_0,hashStruct:()=>a9,hashTypedData:()=>vb,hexToBigInt:()=>at,hexToBool:()=>Yy,hexToBytes:()=>zt,hexToCompactSignature:()=>BL,hexToNumber:()=>ht,hexToRlp:()=>Ote,hexToSignature:()=>kL,hexToString:()=>dS,http:()=>fg,isAddress:()=>Dt,isAddressEqual:()=>Or,isBytes:()=>_4,isErc6492Signature:()=>u9,isErc8010Signature:()=>P9,isHash:()=>XI,isHex:()=>Ve,keccak256:()=>Ht,labelhash:()=>UI,maxInt104:()=>Xte,maxInt112:()=>ere,maxInt120:()=>tre,maxInt128:()=>rre,maxInt136:()=>nre,maxInt144:()=>ore,maxInt152:()=>sre,maxInt16:()=>Vte,maxInt160:()=>ire,maxInt168:()=>are,maxInt176:()=>cre,maxInt184:()=>lre,maxInt192:()=>ure,maxInt200:()=>dre,maxInt208:()=>pre,maxInt216:()=>fre,maxInt224:()=>hre,maxInt232:()=>mre,maxInt24:()=>zte,maxInt240:()=>gre,maxInt248:()=>yre,maxInt256:()=>wre,maxInt32:()=>jte,maxInt40:()=>qte,maxInt48:()=>Wte,maxInt56:()=>Kte,maxInt64:()=>Zte,maxInt72:()=>Gte,maxInt8:()=>Fte,maxInt80:()=>Yte,maxInt88:()=>Jte,maxInt96:()=>Qte,maxUint104:()=>lne,maxUint112:()=>une,maxUint120:()=>dne,maxUint128:()=>pne,maxUint136:()=>fne,maxUint144:()=>hne,maxUint152:()=>mne,maxUint16:()=>Qre,maxUint160:()=>gne,maxUint168:()=>yne,maxUint176:()=>wne,maxUint184:()=>bne,maxUint192:()=>xne,maxUint200:()=>vne,maxUint208:()=>Ene,maxUint216:()=>Ane,maxUint224:()=>Cne,maxUint232:()=>Sne,maxUint24:()=>Xre,maxUint240:()=>Ine,maxUint248:()=>Tne,maxUint256:()=>i0,maxUint32:()=>ene,maxUint40:()=>tne,maxUint48:()=>rne,maxUint56:()=>nne,maxUint64:()=>one,maxUint72:()=>sne,maxUint8:()=>Jre,maxUint80:()=>ine,maxUint88:()=>ane,maxUint96:()=>cne,minInt104:()=>Rre,minInt112:()=>Ore,minInt120:()=>Bre,minInt128:()=>kre,minInt136:()=>Dre,minInt144:()=>Ure,minInt152:()=>Lre,minInt16:()=>xre,minInt160:()=>Mre,minInt168:()=>Hre,minInt176:()=>$re,minInt184:()=>Fre,minInt192:()=>Vre,minInt200:()=>zre,minInt208:()=>jre,minInt216:()=>qre,minInt224:()=>Wre,minInt232:()=>Kre,minInt24:()=>vre,minInt240:()=>Zre,minInt248:()=>Gre,minInt256:()=>Yre,minInt32:()=>Ere,minInt40:()=>Are,minInt48:()=>Cre,minInt56:()=>Sre,minInt64:()=>Ire,minInt72:()=>Tre,minInt8:()=>bre,minInt80:()=>_re,minInt88:()=>Pre,minInt96:()=>Nre,multicall3Abi:()=>Ya,namehash:()=>sg,nonceManager:()=>Kse,numberToBytes:()=>gk,numberToHex:()=>re,offchainLookup:()=>VD,offchainLookupAbiItem:()=>yI,offchainLookupSignature:()=>FD,pad:()=>Yo,padBytes:()=>fk,padHex:()=>pi,parseAbi:()=>_y,parseAbiItem:()=>Py,parseAbiParameter:()=>uk,parseAbiParameters:()=>Ny,parseCompactSignature:()=>BL,parseErc6492Signature:()=>Mie,parseErc8010Signature:()=>$ie,parseEther:()=>Qie,parseEventLogs:()=>Za,parseGwei:()=>eae,parseSignature:()=>kL,parseTransaction:()=>B9,parseUnits:()=>N0,prepareEncodeFunctionData:()=>vS,presignMessagePrefix:()=>n9,publicActions:()=>Y9,recoverAddress:()=>qs,recoverMessageAddress:()=>N9,recoverPublicKey:()=>BS,recoverTransactionAddress:()=>sue,recoverTypedDataAddress:()=>R9,ripemd160:()=>Fse,rpcSchema:()=>Aoe,rpcTransactionType:()=>dD,serializeAccessList:()=>ag,serializeCompactSignature:()=>DL,serializeErc6492Signature:()=>Vie,serializeErc8010Signature:()=>jie,serializeSignature:()=>K4,serializeTransaction:()=>
65YI,serializeTypedData:()=>s9,setErrorConfig:()=>see,setupKzg:()=>Xle,sha256:()=>HS,shouldThrow:()=>NL,sidecarsToVersionedHashes:()=>Gle,signatureToCompactSignature:()=>cue,signatureToHex:()=>K4,size:()=>yt,slice:()=>so,sliceBytes:()=>B8,sliceHex:()=>Ll,stringToBytes:()=>sa,stringToHex:()=>Fa,stringify:()=>St,testActions:()=>J9,toBlobSidecars:()=>p0,toBlobs:()=>qS,toBytes:()=>rn,toCoinType:()=>Jle,toEventHash:()=>lp,toEventSelector:()=>Rc,toEventSignature:()=>cp,toFunctionHash:()=>lp,toFunctionSelector:()=>ca,toFunctionSignature:()=>cp,toHex:()=>vr,toPrefixedMessage:()=>o9,toRlp:()=>Ws,transactionType:()=>o4,trim:()=>jr,universalSignatureValidatorAbi:()=>Kw,universalSignatureValidatorByteCode:()=>w4,validateTypedData:()=>xb,verifyHash:()=>Wie,verifyMessage:()=>Zie,verifyTypedData:()=>Yie,walletActions:()=>X9,webSocket:()=>Vle,weiUnits:()=>Fee,withCache:()=>vI,withRetry:()=>Rp,withTimeout:()=>mb,zeroAddress:()=>Ei,zeroHash:()=>lie});var Mb=h(()=>{Ry();xoe();PI();og();Yae();ole();Ule();IL();TL();PL();Lb();Mle();Hle();Fle();zle();po();uL();l9();Yw();DS();wU();aw();zr();Va();ut();n4();ZD();Xw();fp();P8();O1();HI();uD();Pw();pk();Wl();Wa();Fh();AS();es();eT();xU();nL();jle();gh();Wle();V8();p4();DD();Fc();Bc();b4();LD();M1();Io();HD();use();up();J1();Tk();Ms();pse();Hs();fa();i4();a4();FS();$S();Zle();Yle();c4();yD();wI();Ese();C4();Sse();Tse();w0();Nn();cU();Us();ph();Go();aa();op();Pk();tn();pU();Sr();Fe();X8();tU();DI();Qle();Vh();US();Yl();Nw();ab();Hc();fU();fi();Vse();mD();zse();Qy();jse();qse();L1();Wse();OL();eue();Zse();jD();I4();r9();rue();R4();B4();vU();QU();nue();Hie();Fie();oue();Kh();XU();lD();iue();eL();aue();zie();qie();fL();lue();bU();Kie();Gie();Jie();To();$c();GI();tL();WS();rL();dU();JI();i9();z8();$1();H1();Xie();tae();z4()});async function Y4(...e){let t=await fetch(...e);if(!t.ok)throw new Error(`HTTP status code: ${t.status}`,{cause:t});return t}var Ai,Hb=h(()=>{Ai=class{constructor({baseUrl:t,clientId:r}){this.baseUrl=t,this.clientId=r}async get({headers:t,signal:r,cache:n,...o}){let s=this.createUrl(o);return(await Y4(s,{method:"GET",headers:t,signal:r,cache:n})).json()}async getBlob({headers:t,signal:r,...n}){let o=this.createUrl(n);return(await Y4(o,{method:"GET",headers:t,signal:r})).blob()}async post({body:t,headers:r,signal:n,...o}){let s=this.createUrl(o);return(await Y4(s,{method:"POST",headers:r,body:t?JSON.stringify(t):void 0,signal:n})).json()}async put({body:t,headers:r,signal:n,...o}){let s=this.createUrl(o);return(await Y4(s,{method:"PUT",headers:r,body:t?JSON.stringify(t):void 0,signal:n})).json()}async delete({body:t,headers:r,signal:n,...o}){let s=this.createUrl(o);return(await Y4(s,{method:"DELETE",headers:r,body:t?JSON.stringify(t):void 0,signal:n})).json()}createUrl({path:t,params:r}){let n=new URL(t,this.baseUrl);return r&&Object.entries(r).forEach(([o,s])=>{s&&n.searchParams.append(o,s)}),this.clientId&&n.searchParams.append("clientId",this.clientId),n}sendBeacon({body:t,...r}){let n=this.createUrl(r);return navigator.sendBeacon(n.toString(),t?JSON.stringify(t):void 0)}}});var J4,UL=h(()=>{In();ea();xn();J4={getFeatureValue(e,t){let r=t?.[e];return r===void 0?We.DEFAULT_FEATURES[e]:r},filterSocialsByPlatform(e){if(!e||!e.length)return e;let t=e;return ee.isTelegram()&&(ee.isIos()&&(t=t.filter(r=>r!=="google")),ee.isMac()&&(t=t.filter(r=>r!=="x")),ee.isAndroid()&&(t=t.filter(r=>!["facebook","x"].includes(r)))),ee.isMobile()&&(t=t.filter(r=>r!=="facebook")),t},isSocialsEnabled(){return Array.isArray(W.state.features?.socials)&&W.state.features?.socials.length>0||Array.isArray(W.state.remoteFeatures?.socials)&&W.state.remoteFeatures?.socials.length>0},isEmailEnabled(){return!!(W.state.features?.email||W.state.remoteFeatures?.email)}}});var je,W,In=h(()=>{Rr();Pn();ea();xn();UL();je=Xe({features:We.DEFAULT_FEATURES,projectId:"",sdkType:"appkit",sdkVersion:"html-wagmi-undefined",defaultAccountTypes:We.DEFAULT_ACCOUNT_TYPES,enableNetworkSwitch:!0,experimental_preferUniversalLinks:!1,remoteFeatures:{},enableMobileFullScreen:!1,coinbasePreference:"all"}),W={state:je,subscribeKey(e,t){return Ct(je,e,t)},setOptions(e){Object.assign(je,e)},setRemoteFeatures(e){if(!e)return;let t={...je.remoteFeatures,...e};je.remoteFeatures=t,je.remoteFeatures?.socials&&(je.remoteFeatures.socials=J4.filterSocialsByPlatform(je.remoteFeatures.socials)),je.features?.pay&&(je.remoteFeatures.email=!1,je.remoteFeatures.socials=!1)},setFeatures(e){if(!e)return;je.features||(je.features=We.DEFAULT_FEATURES);let t={...je.features,...e};je.features=t,je.features?.pay&&je.remoteFeatures&&(je.remoteFeatures.email=!1,je.remoteFeatures.socials=!1)},setProjectId(e){je.projectId=e},setCustomRpcUrls(e){je.customRpcUrls=e},setAllWallets(e){je.allWallets=e},setIncludeWalletIds(e){je.includeWalletIds=e},setExcludeWalletIds(e){je.excludeWalletIds=e},setFeaturedWalletIds(e){je.featuredWalletIds=e},setTokens(e){je.tokens=e},setTermsConditionsUrl(e){je.termsConditionsUrl=e},setPrivacyPolicyUrl(e){je.privacyPolicyUrl=e},setCustomWallets(e){je.customWallets=e},setIsSiweEnabled(e){je.isSiweEnabled=e},setIsUniversalProvider(e){je.isUniversalProvider=e},setSdkVersion(e){je.sdkVersion=e},setMetadata(e){je.metadata=e},setDisableAppend(e){je.disableAppend=e},setEIP6963Enabled(e){je.enableEIP6963=e},setEnableCoinbase(e){je.enableCoinbase=e},setDebug(e){je.debug=e},setEnableWalletGuide(e){je.enableWalletGuide=e},setEnableAuthLogger(e){je.enableAuthLogger=e},setEnableWallets(e){je.enableWallets=e},setPreferUniversalLinks(e){je.experimental_preferUniversalLinks=e},setSIWX(e){if(e)for(let[t,r]of Object.entries(We.SIWX_DEFAULTS))e[t]??=r;je.siwx=e},setConnectMethodsOrder(e){je.features={...je.features,connectMethodsOrder:e}},setWalletFeaturesOrder(e){je.features={...je.features,walletFeaturesOrder:e}},setSocialsOrder(e){je.remoteFeatures={...je.remoteFeatures,socials:e}},setCollapseWallets(e){je.features={...je.features,collapseWallets:e}},setEnableEmbedded(e){je.enableEmbedded=e},setAllowUnsupportedChain(e){je.allowUnsupportedChain=e},setManualWCControl(e){je.manualWCControl=e},setEnableNetworkSwitch(e){je.enableNetworkSwitch=e},setEnableMobileFullScreen(e){je.enableMobileFullScreen=ee.isMobile()&&e},setEnableReconnect(e){je.enableReconnect=e},setCoinbasePreference(e){je.coinbasePreference=e},setDefaultAccountTypes(e={}){Object.entries(e).forEach(([t,r])=>{r&&(je.defaultAccountTypes[t]=r)})},setUniversalProviderConfigOverride(e){je.universalProviderConfigOverride=e},getUniversalProviderConfigOverride(){return je.universalProviderConfigOverride}
65,getSnapshot(){return Rl(je)}}});var hg,Zn,Lke,Ze,k0=h(()=>{Rr();Pn();xn();hg=Object.freeze({message:"",variant:"success",svg:void 0,open:!1,autoClose:!0}),Zn=Xe({...hg}),Lke={state:Zn,subscribeKey(e,t){return Ct(Zn,e,t)},showLoading(e,t={}){this._showMessage({message:e,variant:"loading",...t})},showSuccess(e){this._showMessage({message:e,variant:"success"})},showSvg(e,t){this._showMessage({message:e,svg:t})},showError(e){let t=ee.parseError(e);this._showMessage({message:t,variant:"error"})},hide(){Zn.message=hg.message,Zn.variant=hg.variant,Zn.svg=hg.svg,Zn.open=hg.open,Zn.autoClose=hg.autoClose},_showMessage({message:e,svg:t,variant:r="success",autoClose:n=hg.autoClose}){Zn.open?(Zn.open=!1,setTimeout(()=>{Zn.message=e,Zn.variant=r,Zn.svg=t,Zn.open=!0,Zn.autoClose=n},150)):(Zn.message=e,Zn.variant=r,Zn.svg=t,Zn.open=!0,Zn.autoClose=n)}},Ze=Lke});var Mke,due,Ks,Me,Lp=h(()=>{Rr();ea();xn();Hb();ta();kr();In();k0();Mke={purchaseCurrencies:[{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},{id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"Ether",symbol:"ETH",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]}],paymentCurrencies:[{id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},{id:"EUR",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]}]},due=ee.getBlockchainApiUrl(),Ks=Xe({clientId:null,api:new Ai({baseUrl:due,clientId:null}),supportedChains:{http:[],ws:[]}}),Me={state:Ks,async get(e){let{st:t,sv:r}=Me.getSdkProperties(),n=W.state.projectId,o={...e.params||{},st:t,sv:r,projectId:n};return Ks.api.get({...e,params:o})},getSdkProperties(){let{sdkType:e,sdkVersion:t}=W.state;return{st:e||"unknown",sv:t||"unknown"}},async isNetworkSupported(e){if(!e)return!1;try{Ks.supportedChains.http.length||await Me.getSupportedNetworks()}catch{return!1}return Ks.supportedChains.http.includes(e)},async getSupportedNetworks(){try{let e=await Me.get({path:"v1/supported-chains"});return Ks.supportedChains=e,e}catch{return Ks.supportedChains}},async fetchIdentity({address:e}){let t=ae.getIdentityFromCacheForAddress(e);if(t)return t;let r=await Me.get({path:`/v1/identity/${e}`,params:{sender:k.state.activeCaipAddress?ee.getPlainAddress(k.state.activeCaipAddress):void 0}});return ae.updateIdentityCache({address:e,identity:r,timestamp:Date.now()}),r},async fetchTransactions({account:e,cursor:t,signal:r,cache:n,chainId:o}){if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))return{data:[],next:void 0};let i=ae.getTransactionsCacheForAddress({address:e,chainId:o});if(i)return i;let a=await Me.get({path:`/v1/account/${e}/history`,params:{cursor:t,chainId:o},signal:r,cache:n});return ae.updateTransactionsCache({address:e,chainId:o,timestamp:Date.now(),transactions:a}),a},async fetchSwapQuote({amount:e,userAddress:t,from:r,to:n,gasPrice:o}){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:"/v1/convert/quotes",headers:{"Content-Type":"application/json"},params:{amount:e,userAddress:t,from:r,to:n,gasPrice:o}}):{quotes:[]}},async fetchSwapTokens({chainId:e}){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:"/v1/convert/tokens",params:{chainId:e}}):{tokens:[]}},async getAddressBalance({caipNetworkId:e,address:t,method:r="getAddressBalance",params:n}){return Ks.api.post({path:`/v1?chainId=${e}&projectId=${W.state.projectId}`,body:{id:"1",jsonrpc:"2.0",method:r,params:n??{address:t}}}).then(o=>o.result)},async fetchTokenPrice({addresses:e,caipNetworkId:t=k.state.activeCaipNetwork?.caipNetworkId}){if(!await Me.isNetworkSupported(t))return{fungibles:[]};let n=ae.getTokenPriceCacheForAddresses(e);if(n)return n;let o=await Ks.api.post({path:"/v1/fungible/price",body:{currency:"usd",addresses:e,projectId:W.state.projectId},headers:{"Content-Type":"application/json"}});return ae.updateTokenPriceCache({addresses:e,timestamp:Date.now(),tokenPrice:o}),o},async fetchSwapAllowance({tokenAddress:e,userAddress:t}){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:"/v1/convert/allowance",params:{tokenAddress:e,userAddress:t},headers:{"Content-Type":"application/json"}}):{allowance:"0"}},async fetchGasPrice({chainId:e}){let{st:t,sv:r}=Me.getSdkProperties();if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Gas Price");return Me.get({path:"/v1/convert/gas-price",headers:{"Content-Type":"application/json"},params:{chainId:e,st:t,sv:r}})},async generateSwapCalldata({amount:e,from:t,to:r,userAddress:n,disableEstimate:o}){if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Swaps");return Ks.api.post({path:"/v1/convert/build-transaction",headers:{"Content-Type":"application/json"},body:{amount:e,eip155:{slippage:We.CONVERT_SLIPPAGE_TOLERANCE},projectId:W.state.projectId,from:t,to:r,userAddress:n,disableEstimate:o}})},async generateApproveCalldata({from:e,to:t,userAddress:r}){let{st:n,sv:o}=Me.getSdkProperties();if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))throw new Error("Network not supported for Swaps");return Me.get({path:"/v1/convert/build-approve",headers:{"Content-Type":"application/json"}
65,params:{userAddress:r,from:e,to:t,st:n,sv:o}})},async getBalance(e,t,r){let{st:n,sv:o}=Me.getSdkProperties();if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))return Ze.showError("Token Balance Unavailable"),{balances:[]};let i=`${t}:${e}`,a=ae.getBalanceCacheForCaipAddress(i);if(a)return a;let c=await Me.get({path:`/v1/account/${e}/balance`,params:{currency:"usd",chainId:t,forceUpdate:r,st:n,sv:o}});return ae.updateBalanceCache({caipAddress:i,balance:c,timestamp:Date.now()}),c},async lookupEnsName(e){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:`/v1/profile/account/${e}`,params:{apiVersion:"2"}}):{addresses:{},attributes:[]}},async reverseLookupEnsName({address:e}){if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))return[];let r=k.getAccountData()?.address;return Me.get({path:`/v1/profile/reverse/${e}`,params:{sender:r,apiVersion:"2"}})},async getEnsNameSuggestions(e){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:`/v1/profile/suggestions/${e}`,params:{zone:"reown.id"}}):{suggestions:[]}},async registerEnsName({coinType:e,address:t,message:r,signature:n}){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Ks.api.post({path:"/v1/profile/account",body:{coin_type:e,address:t,message:r,signature:n},headers:{"Content-Type":"application/json"}}):{success:!1}},async generateOnRampURL({destinationWallets:e,partnerUserId:t,defaultNetwork:r,purchaseAmount:n,paymentAmount:o}){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?(await Ks.api.post({path:"/v1/generators/onrampurl",params:{projectId:W.state.projectId},body:{destinationWallets:e,defaultNetwork:r,partnerUserId:t,defaultExperience:"buy",presetCryptoAmount:n,presetFiatAmount:o}})).url:""},async getOnrampOptions(){if(!await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId))return{paymentCurrencies:[],purchaseCurrencies:[]};try{return await Me.get({path:"/v1/onramp/options"})}catch{return Mke}},async getOnrampQuote({purchaseCurrency:e,paymentCurrency:t,amount:r,network:n}){try{return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?await Ks.api.post({path:"/v1/onramp/quote",params:{projectId:W.state.projectId},body:{purchaseCurrency:e,paymentCurrency:t,amount:r,network:n}}):null}catch{return{networkFee:{amount:r,currency:t.id},paymentSubtotal:{amount:r,currency:t.id},paymentTotal:{amount:r,currency:t.id},purchaseAmount:{amount:r,currency:t.id},quoteId:"mocked-quote-id"}}},async getSmartSessions(e){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Me.get({path:`/v1/sessions/${e}`}):[]},async revokeSmartSession(e,t,r){return await Me.isNetworkSupported(k.state.activeCaipNetwork?.caipNetworkId)?Ks.api.post({path:`/v1/sessions/${e}/revoke`,params:{projectId:W.state.projectId},body:{pci:t,signature:r}}):{success:!1}},setClientId(e){Ks.clientId=e,Ks.api=new Ai({baseUrl:due,clientId:e})}}});var D0=h(()=>{v8()});var Hke,$ke,Fke,Vke,U0,pue,fue=h(()=>{Rr();Pn();xn();Hb();In();Hke=Object.freeze({enabled:!0,events:[]}),$ke=new Ai({baseUrl:ee.getAnalyticsUrl(),clientId:null}),Fke=5,Vke=60*1e3,U0=Xe({...Hke}),pue={state:U0,subscribeKey(e,t){return Ct(U0,e,t)},async sendError(e,t){if(!U0.enabled)return;let r=Date.now();if(U0.events.filter(s=>{let i=new Date(s.properties.timestamp||"").getTime();return r-i<Vke}).length>=Fke)return;let o={type:"error",event:t,properties:{errorType:e.name,errorMessage:e.message,stackTrace:e.stack,timestamp:new Date().toISOString()}};U0.events.push(o);try{if(typeof window>"u")return;let{projectId:s,sdkType:i,sdkVersion:a}=W.state;await $ke.post({path:"/e",params:{projectId:s,st:i,sv:a||"html-wagmi-4.2.2"},body:{eventId:ee.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:new Date().toISOString(),props:{type:"error",event:t,errorType:e.name,errorMessage:e.message,stackTrace:e.stack}}})}catch{}},enable(){U0.enabled=!0},disable(){U0.enabled=!1},clearEvents(){U0.events=[]}}});function hue(e,t){let r="";try{e instanceof Error?r=e.message:typeof e=="string"?r=e:typeof e=="object"&&e!==null?Ob
65ject.keys(e).length===0?r="Unknown error":r=e?.message||JSON.stringify(e):r=String(e)}catch(o){r="Unknown error",console.error("Error parsing error message",o)}let n=e instanceof ec?e:new ec(r,t,e);throw pue.sendError(n,n.category),n}function gr(e,t="INTERNAL_SDK_ERROR"){let r={};return Object.keys(e).forEach(n=>{let o=e[n];if(typeof o=="function"){let s=o;o.constructor.name==="AsyncFunction"?s=async(...i)=>{try{return await o(...i)}catch(a){return hue(a,t)}}:s=(...i)=>{try{return o(...i)}catch(a){return hue(a,t)}},r[n]=s}else r[n]=o}),r}var ec,ss=h(()=>{fue();ec=class e extends Error{constructor(t,r,n){super(t),this.originalName="AppKitError",this.name="AppKitError",this.category=r,this.originalError=n,n&&n instanceof Error&&(this.originalName=n.name),Object.setPrototypeOf(this,e.prototype);let o=!1;if(n instanceof Error&&typeof n.stack=="string"&&n.stack){let s=n.stack,i=s.indexOf(`
66`);if(i>-1){let a=s.substring(i+1);this.stack=`${this.name}: ${this.message}
67${a}`,o=!0}}o||(Error.captureStackTrace?Error.captureStackTrace(this,e):this.stack||(this.stack=`${this.name}: ${this.message}`))}}});var ga,zke,Dn,nT=h(()=>{Rr();Pn();ss();ga=Xe({walletImages:{},networkImages:{},chainImages:{},connectorImages:{},tokenImages:{},currencyImages:{}}),zke={state:ga,subscribeNetworkImages(e){return Ot(ga.networkImages,()=>e(ga.networkImages))},subscribeKey(e,t){return Ct(ga,e,t)},subscribe(e){return Ot(ga,()=>e(ga))},setWalletImage(e,t){ga.walletImages[e]=t},setNetworkImage(e,t){ga.networkImages[e]=t},setChainImage(e,t){ga.chainImages[e]=t},setConnectorImage(e,t){ga.connectorImages={...ga.connectorImages,[e]:t}},setTokenImage(e,t){ga.tokenImages[e]=t},setCurrencyImage(e,t){ga.currencyImages[e]=t}},Dn=gr(zke)});var mue,$b,vt,LL=h(()=>{Rr();it();su();nT();In();mue={eip155:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",solana:"a1b58899-f671-4276-6a5e-56ca5bd59700",polkadot:"",bip122:"0b4838db-0161-4ffe-022d-532bf03dba00",cosmos:"",sui:"",stacks:"",ton:"20f673c0-095e-49b2-07cf-eb5049dcf600",tron:"3502bb86-cc4e-420f-a387-59ea63a28b00"},$b=Xe({networkImagePromises:{},tokenImagePromises:{}}),vt={async fetchWalletImage(e){if(e)return await de._fetchWalletImage(e),this.getWalletImageById(e)},async fetchNetworkImage(e){if(!e)return;let t=this.getNetworkImageById(e);return t||($b.networkImagePromises[e]||($b.networkImagePromises[e]=de._fetchNetworkImage(e)),await $b.networkImagePromises[e],this.getNetworkImageById(e))},async fetchTokenImage(e){if(e)return $b.tokenImagePromises[e]||($b.tokenImagePromises[e]=de._fetchTokenImage(e)),await $b.tokenImagePromises[e],this.getTokenImage(e)},getWalletImageById(e){if(e)return Dn.state.walletImages[e]},getWalletImage(e){if(e?.image_url)return e?.image_url;if(e?.image_id)return Dn.state.walletImages[e.image_id]},getNetworkImage(e){if(e?.assets?.imageUrl)return e?.assets?.imageUrl;if(e?.assets?.imageId)return Dn.state.networkImages[e.assets.imageId]},getNetworkImageById(e){if(e)return Dn.state.networkImages[e]},getConnectorImage(e){if(e?.imageUrl)return e.imageUrl;if(e?.info?.icon)return e.info.icon;if(e?.imageId)return Dn.state.connectorImages[e.imageId]},getChainImage(e){return Dn.state.networkImages[mue[e]]},getTokenImage(e){if(e)return Dn.state.tokenImages[e]},getWalletImageUrl(e){if(!e)return"";let{projectId:t,sdkType:r,sdkVersion:n}=W.state,o=new URL(`${j.W3M_API_URL}/getWalletImage/${e}`);return o.searchParams.set("projectId",t),o.searchParams.set("st",r),o.searchParams.set("sv",n),o.toString()},getAssetImageUrl(e){if(!e)return"";let{projectId:t,sdkType:r,sdkVersion:n}=W.state,o=new URL(`${j.W3M_API_URL}/public/getAssetImage/${e}`);return o.searchParams.set("projectId",t),o.searchParams.set("st",r),o.searchParams.set("sv",n),o.toString()},getChainNamespaceImageUrl(e){return this.getAssetImageUrl(mue[e])},async getImageByToken(e,t){if(e==="native"){let n=j.NATIVE_IMAGE_IDS_BY_NAMESPACE[t]??null;return n?vt.fetchNetworkImage(n):void 0}let[,r]=Object.entries(j.TOKEN_SYMBOLS_BY_ADDRESS).find(([n])=>n.toLowerCase()===e.toLowerCase())??[];if(r)return vt.fetchTokenImage(r)}}});var Un,Q4,oT=h(()=>{it();kr();xn();Un={PHANTOM:{id:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",url:"https://phantom.app",androidPackage:"app.phantom"},SOLFLARE:{id:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",url:"https://solflare.com"},COINBASE:{id:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",url:"https://go.cb-w.com",evmDeeplink:"cbwallet://miniapp"},BINANCE:{id:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25",appId:"yFK5FCqYprrXDiVFbhyRx7",deeplink:"bnc://app.binance.com/mp/app",url:"https://app.binance.com/en/download"}},Q4={isCustomDeeplinkWallet(e,t){return e===Un.PHANTOM.id?t===j.CHAIN.SOLANA||t===j.CHAIN.EVM||t===j.CHAIN.BITCOIN:e===Un.SOLFLARE.id?t===j.CHAIN.SOLANA:e===Un.COINBASE.id?t===j.CHAIN.SOLANA||t===j.CHAIN.EVM:e===Un.BINANCE.id?t===j.CHAIN.BITCOIN:!1}
67,handleMobileDeeplinkRedirect(e,t,r){let n=window.location.href,o=encodeURIComponent(n),s=r?.isCoinbaseDisabled??!1;if(e===Un.PHANTOM.id&&!("phantom"in window)){let i=n.startsWith("https")?"https":"http",a=n.split("/")[2],c=encodeURIComponent(`${i}://${a}`),l=`${Un.PHANTOM.url}/ul/browse/${o}?ref=${c}`;if(ee.isAndroid()){let u=`intent://browse/${o}?ref=${c}#Intent;scheme=phantom;package=${Un.PHANTOM.androidPackage};end`;window.location.href=u}else window.location.href=l}if(e===Un.SOLFLARE.id&&t===j.CHAIN.SOLANA&&!("solflare"in window)&&(window.location.href=`${Un.SOLFLARE.url}/ul/v1/browse/${o}?ref=${o}`),t===j.CHAIN.SOLANA&&e===Un.COINBASE.id&&(s||!("coinbaseSolana"in window))&&(window.location.href=`${Un.COINBASE.url}/dapp?cb_url=${o}`),t===j.CHAIN.EVM&&e===Un.COINBASE.id&&(s||!("coinbaseWalletExtension"in window))&&(window.location.href=`${Un.COINBASE.evmDeeplink}?url=${o}`),t===j.CHAIN.BITCOIN&&e===Un.BINANCE.id&&!("binancew3w"in window)){let i=k.state.activeCaipNetwork,a=window.btoa("/pages/browser/index"),c=window.btoa(`url=${o}&defaultChainId=${i?.id??1}`),l=new URL(Un.BINANCE.deeplink);l.searchParams.set("appId",Un.BINANCE.appId),l.searchParams.set("startPagePath",a),l.searchParams.set("startPageQuery",c);let u=new URL(Un.BINANCE.url);u.searchParams.set("_dp",window.btoa(l.toString())),window.location.href=u.toString()}}}});var jke,qke,Wke,Kke,gue,pn,xe,tc=h(()=>{Rr();xn();Hb();kr();In();jke=ee.getAnalyticsUrl(),qke=new Ai({baseUrl:jke,clientId:null}),Wke=["MODAL_CREATED"],Kke=45,gue=1e3*10,pn=Xe({timestamp:Date.now(),lastFlush:Date.now(),reportedErrors:{},data:{type:"track",event:"MODAL_CREATED"},pendingEvents:[],subscribedToVisibilityChange:!1,walletImpressions:[]}),xe={state:pn,subscribe(e){return Ot(pn,()=>e(pn))},getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:r}=W.state;return{projectId:e,st:t,sv:r||"html-wagmi-4.2.2"}},shouldFlushEvents(){let e=JSON.stringify(pn.pendingEvents).length/1024>Kke,t=pn.lastFlush+gue<Date.now();return e||t},_setPendingEvent(e){try{let t=k.getAccountData()?.address;if("address"in e.data&&e.data.address&&(t=e.data.address),Wke.includes(e.data.event)||typeof window>"u")return;let r=k.getActiveCaipNetwork()?.caipNetworkId;this.state.pendingEvents.push({eventId:ee.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:e.timestamp,props:{...e.data,address:t,properties:{..."properties"in e.data?e.data.properties:{},caipNetworkId:r}}}),pn.reportedErrors.FORBIDDEN=!1,xe.shouldFlushEvents()&&xe._submitPendingEvents()}catch(t){console.warn("_setPendingEvent",t)}},sendEvent(e){pn.timestamp=Date.now(),pn.data=e;let t=["INITIALIZE","CONNECT_SUCCESS","SOCIAL_LOGIN_SUCCESS"];
67(W.state.features?.analytics||t.includes(e.event))&&xe._setPendingEvent(pn),this.subscribeToFlushTriggers()},sendWalletImpressionEvent(e){pn.walletImpressions.push(e)},_transformPendingEventsForBatch(e){try{return e.filter(t=>t.props.event!=="WALLET_IMPRESSION_V2")}catch{return e}},_submitPendingEvents(){if(pn.lastFlush=Date.now(),!(pn.pendingEvents.length===0&&pn.walletImpressions.length===0))try{let e=xe._transformPendingEventsForBatch(pn.pendingEvents);pn.walletImpressions.length&&e.push({eventId:ee.getUUID(),url:window.location.href,domain:window.location.hostname,timestamp:Date.now(),props:{type:"track",event:"WALLET_IMPRESSION_V2",items:[...pn.walletImpressions]}}),qke.sendBeacon({path:"/batch",params:xe.getSdkProperties(),body:e}),pn.reportedErrors.FORBIDDEN=!1,pn.pendingEvents=[],pn.walletImpressions=[]}catch{pn.reportedErrors.FORBIDDEN=!0}},subscribeToFlushTriggers(){pn.subscribedToVisibilityChange||typeof document>"u"||(pn.subscribedToVisibilityChange=!0,document?.addEventListener?.("visibilitychange",()=>{document.visibilityState==="hidden"&&xe._submitPendingEvents()}),document?.addEventListener?.("freeze",()=>{xe._submitPendingEvents()}),window?.addEventListener?.("pagehide",()=>{xe._submitPendingEvents()}),setInterval(()=>{xe._submitPendingEvents()},gue))}}});var Zke,Zs,Gke,yue,Yke,pt,de,su=h(()=>{Rr();Pn();it();LL();xn();
67Hb();oT();ta();nT();kr();fo();tc();In();Zke=ee.getApiUrl(),Zs=new Ai({baseUrl:Zke,clientId:null}),Gke=40,yue=4,Yke=20,pt=Xe({promises:{},page:1,count:0,featured:[],allFeatured:[],recommended:[],allRecommended:[],wallets:[],filteredWallets:[],search:[],isAnalyticsEnabled:!1,excludedWallets:[],isFetchingRecommendedWallets:!1,explorerWallets:[],explorerFilteredWallets:[],plan:{tier:"none",hasExceededUsageLimit:!1,limits:{isAboveRpcLimit:!1,isAboveMauLimit:!1}}}),de={state:pt,subscribeKey(e,t){return Ct(pt,e,t)},_getSdkProperties(){let{projectId:e,sdkType:t,sdkVersion:r}=W.state;return{projectId:e,st:t||"appkit",sv:r||"html-wagmi-4.2.2"}},_filterOutExtensions(e){return W.state.isUniversalProvider?e.filter(t=>!!(t.mobile_link||t.desktop_link||t.webapp_link)):e},async _fetchWalletImage(e){let t=`${Zs.baseUrl}/getWalletImage/${e}`,r=await Zs.getBlob({path:t,params:de._getSdkProperties()});Dn.setWalletImage(e,URL.createObjectURL(r))},async _fetchNetworkImage(e){let t=`${Zs.baseUrl}/public/getAssetImage/${e}`,r=await Zs.getBlob({path:t,params:de._getSdkProperties()});Dn.setNetworkImage(e,URL.createObjectURL(r))},async _fetchConnectorImage(e){let t=`${Zs.baseUrl}/public/getAssetImage/${e}`,r=await Zs.getBlob({path:t,params:de._getSdkProperties()});Dn.setConnectorImage(e,URL.createObjectURL(r))},async _fetchCurrencyImage(e){let t=`${Zs.baseUrl}/public/getCurrencyImage/${e}`,r=await Zs.getBlob({path:t,params:de._getSdkProperties()});Dn.setCurrencyImage(e,URL.createObjectURL(r))},async _fetchTokenImage(e){let t=`${Zs.baseUrl}/public/getTokenImage/${e}`,r=await Zs.getBlob({path:t,params:de._getSdkProperties()});Dn.setTokenImage(e,URL.createObjectURL(r))},_filterWalletsByPlatform(e){let t=e.length,r=ee.isMobile()?e?.filter(o=>o.mobile_link||o.webapp_link?!0:Object.values(Un).map(i=>i.id).includes(o.id)):e,n=t-r.length;return{filteredWallets:r,mobileFilteredOutWalletsLength:n}},async fetchProjectConfig(){return(await Zs.get({path:"/appkit/v1/config",params:de._getSdkProperties()})).features},async fetchUsage(){try{let e=await Zs.get({path:"/appkit/v1/project-limits",params:de._getSdkProperties()}),{tier:t,isAboveMauLimit:r,isAboveRpcLimit:n}=e.planLimits,o=t==="starter",s=r||n;de.state.plan={tier:t,hasExceededUsageLimit:o&&s,limits:{isAboveRpcLimit:n,isAboveMauLimit:r}}}catch(e){console.warn("Failed to fetch usage",e)}},async fetchAllowedOrigins(){try{let{allowedOrigins:e}=await Zs.get({path:"/projects/v1/origins",params:de._getSdkProperties()});return e}catch(e){if(e instanceof Error&&e.cause instanceof Response){let t=e.cause.status;if(t===j.HTTP_STATUS_CODES.TOO_MANY_REQUESTS)throw new Error("RATE_LIMITED",{cause:e});if(t>=j.HTTP_STATUS_CODES.SERVER_ERROR&&t<600)throw new Error("SERVER_ERROR",{cause:e});return[]}return[]}},async fetchNetworkImages(){let t=k.getAllRequestedCaipNetworks()?.map(({assets:r})=>r?.imageId).filter(Boolean).filter(r=>!vt.getNetworkImageById(r));t&&await Promise.allSettled(t.map(r=>de._fetchNetworkImage(r)))},async fetchConnectorImages(){let{connectors:e}=X.state,t=e.map(({imageId:r})=>r).filter(Boolean);await Promise.allSettled(t.map(r=>de._fetchConnectorImage(r)))},async fetchCurrencyImages(e=[]){await Promise.allSettled(e.map(t=>de._fetchCurrencyImage(t)))},async fetchTokenImages(e=[]){await Promise.allSettled(e.map(t=>de._fetchTokenImage(t)))},async fetchWallets(e){let t=e.exclude??[];de._getSdkProperties().sv.startsWith("html-core-")&&t.push(...Object.values(Un).map(i=>i.id));let n=await Zs.get({path:"/getWallets",params:{...de._getSdkProperties(),...e,page:String(e.page),entries:String(e.entries),include:e.include?.join(","),exclude:t.join(",")}}),{filteredWallets:o,mobileFilteredOutWalletsLength:s}=de._filterWalletsByPlatform(n?.data);return{data:o||[],count:n?.count,mobileFilteredOutWalletsLength:s}},async prefetchWalletRanks(){let e=X.state.connectors;if(!e?.length)return;let t={page:1,entries:20,badge:"certified"};if(t.names=e.map(o=>o.name).join(","),k.state.activeChain===j.CHAIN.EVM){let o=[...e.flatMap(s=>s.connectors?.map(i=>i.info?.rdns)||[]),...e.map(s=>s.info?.rdns)].filter(s=>typeof s=="string"&&s.length>0);o.length&&(t.rdns=o.join(","))}let{data:r}=await de.fetchWallets(t);pt.explorerWallets=r,X.extendConnectorsWithExplorerWallets(r);let n=k.getRequestedCaipNetworkIds().join(",");pt.explorerFilteredWallets=r.filter(o=>o.chains?.some(s=>n.includes(s)))},async fetchFeaturedWallets(){let{featuredWalletIds:e}=W.state;
vendor: 2,979 bytes, line 67
67if(e?.length){let t={...de._getSdkProperties(),page:1,entries:e?.length??yue,include:e},{data:r}=await de.fetchWallets(t),n=[...r].sort((s,i)=>e.indexOf(s.id)-e.indexOf(i.id)),o=n.map(s=>s.image_id).filter(Boolean);await Promise.allSettled(o.map(s=>de._fetchWalletImage(s))),pt.featured=n,pt.allFeatured=n}},async fetchRecommendedWallets(){try{pt.isFetchingRecommendedWallets=!0;let{includeWalletIds:e,excludeWalletIds:t,featuredWalletIds:r}=W.state,n=[...t??[],...r??[]].filter(Boolean),o=k.getRequestedCaipNetworkIds().join(","),s={page:1,entries:yue,include:e,exclude:n,chains:o},{data:i,count:a}=await de.fetchWallets(s),c=ae.getRecentWallets(),l=i.map(d=>d.image_id).filter(Boolean),u=c.map(d=>d.image_id).filter(Boolean);await Promise.allSettled([...l,...u].map(d=>de._fetchWalletImage(d))),pt.recommended=i,pt.allRecommended=i,pt.count=a??0}catch{}finally{pt.isFetchingRecommendedWallets=!1}},async fetchWalletsByPage({page:e,entries:t,badge:r,include:n,exclude:o}){let{includeWalletIds:s,excludeWalletIds:i,featuredWalletIds:a}=W.state,c=k.getRequestedCaipNetworkIds().join(","),l=[...pt.recommended.map(({id:g})=>g),...i??[],...a??[]].filter(Boolean),u={page:e,entries:t??Gke,include:n??s,exclude:o??l,badge_type:r,chains:c},{data:d,count:p,mobileFilteredOutWalletsLength:f}=await de.fetchWallets(u);pt.mobileFilteredOutWalletsLength=f+(pt.mobileFilteredOutWalletsLength??0);let m=d.slice(0,Yke).map(g=>g.image_id).filter(Boolean);await Promise.allSettled(m.map(g=>de._fetchWalletImage(g))),pt.wallets=ee.uniqueBy([...pt.wallets,...de._filterOutExtensions(d)],"id").filter(g=>g.chains?.some(y=>c.includes(y))),pt.count=p>pt.count?p:pt.count,pt.page=e},async initializeExcludedWallets({ids:e}){let t={page:1,entries:e.length,include:e},{data:r}=await de.fetchWallets(t);r&&r.forEach(n=>{pt.excludedWallets.push({rdns:n.rdns,name:n.name})})},async searchWallet({search:e,badge:t,entries:r,page:n,include:o,exclude:s}){let{includeWalletIds:i,excludeWalletIds:a}=W.state,c=k.getRequestedCaipNetworkIds().join(",");pt.search=[];let l={page:n??1,entries:r??100,search:e?.trim(),badge_type:t,include:o??i,exclude:s??a,chains:c},{data:u}=await de.fetchWallets(l);xe.sendEvent({type:"track",event:"SEARCH_WALLET",properties:{badge:t??"",search:e??""}});let d=u.map(p=>p.image_id).filter(Boolean);await Promise.allSettled([...d.map(p=>de._fetchWalletImage(p)),ee.wait(300)]),pt.search=de._filterOutExtensions(u)},initPromise(e,t){let r=pt.promises[e];return r||(pt.promises[e]=t())},prefetch({fetchConnectorImages:e=!0,fetchFeaturedWallets:t=!0,fetchRecommendedWallets:r=!0,fetchNetworkImages:n=!0,fetchWalletRanks:o=!0}={}){let s=[e&&de.initPromise("connectorImages",de.fetchConnectorImages),t&&de.initPromise("featuredWallets",de.fetchFeaturedWallets),r&&de.initPromise("recommendedWallets",de.fetchRecommendedWallets),n&&de.initPromise("networkImages",de.fetchNetworkImages),o&&de.initPromise("walletRanks",de.prefetchWalletRanks)].filter(Boolean);return Promise.allSettled(s)}
67,prefetchAnalyticsConfig(){W.state.features?.analytics&&de.fetchAnalyticsConfig()},async fetchAnalyticsConfig(){try{let{isAnalyticsEnabled:e}=await Zs.get({path:"/getAnalyticsConfig",params:de._getSdkProperties()});W.setFeatures({analytics:e})}catch{W.setFeatures({analytics:!1})}},filterByNamespaces(e){if(!e?.length){pt.featured=pt.allFeatured,pt.recommended=pt.allRecommended;return}let t=k.getRequestedCaipNetworkIds().join(",");pt.featured=pt.allFeatured.filter(r=>r.chains?.some(n=>t.includes(n))),pt.recommended=pt.allRecommended.filter(r=>r.chains?.some(n=>t.includes(n))),pt.filteredWallets=pt.wallets.filter(r=>r.chains?.some(n=>t.includes(n)))},clearFilterByNamespaces(){pt.filteredWallets=[]},setFilterByNamespace(e){if(!e){pt.featured=pt.allFeatured,pt.recommended=pt.allRecommended;return}let t=k.getRequestedCaipNetworkIds().join(",");pt.featured=pt.allFeatured.filter(r=>r.chains?.some(n=>t.includes(n))),pt.recommended=pt.allRecommended.filter(r=>r.chains?.some(n=>t.includes(n))),pt.filteredWallets=pt.wallets.filter(r=>r.chains?.some(n=>t.includes(n)))}}});var is,ML=h(()=>{it();su();Gs();fo();In();sT();ea();xn();ta();is={filterOutDuplicatesByRDNS(e){let t=W.state.enableEIP6963?X.state.connectors:[],r=ae.getRecentWallets(),n=t.map(a=>a.info?.rdns).filter(Boolean),o=r.map(a=>a.rdns).filter(Boolean),s=n.concat(o);if(s.includes("io.metamask.mobile")&&ee.isMobile()){let a=s.indexOf("io.metamask.mobile");s[a]="io.metamask"}return e.filter(a=>!(a?.rdns&&s.includes(String(a.rdns))||!a?.rdns&&t.some(l=>l.name===a.name)))},filterOutDuplicatesByIds(e){let t=X.state.connectors.filter(a=>a.type==="ANNOUNCED"||a.type==="INJECTED"||a.type==="MULTI_CHAIN"),r=ae.getRecentWallets(),n=t.map(a=>a.explorerId||a.explorerWallet?.id||a.id),o=r.map(a=>a.id),s=n.concat(o);return e.filter(a=>!s.includes(a?.id))},filterOutDuplicateWallets(e){let t=this.filterOutDuplicatesByRDNS(e);return this.filterOutDuplicatesByIds(t)},markWalletsAsInstalled(e){let{connectors:t}=X.state,{featuredWalletIds:r}=W.state,n=t.filter(i=>i.type==="ANNOUNCED").reduce((i,a)=>(a.info?.rdns&&(i[a.info.rdns]=!0),i),{});return e.map(i=>({...i,installed:!!i.rdns&&!!n[i.rdns??""]})).sort((i,a)=>{let c=Number(a.installed)-Number(i.installed);if(c!==0)return c;if(r?.length){let l=r.indexOf(i.id),u=r.indexOf(a.id);if(l!==-1&&u!==-1)return l-u;if(l!==-1)return-1;if(u!==-1)return 1}return 0})},getConnectOrderMethod(e,t){let r=e?.connectMethodsOrder||W.state.features?.connectMethodsOrder,n=t||X.state.connectors;if(r)return r;let{injected:o,announced:s}=Tn.getConnectorsByType(n,de.state.recommended,de.state.featured),i=o.filter(Tn.showConnector),a=s.filter(Tn.showConnector);return i.length||a.length?["wallet","email","social"]:We.DEFAULT_CONNECT_METHOD_ORDER},isExcluded(e){let t=!!e.rdns&&de.state.excludedWallets.some(n=>n.rdns===e.rdns),r=!!e.name&&de.state.excludedWallets.some(n=>h8.isLowerCaseMatch(n.name,e.name));return t||r},markWalletsWithDisplayIndex(e){return e.map((t,r)=>({...t,display_index:r}))},filterWalletsByWcSupport(e){return J.state.wcBasic?e.filter(t=>t.supports_wc):ee.isMobile()?e.filter(t=>t.supports_wc||We.MANDATORY_WALLET_IDS_ON_MOBILE.includes(t.id)):e},getWalletConnectWallets(e){let t=[...de.state.featured,...de.state.recommended];de.state.filteredWallets?.length>0?t.push(...de.state.filteredWallets):t.push(...e);let r=ee.uniqueBy(t,"id"),n=is.markWalletsAsInstalled(r),o=is.filterWalletsByWcSupport(n);return is.markWalletsWithDisplayIndex(o)}}});var Tn,sT=h(()=>{it();su();kr();Gs();fo();In();xn();UL();ta();ML();Tn={getConnectorsByType(e,t,r){let{customWallets:n}=W.state,o=ae.getRecentWallets(),s=is.filterOutDuplicateWallets(t),i=is.filterOutDuplicateWallets(r),a=e.filter(d=>d.type==="MULTI_CHAIN"),c=e.filter(d=>d.type==="ANNOUNCED"),l=e.filter(d=>d.type==="INJECTED"),u=e.filter(d=>d.type==="EXTERNAL");return{custom:n,recent:o,external:u,multiChain:a,announced:c,injected:l,recommended:s,featured:i}},showConnector(e){let t=e.info?.rdns,r=!!t&&de.state.excludedWallets.some(o=>!!o.rdns&&o.rdns===t),n=!!e.name&&de.state.excludedWallets.some(o=>h8.isLowerCaseMatch(o.name,e.name));return!(e.type==="INJECTED"&&(e.name==="Browser Wallet"&&(!ee.isMobile()||ee.
vendor: 4,123 bytes, line 67
67isMobile()&&!t&&!J.checkInstalled())||r||n)||(e.type==="ANNOUNCED"||e.type==="EXTERNAL")&&(r||n))},getIsConnectedWithWC(){return Array.from(k.state.chains.values()).some(r=>X.getConnectorId(r.namespace)===j.CONNECTOR_ID.WALLET_CONNECT)},getConnectorTypeOrder({recommended:e,featured:t,custom:r,recent:n,announced:o,injected:s,multiChain:i,external:a,overriddenConnectors:c=W.state.features?.connectorTypeOrder??[]}){let u=[{type:"walletConnect",isEnabled:!0},{type:"recent",isEnabled:n.length>0},{type:"injected",isEnabled:[...s,...o,...i].length>0},{type:"featured",isEnabled:t.length>0},{type:"custom",isEnabled:r&&r.length>0},{type:"external",isEnabled:a.length>0},{type:"recommended",isEnabled:e.length>0}].filter(m=>m.isEnabled),d=new Set(u.map(m=>m.type)),p=c.filter(m=>d.has(m)).map(m=>({type:m,isEnabled:!0})),f=u.filter(({type:m})=>!p.some(({type:y})=>y===m));return Array.from(new Set([...p,...f].map(({type:m})=>m)))},sortConnectorsByExplorerWallet(e){return[...e].sort((t,r)=>t.explorerWallet&&r.explorerWallet?(t.explorerWallet.order??0)-(r.explorerWallet.order??0):t.explorerWallet?-1:r.explorerWallet?1:0)},getPriority(e){return e.id===j.CONNECTOR_ID.BASE_ACCOUNT?0:e.id===j.CONNECTOR_ID.COINBASE||e.id===j.CONNECTOR_ID.COINBASE_SDK?1:2},sortConnectorsByPriority(e){return[...e].sort((t,r)=>Tn.getPriority(t)-Tn.getPriority(r))},getAuthName({email:e,socialUsername:t,socialProvider:r}){return t?r&&r==="discord"&&t.endsWith("0")?t.slice(0,-1):t:e.length>30?`${e.slice(0,-3)}...`:e},async fetchProviderData(e){try{if(e.name==="Browser Wallet"&&!ee.isMobile())return{accounts:[],chainId:void 0};if(e.id===j.CONNECTOR_ID.AUTH)return{accounts:[],chainId:void 0};let[t,r]=await Promise.all([e.provider?.request({method:"eth_accounts"}),e.provider?.request({method:"eth_chainId"}).then(n=>Number(n))]);return{accounts:t,chainId:r}}catch(t){return console.warn(`Failed to fetch provider data for ${e.name}`,t),{accounts:[],chainId:void 0}}},getFilteredCustomWallets(e){let t=ae.getRecentWallets(),r=X.state.connectors.map(i=>i.info?.rdns).filter(Boolean),n=t.map(i=>i.rdns).filter(Boolean),o=r.concat(n);if(o.includes("io.metamask.mobile")&&ee.isMobile()){let i=o.indexOf("io.metamask.mobile");o[i]="io.metamask"}return e.filter(i=>!o.includes(String(i?.rdns)))},hasWalletConnector(e){return X.state.connectors.some(t=>t.id===e.id||t.name===e.name)},isWalletCompatibleWithCurrentChain(e){let t=k.state.activeChain;return t&&e.chains?e.chains.some(r=>{let n=r.split(":")[0];return t===n}):!0},getFilteredRecentWallets(){return ae.getRecentWallets().filter(r=>!is.isExcluded(r)).filter(r=>!this.hasWalletConnector(r)).filter(r=>this.isWalletCompatibleWithCurrentChain(r))},getCappedRecommendedWallets(e){let{connectors:t}=X.state,{customWallets:r,featuredWalletIds:n}=W.state,o=t.find(C=>C.id==="walletConnect"),s=t.filter(C=>C.type==="INJECTED"||C.type==="ANNOUNCED"||C.type==="MULTI_CHAIN");if(!o&&!s.length&&!r?.length)return[];let i=J4.isEmailEnabled(),a=J4.isSocialsEnabled(),c=s.filter(C=>C.name!=="Browser Wallet"&&C.name!=="WalletConnect"),l=n?.length||0,u=r?.length||0,d=c.length||0,p=i?1:0,f=a?1:0,m=l+u+d+p+f,y=Math.max(0,4-m);return y<=0?[]:is.filterOutDuplicateWallets(e).slice(0,y)},processConnectorsByType(e,t=!0){let r=Tn.sortConnectorsByExplorerWallet([...e]);return t?r.filter(Tn.showConnector):r},connectorList(){let e=Tn.getConnectorsByType(X.state.connectors,de.state.recommended,de.state.featured),t=this.processConnectorsByType(e.announced.filter(f=>f.id!=="walletConnect")),r=this.processConnectorsByType(e.injected),n=this.processConnectorsByType(e.multiChain.filter(f=>f.name!=="WalletConnect"),!1),o=e.custom,s=e.recent,i=this.processConnectorsByType(e.external.filter(f=>f.id!==j.CONNECTOR_ID.COINBASE_SDK&&f.id!==j.CONNECTOR_ID.BASE_ACCOUNT)),a=e.recommended,c=e.featured,l=Tn.getConnectorTypeOrder({custom:o,recent:s,announced:t,injected:r,multiChain:n,recommended:a,featured:c,external:i}),u=X.state.connectors.find(f=>f.id==="walletConnect"),d=ee.isMobile(),p=[];for(let f of l)switch(f){case"walletConnect":{!d&&u&&p.push({kind:"connector",subtype:"walletConnect",connector:u});break}
67case"recent":{Tn.getFilteredRecentWallets().forEach(g=>p.push({kind:"wallet",subtype:"recent",wallet:g}));break}case"injected":{n.forEach(m=>p.push({kind:"connector",subtype:"multiChain",connector:m})),t.forEach(m=>p.push({kind:"connector",subtype:"announced",connector:m})),r.forEach(m=>p.push({kind:"connector",subtype:"injected",connector:m}));break}case"featured":{c.forEach(m=>p.push({kind:"wallet",subtype:"featured",wallet:m}));break}case"custom":{Tn.getFilteredCustomWallets(o??[]).forEach(g=>p.push({kind:"wallet",subtype:"custom",wallet:g}));break}case"external":{i.forEach(m=>p.push({kind:"connector",subtype:"external",connector:m}));break}case"recommended":{Tn.getCappedRecommendedWallets(a).forEach(g=>p.push({kind:"wallet",subtype:"recommended",wallet:g}));break}default:console.warn(`Unknown connector type: ${f}`)}return p},hasInjectedConnectors(){return X.state.connectors.filter(e=>(e.type==="INJECTED"||e.type==="ANNOUNCED"||e.type==="MULTI_CHAIN")&&e.name!=="Browser Wallet"&&e.name!=="WalletConnect").length}}});var Jke,dr,Qke,Z,rc=h(()=>{Rr();Pn();ss();su();kr();fo();Mp();In();Jke=["ConnectingExternal","ConnectingMultiChain","ConnectingSocial","ConnectingFarcaster"],dr=Xe({view:"Connect",history:["Connect"],transactionStack:[]}),Qke={state:dr,subscribeKey(e,t){return Ct(dr,e,t)},pushTransactionStack(e){dr.transactionStack.push(e)},popTransactionStack(e){let t=dr.transactionStack.pop();if(!t)return;let{onSuccess:r,onError:n,onCancel:o}=t;switch(e){case"success":r?.();break;case"error":n?.(),Z.goBack();break;case"cancel":o?.(),Z.goBack();break;default:}},push(e,t){let r=e,n=t;de.state.plan.hasExceededUsageLimit&&Jke.includes(e)&&(r="UsageExceeded",n=void 0),r!==dr.view&&(dr.view=r,dr.history.push(r),dr.data=n)},reset(e,t){dr.view=e,dr.history=[e],dr.data=t},replace(e,t){dr.history.at(-1)===e||(dr.view=e,dr.history[dr.history.length-1]=e,dr.data=t)},goBack(){let e=k.state.activeCaipAddress,t=Z.state.view==="ConnectingFarcaster",r=!e&&t;if(dr.history.length>1){dr.history.pop();let[n]=dr.history.slice(-1);n&&(e&&n==="Connect"?dr.view="Account":dr.view=n)}else Oe.close();dr.data?.wallet&&(dr.data.wallet=void 0),dr.data?.redirectView&&(dr.data.redirectView=void 0),setTimeout(()=>{if(r){k.setAccountProp("farcasterUrl",void 0,k.state.activeChain);let n=X.getAuthConnector();n?.provider?.reload();let o=Rl(W.state);n?.provider?.syncDappData?.({metadata:o.metadata,sdkVersion:o.sdkVersion,projectId:o.projectId,sdkType:o.sdkType})}},100)},goBackToIndex(e){if(dr.history.length>1){dr.history=dr.history.slice(0,e+1);let[t]=dr.history.slice(-1);t&&(dr.view=t)}},goBackOrCloseModal(){Z.state.history.length>1?Z.goBack():Oe.close()}},Z=gr(Qke)});var Hp,HL,Gr,$L=h(()=>{Rr();it();ss();fo();Hp=Xe({themeMode:"dark",themeVariables:{},w3mThemeVariables:void 0}),HL={state:Hp,subscribe(e){return Ot(Hp,()=>e(Hp))},setThemeMode(e){Hp.themeMode=e;try{let t=X.getAuthConnector();if(t){let r=HL.getSnapshot().themeVariables;t.provider.syncTheme({themeMode:e,themeVariables:r,w3mThemeVariables:d1(r,e)})}}catch{console.info("Unable to sync theme to auth connector")}},setThemeVariables(e){Hp.themeVariables={...Hp.themeVariables,...e};try{let t=X.getAuthConnector();if(t){let r=HL.getSnapshot().themeVariables;t.provider.syncTheme({themeVariables:r,w3mThemeVariables:d1(Hp.themeVariables,Hp.themeMode)})}}catch{console.info("Unable to sync theme to auth connector")}},getSnapshot(){return Rl(Hp)}},Gr=gr(HL)});var wue,Xke,Wt,eDe,X,fo=h(()=>{Rr();Pn();it();D0();nc();sT();oT();ta();ss();su();kr();Mp();In();rc();$L();wue=Object.fromEntries(JC.map(e=>[e,void 0])),Xke=Object.fromEntries(JC.map(e=>[e,!0])),Wt=Xe({allConnectors:[],connectors:[],activeConnector:void 0,filterByNamespace:void 0,activeConnectorIds:wue,filterByNamespaceMap:Xke}),eDe={state:Wt,subscribe(e){return Ot(Wt,()=>{e(Wt)})},subscribeKey(e,t){return Ct(Wt,e,t)},initialize(e){e.forEach(t=>{let r=ae.getConnectedConnectorId(t);r&&X.setConnectorId(r,t)})},setActiveConnector(e){e&&(Wt.activeConnector=tp(e))},setConnectors(e){e.filter(o=>!Wt.allConnectors.some(s=>s.id===o.id&&X.getConnectorName(s.name)===X.getConnectorName(o.name)&&s.chain===o.chain)).forEac
vendor: 4,096 bytes, line 67
67h(o=>{o.type!=="MULTI_CHAIN"&&Wt.allConnectors.push(tp(o))});let r=X.getEnabledNamespaces(),n=X.getEnabledConnectors(r);Wt.connectors=X.mergeMultiChainConnectors(n)},filterByNamespaces(e){Object.keys(Wt.filterByNamespaceMap).forEach(t=>{Wt.filterByNamespaceMap[t]=!1}),e.forEach(t=>{Wt.filterByNamespaceMap[t]=!0}),X.updateConnectorsForEnabledNamespaces()},filterByNamespace(e,t){Wt.filterByNamespaceMap[e]=t,X.updateConnectorsForEnabledNamespaces()},updateConnectorsForEnabledNamespaces(){let e=X.getEnabledNamespaces(),t=X.getEnabledConnectors(e),r=X.areAllNamespacesEnabled();Wt.connectors=X.mergeMultiChainConnectors(t),r?de.clearFilterByNamespaces():de.filterByNamespaces(e)},getEnabledNamespaces(){return Object.entries(Wt.filterByNamespaceMap).filter(([e,t])=>t).map(([e])=>e)},getEnabledConnectors(e){return Wt.allConnectors.filter(t=>e.includes(t.chain))},areAllNamespacesEnabled(){return Object.values(Wt.filterByNamespaceMap).every(e=>e)},mergeMultiChainConnectors(e){let t=X.generateConnectorMapByName(e),r=[];return t.forEach(n=>{let o=n[0],s=o?.id===j.CONNECTOR_ID.AUTH;n.length>1&&o?r.push({name:o.name,imageUrl:o.imageUrl,imageId:o.imageId,connectors:[...n],type:s?"AUTH":"MULTI_CHAIN",chain:"eip155",id:o?.id||""}):o&&r.push(o)}),r},generateConnectorMapByName(e){let t=new Map;return e.forEach(r=>{let{name:n}=r,o=X.getConnectorName(n);if(!o)return;let s=t.get(o)||[];s.find(a=>a.chain===r.chain)||s.push(r),t.set(o,s)}),t},getConnectorName(e){return e&&({"Trust Wallet":"Trust"}[e]||e)},getUniqueConnectorsByName(e){let t=[];return e.forEach(r=>{t.find(n=>n.chain===r.chain)||t.push(r)}),t},addConnector(e){if(e.id===j.CONNECTOR_ID.AUTH){let t=e,r=Rl(W.state),n=Gr.getSnapshot().themeMode,o=Gr.getSnapshot().themeVariables;t?.provider?.syncDappData?.({metadata:r.metadata,sdkVersion:r.sdkVersion,projectId:r.projectId,sdkType:r.sdkType}),t?.provider?.syncTheme({themeMode:n,themeVariables:o,w3mThemeVariables:d1(o,n)}),X.setConnectors([e])}else X.setConnectors([e])},getAuthConnector(e){let t=e||k.state.activeChain,r=Wt.connectors.find(n=>n.id===j.CONNECTOR_ID.AUTH);if(r)return r?.connectors?.length?r.connectors.find(o=>o.chain===t):r},getAnnouncedConnectorRdns(){return Wt.connectors.filter(e=>e.type==="ANNOUNCED").map(e=>e.info?.rdns)},getConnectorById(e){return Tn.sortConnectorsByPriority(Wt.allConnectors).find(r=>r.id===e)},getConnector({id:e,namespace:t}){let r=t||k.state.activeChain,n=Wt.allConnectors.filter(i=>i.chain===r);return Tn.sortConnectorsByPriority(n).find(i=>i.id===e||i.explorerId===e)},syncIfAuthConnector(e){if(e.id!=="AUTH")return;let t=e,r=Rl(W.state),n=Gr.getSnapshot().themeMode,o=Gr.getSnapshot().themeVariables;t?.provider?.syncDappData?.({metadata:r.metadata,sdkVersion:r.sdkVersion,sdkType:r.sdkType,projectId:r.projectId}),t.provider.syncTheme({themeMode:n,themeVariables:o,w3mThemeVariables:d1(o,n)})},getConnectorsByNamespace(e){let t=Wt.allConnectors.filter(r=>r.chain===e);return X.mergeMultiChainConnectors(t)},canSwitchToSmartAccount(e){return k.checkIfSmartAccountEnabled()&&Dr(e)===$r.ACCOUNT_TYPES.EOA},selectWalletConnector(e){let t=Z.state.data?.redirectView,r=k.state.activeChain,n=r?X.getConnector({id:e.id,namespace:r}):void 0;Q4.handleMobileDeeplinkRedirect(n?.explorerId||e.id,k.state.activeChain,{isCoinbaseDisabled:W.state.enableCoinbase===!1}),n?Z.push("ConnectingExternal",{connector:n,wallet:e,redirectView:t}):Z.push("ConnectingWalletConnect",{wallet:e,redirectView:t})},getConnectors(e){return e?X.getConnectorsByNamespace(e):X.mergeMultiChainConnectors(Wt.allConnectors)},setFilterByNamespace(e){Wt.filterByNamespace=e,Wt.connectors=X.getConnectors(e),de.setFilterByNamespace(e)},setConnectorId(e,t){e&&(Wt.activeConnectorIds={...Wt.activeConnectorIds,[t]:e},ae.setConnectedConnectorId(t,e))},removeConnectorId(e){Wt.activeConnectorIds={...Wt.activeConnectorIds,[e]:void 0},ae.deleteConnectedConnectorId(e)},getConnectorId(e){if(e)return Wt.activeConnectorIds[e]},isConnected(e){return e?!!Wt.activeConnectorIds[e]:Object.values(Wt.activeConnectorIds).some(t=>!!t)},resetConnectorIds(){Wt.activeConnectorIds={...wue}}
67,extendConnectorsWithExplorerWallets(e){Wt.allConnectors.forEach(n=>{let o=e.find(s=>s.id===n.id||s.rdns&&s.rdns===n.info?.rdns);o&&(n.explorerWallet=o)});let t=X.getEnabledNamespaces(),r=X.getEnabledConnectors(t);Wt.connectors=X.mergeMultiChainConnectors(r)},async connect(e={}){let{namespace:t}=e;return X.setFilterByNamespace(t),Z.push("Connect",{addWalletForNamespace:t}),new Promise((r,n)=>{if(t){let o=k.subscribeChainProp("accountState",i=>{i?.caipAddress&&(r({caipAddress:i?.caipAddress}),o())},t),s=Oe.subscribeKey("open",i=>{i||(n(new Error("Modal closed")),s())})}else{let o=k.subscribeKey("activeCaipAddress",i=>{i&&(r({caipAddress:i}),o())}),s=Oe.subscribeKey("open",i=>{i||(n(new Error("Modal closed")),s())})}})}},X=gr(eDe)});var tDe,Fb,bue=h(()=>{it();it();D0();kr();Gs();fo();tc();Mp();rc();nc();ea();xn();ta();tDe=1e3,Fb={checkNamespaceConnectorId(e,t){return X.getConnectorId(e)===t},isSocialProvider(e){return We.DEFAULT_REMOTE_FEATURES.socials.includes(e)},connectWalletConnect({walletConnect:e,connector:t,closeModalOnConnect:r=!0,redirectViewOnModalClose:n="Connect",onOpen:o,onConnect:s}){return new Promise((i,a)=>{if(e&&X.setActiveConnector(t),o?.(ee.isMobile()&&e),n){let l=Oe.subscribeKey("open",u=>{u||(Z.state.view!==n&&Z.replace(n),l(),a(new Error("Modal closed")))})}let c=k.subscribeKey("activeCaipAddress",l=>{l&&(s?.(),r&&Oe.close(),c(),i(Qe.parseCaipAddress(l)))})})},connectExternal(e){return new Promise((t,r)=>{let n=k.subscribeKey("activeCaipAddress",o=>{o&&(Oe.close(),n(),t(Qe.parseCaipAddress(o)))});J.connectExternal(e,e.chain).catch(()=>{n(),r(new Error("Connection rejected"))})})},connectSocial({social:e,namespace:t,closeModalOnConnect:r=!0,onOpenFarcaster:n,onConnect:o}){let s,i=!1,a=null,c=t||k.state.activeChain,l=k.subscribeKey("activeCaipAddress",u=>{u&&(r&&Oe.close(),l())});return new Promise((u,d)=>{async function p(m){if(m.data?.resultUri)if(m.origin===j.SECURE_SITE_SDK_ORIGIN){window.removeEventListener("message",p,!1);try{let g=X.getAuthConnector(c);if(g&&!i){s&&s.close(),i=!0;let y=m.data.resultUri;xe.sendEvent({type:"track",event:"SOCIAL_LOGIN_REQUEST_USER_DATA",properties:{provider:e}}),ae.setConnectedSocialProvider(e),await J.connectExternal({id:g.id,type:g.type,socialUri:y},g.chain);let b=k.state.activeCaipAddress;if(!b){d(new Error("Failed to connect"));return}u(Qe.parseCaipAddress(b)),xe.sendEvent({type:"track",event:"SOCIAL_LOGIN_SUCCESS",properties:{provider:e}})}}catch(g){xe.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:ee.parseError(g)}}),d(new Error("Failed to connect"))}}else xe.sendEvent({type:"track",event:"SOCIAL_LOGIN_ERROR",properties:{provider:e,message:"Untrusted Origin"}})}async function f(){if(xe.sendEvent({type:"track",event:"SOCIAL_LOGIN_STARTED",properties:{provider:e}}),e==="farcaster"){n?.();let m=Oe.subscribeKey("open",y=>{!y&&e==="farcaster"&&(d(new Error("Popup closed")),o?.(),m())}),g=X.getAuthConnector();if(g&&!k.getAccountData(c)?.farcasterUrl)try{let{url:b}=await g.provider.getFarcasterUri();k.setAccountProp("farcasterUrl",b,c)}catch{d(new Error("Failed to connect to farcaster"))}}else{let m=X.getAuthConnector();a=ee.returnOpenHref(`${j.SECURE_SITE_SDK_ORIGIN}/loading`,"popupWindow","width=600,height=800,scrollbars=yes");try{if(m){let{uri:g}=await m.provider.getSocialRedirectUri({provider:e});if(a&&g){a.location.href=g,s=a;let y=setInterval(()=>{s?.closed&&!i&&(d(new Error("Popup closed")),clearInterval(y))},1e3);window.addEventListener("message",p,!1)}else a?.close(),d(new Error("Failed to initiate social connection"))}}catch{d(new Error("Failed to initiate social connection")),a?.close()}}}f()})},connectEmail({closeModalOnConnect:e=!0,redirectViewOnModalClose:t="Connect",onOpen:r,onConnect:n}){return new Promise((o,s)=>{if(r?.(),t){let a=Oe.subscribeKey("open",c=>{c||(Z.state.view!==t&&Z.replace(t),a(),s(new Error("Modal closed")))})}let i=k.subscribeKey("activeCaipAddress",a=>{a&&(n?.(),e&&Oe.close(),i(),o(Qe.parseCaipAddress(a)))})})},async updateEmail(){let e=ae.getConnectedConnectorId(k.state.activeChain),t=X.getAuthConnector();if(!t)throw new Error("No auth connector found");if(e!==j.CONNECTOR_ID.AUTH)throw new Error("Not connected to email or social");let r=t.provider.getEmail()??"";return await Oe.open({view:"UpdateEmailWallet",data:{email:r,redirectView:void 0}}),new Promise((n,o)=>{let s=setInterval(()=>{let a=t.provider.getEmail()??"";a!==r&&(Oe.close(),clearInterval(s),i(),n({email:a}))},tDe),i=Oe.subscribeKey("open",a=>{a||(Z.state.view!=="Connect"&&Z.push("Connect"),clearInterval(s),i(),o(new Error("Modal closed")))})})},canSwitchToSmartAccount(e){return k.checkIfSmartAccountEnabled()&&Dr(e)===$r.ACCOUNT_TYPES.EOA}}});function Vb(){let e=k.state.activeCaipNetwork?.chainNamespace||"eip155",t=k.state.activeCaipNetwork?.id||1,r=We.NATIVE_TOKEN_ADDRESS[e];return`${e}:${t}:${r}`}function FL(e){return We.NATIVE_TOKEN_ADDRESS[e]}function Dr(e){return k.getAccountData(e)?.preferredAccountType}function mg(e){return e?k.state.chains.get(e)?.networkState?.caipNetwork:k.state.activeCaipNetwork}var nc=h(()=>{kr();ea()});var $p,VL=h(()=>{Gs();fo();tc();In();xn();$p={getConnectionStatus(e,t){let r=X.state.activeConnectorIds[t],n=J.getConnections(t);return!!r&&e.connectorId===r?"connected":n.some(i=>i.connectorId.toLowerCase()===e.connectorId.toLowerCase())?"active":"disconnected"},excludeConnectorAddressFromConnections({connections:e,connectorId:t,addresses:r}){return e.map(n=>{if((t?n.connectorId.toLowerCase()===t.toLowerCase():!1)&&r){let s=n.accounts.filter(i=>!r.some(c=>
67c.toLowerCase()===i.address.toLowerCase()));return{...n,accounts:s}}return n})},excludeExistingConnections(e,t){let r=new Set(e);return t.filter(n=>!r.has(n.connectorId))},getConnectionsByConnectorId(e,t){return e.filter(r=>r.connectorId.toLowerCase()===t.toLowerCase())},getConnectionsData(e){let t=!!W.state.remoteFeatures?.multiWallet,r=X.state.activeConnectorIds[e],n=J.getConnections(e),s=(J.state.recentConnections.get(e)??[]).filter(a=>X.getConnectorById(a.connectorId)),i=$p.excludeExistingConnections([...n.map(a=>a.connectorId),...r?[r]:[]],s);return t?{connections:n,recentConnections:i}:{connections:n.filter(a=>a.connectorId.toLowerCase()===r?.toLowerCase()),recentConnections:[]}},onConnectMobile(e,t){let r=J.state.wcUri;if(e?.mobile_link&&r)try{J.setWcError(!1);let{mobile_link:n,link_mode:o,name:s}=e,i=ee.appendPayToUri(r,t),{redirect:a,redirectUniversalLink:c,href:l}=ee.formatNativeUrl(n,i,o),u=a,d=c,p=ee.isIframe()?"_top":"_self";J.setWcLinking({name:s,href:l}),J.setRecentWallet(e),W.state.experimental_preferUniversalLinks&&d?ee.openHref(d,p):ee.openHref(u,p)}catch(n){xe.sendEvent({type:"track",event:"CONNECT_PROXY_ERROR",properties:{message:n instanceof Error?n.message:"Error parsing the deep link",uri:r,mobile_link:e.mobile_link,name:e.name}}),J.setWcError(!0)}}}});var zb,as,X4=h(()=>{Rr();Pn();zb=Xe({loading:!1,open:!1,selectedNetworkId:void 0,activeChain:void 0,initialized:!1,connectingWallet:void 0}),as={state:zb,subscribe(e){return Ot(zb,()=>e(zb))},subscribeOpen(e){return Ct(zb,"open",e)},set(e){Object.assign(zb,{...zb,...e})}}});var Yr,rDe,e3,xue=h(()=>{Rr();D0();nc();ss();Lp();kr();tc();In();k0();Yr=Xe({transactions:[],transactionsByYear:{},lastNetworkInView:void 0,loading:!1,empty:!1,next:void 0}),rDe={state:Yr,subscribe(e){return Ot(Yr,()=>e(Yr))},setLastNetworkInView(e){Yr.lastNetworkInView=e},async fetchTransactions(e){if(!e)throw new Error("Transactions can't be fetched without an accountAddress");Yr.loading=!0;try{let t=await Me.fetchTransactions({account:e,cursor:Yr.next,chainId:k.state.activeCaipNetwork?.caipNetworkId}),r=e3.filterSpamTransactions(t.data),n=e3.filterByConnectedChain(r),o=[...Yr.transactions,...n];Yr.loading=!1,Yr.transactions=o,Yr.transactionsByYear=e3.groupTransactionsByYearAndMonth(Yr.transactionsByYear,n),Yr.empty=o.length===0,Yr.next=t.next?t.next:void 0}catch{let r=k.state.activeChain;xe.sendEvent({type:"track",event:"ERROR_FETCH_TRANSACTIONS",properties:{address:e,projectId:W.state.projectId,cursor:Yr.next,isSmartAccount:Dr(r)===$r.ACCOUNT_TYPES.SMART_ACCOUNT}}),Ze.showError("Failed to fetch transactions"),Yr.loading=!1,Yr.empty=!0,Yr.next=void 0}},groupTransactionsByYearAndMonth(e={},t=[]){let r=e;return t.forEach(n=>{let o=new Date(n.metadata.minedAt).getFullYear(),s=new Date(n.metadata.minedAt).getMonth(),i=r[o]??{},c=(i[s]??[]).filter(l=>l.id!==n.id);r[o]={...i,[s]:[...c,n].sort((l,u)=>new Date(u.metadata.minedAt).getTime()-new Date(l.metadata.minedAt).getTime())}}),r},filterSpamTransactions(e){return e.filter(t=>!t.transfers?.every(n=>n.nft_info?.flags.is_spam===!0))},filterByConnectedChain(e){let t=k.state.activeCaipNetwork?.caipNetworkId;return e.filter(n=>n.metadata.chain===t)},clearCursor(){Yr.next=void 0},resetTransactions(){Yr.transactions=[],Yr.transactionsByYear={},Yr.lastNetworkInView=void 0,Yr.loading=!1,Yr.empty=!1,Yr.next=void 0}},e3=gr(rDe,"API_ERROR")});var Et,L0,nDe,J,Gs=h(()=>{Rr();Pn();it();nc();VL();bue();xn();ta();ss();kr();fo();tc();Mp();X4();rc();xue();Et=Xe({connections:new Map,recentConnections:new Map,isSwitchingConnection:!1,wcError:!1,wcFetchingUri:!1,buffering:!1,status:"disconnected"}),nDe={state:Et,subscribe(e){return Ot(Et,()=>e(Et))},subscribeKey(e,t){return Ct(Et,e,t)},_getClient(){return Et._client},setClient(e){Et._client=tp(e)},initialize(e){let t=e.filter(r=>!!r.namespace).map(r=>r.namespace);J.syncStorageConnections(t)},syncStorageConnections(e){let t=ae.getConnections(),r=e??Array.from(k.state.chains.keys());for(let n of r){let o=t[n]??[],s=new Map(Et.recentConnections);s.set(n,o),Et.recentConnections=s}},getConnections(e){return e?Et.connections.get(e)??[]:[]},hasAnyConnection(e){let t=J.state.connections;return Array.from(t.values()).flatMap(r=>r).some(({connectorId:r})=>r===e)},async connectWalletConnect({cache:e="auto"}={}){Et.wcFetchingUri=!0;let t=ee.isTelegram()||ee.isSafari()&&ee.isIos();try{if(e==="always"||e==="auto"&&t){if(L0){await L0,L0=void 0;return}if(!ee.isPairingExpired(Et?.wcPairingExpiry)){let r=Et.wcUri;Et.wcUri=r;return}L0=J._getClient()?.connectWalletConnect?.(),J.state.status="connecting",await L0,L0=void 0,Et.wcPairingExpiry=void 0,J.state.status="connected"}else await J._getClient()?.connectWalletConnect?.()}catch(r){throw Et.wcError=!0,Et.wcFetchingUri=!1,Et.status="disconnected",L0=void 0,r}},async connectExternal(e,t,r=!0){let n=await J._getClient()?.connectExternal?.(e);
vendor: 5,651 bytes, line 67
67r&&k.setActiveNamespace(t);let o=X.state.allConnectors.find(i=>i.id===e?.id),s=e.type==="AUTH"?"email":"browser";return xe.sendEvent({type:"track",event:"CONNECT_SUCCESS",properties:{method:s,name:o?.name||"Unknown",view:Z.state.view,walletRank:o?.explorerWallet?.order}}),n},async reconnectExternal(e){await J._getClient()?.reconnectExternal?.(e);let t=e.chain||k.state.activeChain;t&&X.setConnectorId(e.id,t)},async setPreferredAccountType(e,t){if(!t)return;Oe.setLoading(!0,k.state.activeChain);let r=X.getAuthConnector();r&&(k.setAccountProp("preferredAccountType",e,t),await r.provider.setPreferredAccount(e),ae.setPreferredAccountTypes(Object.entries(k.state.chains).reduce((n,[o,s])=>{let i=o,a=Dr(i);return a!==void 0&&(n[i]=a),n},{})),await J.reconnectExternal(r),Oe.setLoading(!1,k.state.activeChain),xe.sendEvent({type:"track",event:"SET_PREFERRED_ACCOUNT_TYPE",properties:{accountType:e,network:k.state.activeCaipNetwork?.caipNetworkId||""}}))},async signMessage(e){return J._getClient()?.signMessage(e)},parseUnits(e,t){return J._getClient()?.parseUnits(e,t)},formatUnits(e,t){return J._getClient()?.formatUnits(e,t)},updateBalance(e){return J._getClient()?.updateBalance(e)},async sendTransaction(e){return J._getClient()?.sendTransaction(e)},async getCapabilities(e){return J._getClient()?.getCapabilities(e)},async grantPermissions(e){return J._getClient()?.grantPermissions(e)},async walletGetAssets(e){return J._getClient()?.walletGetAssets(e)??{}},async estimateGas(e){return J._getClient()?.estimateGas(e)},async writeContract(e){return J._getClient()?.writeContract(e)},async writeSolanaTransaction(e){return J._getClient()?.writeSolanaTransaction(e)},async getEnsAddress(e){return J._getClient()?.getEnsAddress(e)},async getEnsAvatar(e){return J._getClient()?.getEnsAvatar(e)},checkInstalled(e){return J._getClient()?.checkInstalled?.(e)||!1},resetWcConnection(){Et.wcUri=void 0,Et.wcPairingExpiry=void 0,Et.wcLinking=void 0,Et.recentWallet=void 0,Et.wcFetchingUri=!1,Et.status="disconnected",e3.resetTransactions(),ae.deleteWalletConnectDeepLink(),ae.deleteRecentWallet(),as.set({connectingWallet:void 0})},resetUri(){Et.wcUri=void 0,Et.wcPairingExpiry=void 0,L0=void 0,Et.wcFetchingUri=!1,as.set({connectingWallet:void 0})},finalizeWcConnection(e){let{wcLinking:t,recentWallet:r}=J.state;t&&ae.setWalletConnectDeepLink(t),r&&ae.setAppKitRecent(r),e&&xe.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:e,properties:{method:t?"mobile":"qrcode",name:Z.state.data?.wallet?.name||"Unknown",view:Z.state.view,walletRank:r?.order}})},setWcBasic(e){Et.wcBasic=e},setUri(e){Et.wcUri=e,Et.wcFetchingUri=!1,Et.wcPairingExpiry=ee.getPairingExpiry()},setWcLinking(e){Et.wcLinking=e},setWcError(e){Et.wcError=e,Et.wcFetchingUri=!1,Et.buffering=!1},setRecentWallet(e){Et.recentWallet=e},setBuffering(e){Et.buffering=e},setStatus(e){Et.status=e},setIsSwitchingConnection(e){Et.isSwitchingConnection=e},async disconnect({id:e,namespace:t,initialDisconnect:r}={}){try{await J._getClient()?.disconnect({id:e,chainNamespace:t,initialDisconnect:r})}catch(n){throw new ec("Failed to disconnect","INTERNAL_SDK_ERROR",n)}},async disconnectConnector({id:e,namespace:t}){try{await J._getClient()?.disconnectConnector({id:e,namespace:t})}catch(r){throw new ec("Failed to disconnect connector","INTERNAL_SDK_ERROR",r)}},setConnections(e,t){let r=new Map(Et.connections);r.set(t,e),Et.connections=r},async handleAuthAccountSwitch({address:e,namespace:t}){let n=k.getAccountData(t)?.user?.accounts?.find(s=>s.type==="smartAccount"),o=n&&n.address.toLowerCase()===e.toLowerCase()&&Fb.canSwitchToSmartAccount(t)?"smartAccount":"eoa";await J.setPreferredAccountType(o,t)},async handleActiveConnection({connection:e,namespace:t,address:r}){let n=X.getConnectorById(e.connectorId),o=e.connectorId===j.CONNECTOR_ID.AUTH;if(!n)throw new Error(`No connector found for connection: ${e.connectorId}`);if(o)r&&await J.handleAuthAccountSwitch({address:r,namespace:t});else return(await J.connectExternal({id:n.id,type:n.type,provider:n.provider,address:r,chain:t},t))?.address;return r},async handleDisconnectedConnection({connection:e,namespace:t,address:r,closeModalOnConnect:n}){let o=X.getConnectorById(e.connectorId),s=e.auth?.name?.toLowerCase(),i=e.connectorId===j.CONNECTOR_ID.AUTH,a=e.connectorId===j.CONNECTOR_ID.WALLET_CONNECT;if(!o)throw new Error(`No connector found for connection: ${e.connectorId}`);let c;if(i)if(s&&Fb.isSocialProvider(s)){let{address:l}=await Fb.connectSocial({social:s,closeModalOnConnect:n,onOpenFarcaster(){Oe.open({view:"ConnectingFarcaster"})},onConnect(){Z.replace("ProfileWallets")}});c=l}else{let{address:l}=await Fb.connectEmail({closeModalOnConnect:n,onOpen(){Oe.open({view:"EmailLogin"})},onConnect(){Z.replace("ProfileWallets")}});c=l}else if(a){let{address:l}=await Fb.connectWalletConnect({walletConnect:!0,connector:o,closeModalOnConnect:n,onOpen(u){let d=u?"AllWallets":"ConnectingWalletConnect";Oe.state.open?Z.push(d):Oe.open({view:d})},onConnect(){Z.replace("ProfileWallets")}});c=l}else{let l=await J.connectExternal({id:o.id,type:o.type,provider:o.provider,chain:t},t);l&&(c=l.address)}return i&&r&&await J.handleAuthAccountSwitch({address:r,namespace:t}),c},async switchConnection({connection:e,address:t,namespace:r,closeModalOnConnect:n,onChange:o}){let s,i=k.getAccountData(r)?.caipAddress;if(i){let{address:c}=Qe.parseCaipAddress(i);s=c}let a=$p.getConnectionStatus(e,r);switch(a){case"connected":case"active":{let c=await J.handleActiveConnection({connection:e,namespace:r,address:t});if(s&&c){let l=c.toLowerCase()!==s.toLowerCase();o?.({address:c,namespace:r,hasSwitchedAccount:l,hasSwitchedWallet:
67a==="active"})}break}case"disconnected":{let c=await J.handleDisconnectedConnection({connection:e,namespace:r,address:t,closeModalOnConnect:n});c&&o?.({address:c,namespace:r,hasSwitchedAccount:!0,hasSwitchedWallet:!0});break}default:throw new Error(`Invalid connection status: ${a}`)}}},J=gr(nDe)});var iT,vue=h(()=>{Mb();iT={createBalance(e,t){let r={name:e.metadata.name||"",symbol:e.metadata.symbol||"",decimals:e.metadata.decimals||0,value:e.metadata.value||0,price:e.metadata.price||0,iconUrl:e.metadata.iconUrl||""};return{name:r.name,symbol:r.symbol,chainId:t,address:e.address==="native"?void 0:this.convertAddressToCAIP10Address(e.address,t),value:r.value,price:r.price,quantity:{decimals:r.decimals.toString(),numeric:this.convertHexToBalance({hex:e.balance,decimals:r.decimals})},iconUrl:r.iconUrl}},convertHexToBalance({hex:e,decimals:t}){return Xo(BigInt(e),t)},convertAddressToCAIP10Address(e,t){return`${t}:${e}`},createCAIP2ChainId(e,t){return`${t}:${parseInt(e,16)}`},getChainIdHexFromCAIP2ChainId(e){let t=e.split(":");if(t.length<2||!t[1])return"0x0";let r=t[1],n=parseInt(r,10);return isNaN(n)?"0x0":`0x${n.toString(16)}`},isWalletGetAssetsResponse(e){return typeof e!="object"||e===null?!1:Object.values(e).every(t=>Array.isArray(t)&&t.every(r=>this.isValidAsset(r)))},isValidAsset(e){return typeof e=="object"&&e!==null&&typeof e.address=="string"&&typeof e.balance=="string"&&(e.type==="ERC20"||e.type==="NATIVE")&&typeof e.metadata=="object"&&e.metadata!==null&&typeof e.metadata.name=="string"&&typeof e.metadata.symbol=="string"&&typeof e.metadata.decimals=="number"&&typeof e.metadata.price=="number"&&typeof e.metadata.iconUrl=="string"}}});async function Eue(){if(!zL){let{createPublicClient:e,http:t,defineChain:r}=await Promise.resolve().then(()=>(Mb(),uue));zL={createPublicClient:e,http:t,defineChain:r}}return zL}var zL,aT,Aue=h(()=>{it();In();aT={getBlockchainApiRpcUrl(e,t){let r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",e),r.searchParams.set("projectId",t),r.toString()},async getViemChain(e){let{defineChain:t}=await Eue(),{chainId:r}=Qe.parseCaipNetworkId(e.caipNetworkId);return t({...e,id:Number(r)})},async createViemPublicClient(e){let{createPublicClient:t,http:r}=await Eue(),n=W.state.projectId,o=await aT.getViemChain(e);if(!o)throw new Error(`Chain ${e.caipNetworkId} not found in viem/chains`);return t({chain:o,transport:r(aT.getBlockchainApiRpcUrl(e.caipNetworkId,n))})}}});var jc,jb=h(()=>{Mb();it();Lp();kr();Gs();fo();vue();ta();Aue();jc={async getMyTokensWithBalance(e={forceUpdate:void 0,caipNetwork:k.state.activeCaipNetwork,address:k.getAccountData()?.address}){let{forceUpdate:t,caipNetwork:r,address:n}=e,o=X.getConnectorId("eip155")===j.CONNECTOR_ID.AUTH;if(!n)return[];let s=r?`${r.caipNetworkId}:${n}`:n,i=ae.getBalanceCacheForCaipAddress(s);if(i)return i.balances;if(r&&r.chainNamespace===j.CHAIN.EVM&&o){let c=await this.getEIP155Balances(n,r);if(c)return this.filterLowQualityTokens(c)}let a=await Me.getBalance(n,r?.caipNetworkId,t);return this.filterLowQualityTokens(a.balances)},async getEIP155Balances(e,t){try{let r=iT.getChainIdHexFromCAIP2ChainId(t.caipNetworkId);if(!(await J.getCapabilities(e))?.[r]?.assetDiscovery?.supported)return null;let o=await J.walletGetAssets({account:e,chainFilter:[r]});if(!iT.isWalletGetAssetsResponse(o))return null;let i=(o[r]||[]).map(a=>iT.createBalance(a,t.caipNetworkId));return ae.updateBalanceCache({caipAddress:`${t.caipNetworkId}:${e}`,balance:{balances:i},timestamp:Date.now()}),i}catch{return null}},filterLowQualityTokens(e){return e.filter(t=>t.quantity.decimals!=="0")},async fetchERC20Balance({caipAddress:e,assetAddress:t,caipNetwork:r}){let n=await aT.createViemPublicClient(r),{address:o}=Qe.parseCaipAddress(e),[{result:s},{result:i},{result:a},{result:c}]=await n.multicall({contracts:[{address:t,functionName:"name",args:[],abi:Br},{address:t,functionName:"symbol",args:[],abi:Br},{address:t,functionName:"balanceOf",args:[o],abi:Br},{address:t,functionName:"decimals",args:[],abi:Br}]});return{name:s,symbol:i,decimals:c,balance:a&&c?Xo(a,c):"0"}}}});var jL,gg,qL=h(()=>{jL={adapters:{}},gg={state:jL,initialize(e){jL.adapters={...e}},get(e){return jL.adapters[e]}}});var cT,Ci,or,lT=h(()=>{Rr();Pn();cT={eip155:void 0,solana:void 0,polkadot:void 0,bip122:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:void 0,tron:void 0},Ci=Xe({providers:{...cT},providerIds:{...cT}}),or={state:Ci,subscribeKey(e,t){return Ct(Ci,e,t)},subscribe(e){return Ot(Ci,()=>{e(Ci)})},subscribeProviders(e){return Ot(Ci.providers,()=>e(Ci.providers))},setProvider(e,t){e&&t&&(Ci.providers[e]=tp(t))},getProvider(e){if(e)return Ci.providers[e]},setProviderId(e,t){t&&(Ci.providerIds[e]=t)},getProviderId(e){if(e)return Ci.providerIds[e]},reset(){Ci.providers={...cT},Ci.providerIds={...cT}},resetChain(e){Ci.providers[e]=void 0,Ci.providerIds[e]=void 0}}});var M0,WL=h(()=>{Lp();kr();Gs();jb();nc();M0={async getTokenList(e){return(await Me.fetchSwapTokens({chainId:e}))?.tokens?.map(n=>({...n,eip2612:!1,quantity:{decimals:"0",numeric:"0"},price:0,value:0}))||[]},async fetchGasPrice(){let e=k.state.activeCaipNetwork;if(!e)return null;try{if(e.chainNamespace==="solana"){let t=(await J?.estimateGas({chainNamespace:"solana"}))?.toString();
vendor: 14,770 bytes, line 67
67return{standard:t,fast:t,instant:t}}else return await Me.fetchGasPrice({chainId:e.caipNetworkId})}catch{return null}},async fetchSwapAllowance({tokenAddress:e,userAddress:t,sourceTokenAmount:r,sourceTokenDecimals:n}){let o=await Me.fetchSwapAllowance({tokenAddress:e,userAddress:t});if(o?.allowance&&r&&n){let s=J.parseUnits(r,n)||0;return BigInt(o.allowance)>=s}return!1},async getMyTokensWithBalance(e){let t=await jc.getMyTokensWithBalance({forceUpdate:e,caipNetwork:k.state.activeCaipNetwork,address:k.getAccountData()?.address});return k.setAccountProp("tokenBalance",t,k.state.activeChain),this.mapBalancesToSwapTokens(t)},mapBalancesToSwapTokens(e){return e?.map(t=>({...t,address:t?.address?t.address:Vb(),decimals:parseInt(t.quantity.decimals,10),logoUri:t.iconUrl,eip2612:!1}))||[]},async handleSwapError(e){try{let t=e?.cause;return t?.json&&(await t.json())?.reasons?.[0]?.description?.includes("insufficient liquidity")?"Insufficient liquidity":void 0}catch{return}}}});var Kt,oDe,mt,KL=h(()=>{Rr();Pn();it();it();D0();jb();nc();ea();xn();WL();ss();kr();Gs();tc();rc();k0();Kt=Xe({tokenBalances:[],loading:!1}),oDe={state:Kt,subscribe(e){return Ot(Kt,()=>e(Kt))},subscribeKey(e,t){return Ct(Kt,e,t)},setToken(e){e&&(Kt.token=tp(e))},setTokenAmount(e){Kt.sendTokenAmount=e},setReceiverAddress(e){Kt.receiverAddress=e},setReceiverProfileImageUrl(e){Kt.receiverProfileImageUrl=e},setReceiverProfileName(e){Kt.receiverProfileName=e},setNetworkBalanceInUsd(e){Kt.networkBalanceInUSD=e},setLoading(e){Kt.loading=e},getSdkEventProperties(e){return{message:ee.parseError(e),isSmartAccount:Dr(k.state.activeChain)===$r.ACCOUNT_TYPES.SMART_ACCOUNT,token:Kt.token?.symbol||"",amount:Kt.sendTokenAmount??0,network:k.state.activeCaipNetwork?.caipNetworkId||""}},async sendToken(){try{switch(mt.setLoading(!0),k.state.activeCaipNetwork?.chainNamespace){case"eip155":await mt.sendEvmToken();return;case"solana":await mt.sendSolanaToken();return;default:throw new Error("Unsupported chain")}}catch(e){throw Ds.isUserRejectedRequestError(e)?new l1(e):e}finally{mt.setLoading(!1)}},async sendEvmToken(){let e=k.state.activeChain;if(!e)throw new Error("SendController:sendEvmToken - activeChainNamespace is required");let t=Dr(e);if(!mt.state.sendTokenAmount||!mt.state.receiverAddress)throw new Error("An amount and receiver address are required");if(!mt.state.token)throw new Error("A token is required");if(mt.state.token?.address){xe.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===$r.ACCOUNT_TYPES.SMART_ACCOUNT,token:mt.state.token.address,amount:mt.state.sendTokenAmount,network:k.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:r}=await mt.sendERC20Token({receiverAddress:mt.state.receiverAddress,tokenAddress:mt.state.token.address,sendTokenAmount:mt.state.sendTokenAmount,decimals:mt.state.token.quantity.decimals});r&&(Kt.hash=r)}else{xe.sendEvent({type:"track",event:"SEND_INITIATED",properties:{isSmartAccount:t===$r.ACCOUNT_TYPES.SMART_ACCOUNT,token:mt.state.token.symbol||"",amount:mt.state.sendTokenAmount,network:k.state.activeCaipNetwork?.caipNetworkId||""}});let{hash:r}=await mt.sendNativeToken({receiverAddress:mt.state.receiverAddress,sendTokenAmount:mt.state.sendTokenAmount,decimals:mt.state.token.quantity.decimals});r&&(Kt.hash=r)}},async fetchTokenBalance(e){Kt.loading=!0;let t=k.state.activeChain,r=k.state.activeCaipNetwork?.caipNetworkId,n=k.state.activeCaipNetwork?.chainNamespace,o=k.getAccountData(t)?.caipAddress??k.state.activeCaipAddress,s=o?ee.getPlainAddress(o):void 0;if(Kt.lastRetry&&!ee.isAllowedRetry(Kt.lastRetry,30*We.ONE_SEC_MS))return Kt.loading=!1,[];try{if(s&&r&&n){let i=await jc.getMyTokensWithBalance();return Kt.tokenBalances=i,Kt.lastRetry=void 0,i}}catch(i){Kt.lastRetry=Date.now(),e?.(i),Ze.showError("Token Balance Unavailable")}finally{Kt.loading=!1}return[]},fetchNetworkBalance(){if(Kt.tokenBalances.length===0)return;let e=M0.mapBalancesToSwapTokens(Kt.tokenBalances);if(!e)return;let t=e.find(r=>r.address===Vb());t&&(Kt.networkBalanceInUSD=t?dt.multiply(t.quantity.numeric,t.price).toString():"0")},async sendNativeToken(e){Z.pushTransactionStack({});let t=e.receiverAddress,r=k.getAccountData()?.address,n=J.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals)),s=await J.sendTransaction({chainNamespace:j.CHAIN.EVM,to:t,address:r,data:"0x",value:n??BigInt(0)});return xe.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Dr("eip155")===$r.ACCOUNT_TYPES.SMART_ACCOUNT,token:mt.state.token?.symbol||"",amount:e.sendTokenAmount,network:k.state.activeCaipNetwork?.caipNetworkId||"",hash:s||""}}),J._getClient()?.updateBalance("eip155"),mt.resetSend(),{hash:s}},async sendERC20Token(e){Z.pushTransactionStack({onSuccess(){Z.replace("Account")}});let t=J.parseUnits(e.sendTokenAmount.toString(),Number(e.decimals)),r=k.getAccountData()?.address;if(r&&e.sendTokenAmount&&e.receiverAddress&&e.tokenAddress){let n=ee.getPlainAddress(e.tokenAddress);if(!n)throw new Error("SendController:sendERC20Token - tokenAddress is required");let o=await J.writeContract({fromAddress:r,tokenAddress:n,args:[e.receiverAddress,t??BigInt(0)],method:"transfer",abi:y8.getERC20Abi(n),chainNamespace:j.CHAIN.EVM});return xe.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:Dr("eip155")===$r.ACCOUNT_TYPES.SMART_ACCOUNT,token:mt.state.token?.symbol||"",amount:e.sendTokenAmount,network:k.state.activeCaipNetwork?.caipNetworkId||"",hash:o||""}}),mt.resetSend(),{hash:o}}return{hash:void 0}},async sendSolanaToken(){if(!mt.state.sendTokenAmount||!mt.state.receiverAddress)throw new Error("An amount and receiver address are required");Z.pushTransactionStack({onSuccess(){Z.replace("Account")}});let e;mt.state.token&&mt.state.token.address!==We.SOLANA_NATIVE_TOKEN_ADDRESS&&(ee.isCaipAddress(mt.state.token.address)?e=ee.getPlainAddress(mt.state.token.address):e=mt.state.token.address);let t=await J.sendTransaction({chainNamespace:"solana",tokenMint:e,to:mt.state.receiverAddress,value:mt.state.sendTokenAmount});t&&(Kt.hash=t),J._getClient()?.updateBalance("solana"),xe.sendEvent({type:"track",event:"SEND_SUCCESS",properties:{isSmartAccount:!1,token:mt.state.token?.symbol||"",amount:mt.state.sendTokenAmount,network:k.state.activeCaipNetwork?.caipNetworkId||"",hash:t||""}}),mt.resetSend()},resetSend(){Kt.token=void 0,Kt.sendTokenAmount=void 0,Kt.receiverAddress=void 0,Kt.receiverProfileImageUrl=void 0,Kt.receiverProfileName=void 0,Kt.loading=!1,Kt.tokenBalances=[]}},mt=gr(oDe)});var ZL,uT,Ie,Cue,k,kr=h(()=>{Rr();Pn();it();SX();jb();ea();xn();ta();ss();qL();Gs();fo();tc();Mp();In();lT();X4();KL();k0();ZL={currentTab:0,tokenBalance:[],smartAccountDeployed:!1,addressLabels:new Map,user:void 0,preferredAccountType:void 0},uT={caipNetwork:void 0,supportsAllNetworks:!0,smartAccountEnabledNetworks:[]},Ie=Xe({chains:vX(),activeCaipAddress:void 0,activeChain:void 0,activeCaipNetwork:void 0,noAdapters:!1,universalAdapter:{connectionControllerClient:void 0},isSwitchingNamespace:!1}),Cue={state:Ie,subscribe(e){return Ot(Ie,()=>{e(Ie)})},subscribeKey(e,t){return Ct(Ie,e,t)},subscribeAccountStateProp(e,t,r){let n=r||Ie.activeChain;return n?Ct(Ie.chains.get(n)?.accountState||{},e,t):()=>{}},subscribeChainProp(e,t,r){let n;return Ot(Ie.chains,()=>{let o=r||Ie.activeChain;if(o){let s=Ie.chains.get(o)?.[e];n!==s&&(n=s,t(s))}})},initialize(e,t,r){let{chainId:n,namespace:o}=ae.getActiveNetworkProps(),s=t?.find(u=>u.id.toString()===n?.toString()),a=e.find(u=>u?.namespace===o)||e?.[0],c=e.map(u=>u.namespace).filter(u=>u!==void 0),l=W.state.enableEmbedded?new Set([...c]):new Set([...t?.map(u=>u.chainNamespace)??[]]);(e?.length===0||!a)&&(Ie.noAdapters=!0),Ie.noAdapters||(Ie.activeChain=a?.namespace,Ie.activeCaipNetwork=s,k.setChainNetworkData(a?.namespace,{caipNetwork:s}),Ie.activeChain&&as.set({activeChain:a?.namespace})),l.forEach(u=>{let d=t?.filter(m=>m.chainNamespace===u),p=ae.getPreferredAccountTypes()||{},f={...W.state.defaultAccountTypes,...p};k.state.chains.set(u,{namespace:u,networkState:Xe({...uT,caipNetwork:d?.[0]}),accountState:Xe({...ZL,preferredAccountType:f[u]}),caipNetworks:d??[],...r}),k.setRequestedCaipNetworks(d??[],u)})},removeAdapter(e){if(Ie.activeChain===e){let t=Array.from(Ie.chains.entries()).find(([r])=>r!==e);if(t){let r=t[1]?.caipNetworks?.[0];r&&k.setActiveCaipNetwork(r)}}Ie.chains.delete(e)},addAdapter(e,{connectionControllerClient:t},r){if(!e.namespace)throw new Error("ChainController:addAdapter - adapter must have a namespace");Ie.chains.set(e.namespace,{namespace:e.namespace,networkState:{...uT,caipNetwork:r[0]},accountState:{...ZL},caipNetworks:r,connectionControllerClient:t}),k.setRequestedCaipNetworks(r?.filter(n=>n.chainNamespace===e.namespace)??[],e.namespace)},addNetwork(e){let t=Ie.chains.get(e.chainNamespace);if(t){let r=[...t.caipNetworks||[]];t.caipNetworks?.find(n=>n.id===e.id)||r.push(e),Ie.chains.set(e.chainNamespace,{...t,caipNetworks:r}),k.setRequestedCaipNetworks(r,e.chainNamespace),X.filterByNamespace(e.chainNamespace,!0)}},removeNetwork(e,t){let r=Ie.chains.get(e);if(r){let n=Ie.activeCaipNetwork?.id===t,o=[...r.caipNetworks?.filter(s=>s.id!==t)||[]];n&&r?.caipNetworks?.[0]&&k.setActiveCaipNetwork(r.caipNetworks[0]),Ie.chains.set(e,{...r,caipNetworks:o}),k.setRequestedCaipNetworks(o||[],e),o.length===0&&X.filterByNamespace(e,!1)}},setAdapterNetworkState(e,t){let r=Ie.chains.get(e);r&&(r.networkState={...r.networkState||uT,...t},Ie.chains.set(e,r))},setChainAccountData(e,t,r=!0){if(!e)throw new Error("Chain is required to update chain account data");let n=Ie.chains.get(e);if(n){let o={...n.accountState||ZL,...t};Ie.chains.set(e,{...n,accountState:o}),(Ie.chains.size===1||Ie.activeChain===e)&&t.caipAddress&&(Ie.activeCaipAddress=t.caipAddress)}},setChainNetworkData(e,t){if(!e)return;let r=Ie.chains.get(e);if(r){let n={...r.networkState||uT,...t};Ie.chains.set(e,{...r,networkState:n})}},setAccountProp(e,t,r,n=!0){k.setChainAccountData(r,{[e]:t},n)},setActiveNamespace(e){Ie.activeChain=e;let t=e?Ie.chains.get(e):void 0,r=t?.networkState?.caipNetwork;r?.id&&e&&(Ie.activeCaipAddress=t?.accountState?.caipAddress,Ie.activeCaipNetwork=r,k.setChainNetworkData(e,{caipNetwork:r}),ae.setActiveCaipNetworkId(r?.caipNetworkId),as.set({activeChain:e,selectedNetworkId:r?.caipNetworkId}))},setActiveCaipNetwork(e){if(!e)return;let t=Ie.activeChain===e.chainNamespace;t||k.setIsSwitchingNamespace(!0);let r=Ie.chains.get(e.chainNamespace);Ie.activeChain=e.chainNamespace,Ie.activeCaipNetwork=e,k.setChainNetworkData(e.chainNamespace,{caipNetwork:e});let n=r?.accountState?.address;if(n)Ie.activeCaipAddress=`${e.chainNamespace}:${e.id}:${n}`;else if(t&&Ie.activeCaipAddress){let{address:s}=Qe.parseCaipAddress(Ie.activeCaipAddress);n=s,Ie.activeCaipAddress=`${e.caipNetworkId}:${n}`}else Ie.activeCaipAddress=void 0;k.setChainAccountData(e.chainNamespace,{address:n,caipAddress:Ie.activeCaipAddress}),mt.resetSend(),as.set({activeChain:Ie.activeChain,selectedNetworkId:Ie.activeCaipNetwork?.caipNetworkId}),ae.setActiveCaipNetworkId(e.caipNetworkId),!k.checkIfSupportedNetwork(e.chainNamespace)&&W.state.enableNetworkSwitch&&!W.state.allowUnsupportedChain&&!J.state.wcBasic&&k.showUnsupportedChainUI()},addCaipNetwork(e){if(!e)return;let t=Ie.chains.get(e.chainNamespace);t&&t?.caipNetworks?.push(e)},async switchActiveNamespace(e){if(!e)return;let t=e!==k.state.activeChain,r=k.getNetworkData(e)?.caipNetwork,n=k.getCaipNetworkByNamespace(e,r?.id);t&&n&&await k.switchActiveNetwork(n)},async switchActiveNetwork(e,{throwOnFailure:t=!1}={}){let r=k.state.activeChain;if(!r)throw new Error("ChainController:switchActiveNetwork - namespace is required");let n=or.getProviderId(Ie.activeChain)==="AUTH",o=k.getAccountData(r)?.address,s=j.AUTH_CONNECTOR_SUPPORTED_CHAINS.includes(e.chainNamespace);try{if(o&&e.chainNamespace===r||n&&s){let i=gg.get(e.chainNamespace);if(!i)throw new Error("Adapter not found");await i.switchNetwork({caipNetwork:e})}k.setActiveCaipNetwork(e)}catch(i){if(t)throw i}xe.sendEvent({type:"track",event:"SWITCH_NETWORK",properties:{network:e.caipNetworkId}})},getConnectionControllerClient(e){let t=e||Ie.activeChain;if(!t)throw new Error("Chain is required to get connection controller client");let r=Ie.chains.get(t);if(!r?.connectionControllerClient)throw new Error("ConnectionController client not set");return r.connectionControllerClient},getNetworkProp(e,t){let r=Ie.chains.get(t)?.networkState;if(r)return r[e]},getRequestedCaipNetworks(e){let t=Ie.chains.get(e),{approvedCaipNetworkIds:r=[],requestedCaipNetworks:n=[]}=t?.networkState||{};return ee.sortRequestedNetworks(r,n).filter(i=>i?.id)},getAllRequestedCaipNetworks(){let e=[];return Ie.chains.forEach(t=>{if(!t.namespace)throw new Error("ChainController:getAllRequestedCaipNetworks - chainAdapter must have a namespace");let r=k.getRequestedCaipNetworks(t.namespace);e.push(...r)}),e},setRequestedCaipNetworks(e,t){k.setAdapterNetworkState(t,{requestedCaipNetworks:e});let n=k.getAllRequestedCaipNetworks().map(s=>s.chainNamespace),o=Array.from(new Set(n));X.filterByNamespaces(o)},getAllApprovedCaipNetworkIds(){let e=[];return Ie.chains.forEach(t=>{if(!t.namespace)throw new Error("ChainController:getAllApprovedCaipNetworkIds - chainAdapter must have a namespace");let r=k.getApprovedCaipNetworkIds(t.namespace);e.push(...r)}),e},getActiveCaipNetwork(e){return e?Ie.chains.get(e)?.networkState?.caipNetwork:Ie.activeCaipNetwork},getActiveCaipAddress(){return Ie.activeCaipAddress},getApprovedCaipNetworkIds(e){return Ie.chains.get(e)?.networkState?.approvedCaipNetworkIds||[]},setApprovedCaipNetworksData(e,t){k.setAdapterNetworkState(e,t)},checkIfSupportedNetwork(e,t){let r=t||Ie.activeCaipNetwork?.caipNetworkId,n=k.getRequestedCaipNetworks(e);return n.length?n?.some(o=>o.caipNetworkId===r):!0},checkIfSupportedChainId(e){return Ie.activeChain?k.getRequestedCaipNetworks(Ie.activeChain)?.some(r=>r.id===e):!0},checkIfSmartAccountEnabled(){let e=o1.caipNetworkIdToNumber(Ie.activeCaipNetwork?.caipNetworkId);return!Ie.activeChain||!e?!1:!!(Cy.get($a.SMART_ACCOUNT_ENABLED_NETWORKS)?.split(",")||[])?.includes(e.toString())},showUnsupportedChainUI(){Oe.open({view:"UnsupportedChain"})},checkIfNamesSupported(){let e=Ie.activeCaipNetwork;return!!(e?.chainNamespace&&We.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(e.chainNamespace))},resetNetwork(e){k.setAdapterNetworkState(e,{approvedCaipNetworkIds:void 0,supportsAllNetworks:!0})},resetAccount(e){let t=e;if(!t)throw new Error("Chain is required to set account prop");let r=k.state.chains.get(t)?.accountState?.preferredAccountType,n=W.state.defaultAccountTypes[t];Ie.activeCaipAddress=void 0,k.setChainAccountData(t,{smartAccountDeployed:!1,currentTab:0,caipAddress:void 0,address:void 0,balance:void 0,balanceSymbol
67:void 0,profileName:void 0,profileImage:void 0,addressExplorerUrl:void 0,tokenBalance:[],connectedWalletInfo:void 0,preferredAccountType:n||r,socialProvider:void 0,socialWindow:void 0,farcasterUrl:void 0,user:void 0,status:"disconnected"}),X.removeConnectorId(t)},setIsSwitchingNamespace(e){Ie.isSwitchingNamespace=e},getFirstCaipNetworkSupportsAuthConnector(){let e=[],t;if(Ie.chains.forEach(r=>{j.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(n=>n===r.namespace)&&r.namespace&&e.push(r.namespace)}),e.length>0){let r=e[0];return t=r?Ie.chains.get(r)?.caipNetworks?.[0]:void 0,t}},getAccountData(e){let t=e||Ie.activeChain;if(t)return k.state.chains.get(t)?.accountState},getNetworkData(e){let t=e||Ie.activeChain;if(t)return k.state.chains.get(t)?.networkState},getCaipNetworkByNamespace(e,t){if(!e)return;let r=k.state.chains.get(e),n=r?.caipNetworks?.find(o=>o.id.toString()===t?.toString());return n||r?.networkState?.caipNetwork||r?.caipNetworks?.[0]},getRequestedCaipNetworkIds(){let e=X.state.filterByNamespace;return(e?[Ie.chains.get(e)]:Array.from(Ie.chains.values())).flatMap(r=>r?.caipNetworks||[]).map(r=>r.caipNetworkId)},getCaipNetworks(e){return e?k.getRequestedCaipNetworks(e):k.getAllRequestedCaipNetworks()},getCaipNetworkById(e,t){return Cue.getCaipNetworks(t).find(r=>r.id.toString()===e.toString()||r.caipNetworkId.toString()===e.toString())},setLastConnectedSIWECaipNetwork(e){Ie.lastConnectedSIWECaipNetwork=e},getLastConnectedSIWECaipNetwork(){return Ie.lastConnectedSIWECaipNetwork},async fetchTokenBalance(e){let t=k.getAccountData();if(!t)return[];let r=k.state.activeCaipNetwork?.caipNetworkId,n=k.state.activeCaipNetwork?.chainNamespace,o=k.state.activeCaipAddress,s=o?ee.getPlainAddress(o):void 0;if(k.setAccountProp("balanceLoading",!0,n),t.lastRetry&&!ee.isAllowedRetry(t.lastRetry,30*We.ONE_SEC_MS))return k.setAccountProp("balanceLoading",!1,n),[];try{if(s&&r&&n){let i=await jc.getMyTokensWithBalance();return k.setAccountProp("tokenBalance",i,n),k.setAccountProp("lastRetry",void 0,n),k.setAccountProp("balanceLoading",!1,n),i}}catch(i){k.setAccountProp("lastRetry",Date.now(),n),e?.(i),Ze.showError("Token Balance Unavailable")}finally{k.setAccountProp("balanceLoading",!1,n)}return[]},isCaipNetworkDisabled(e){let t=e.chainNamespace,r=!!k.getAccountData(t)?.caipAddress,n=k.getAllApprovedCaipNetworkIds(),o=k.getNetworkProp("supportsAllNetworks",t)!==!1,s=X.getConnectorId(t),i=X.getAuthConnector(),a=s===j.CONNECTOR_ID.AUTH&&i;return!r||o||a?!1:!n?.includes(e.caipNetworkId)}},k=gr(Cue)});var Sue,Iue=h(()=>{it();kr();fo();rc();Sue={onSwitchNetwork({network:e,ignoreSwitchConfirmation:t=!1}){let r=k.state.activeCaipNetwork,n=k.state.activeChain,o=Z.state.data;if(e.id===r?.id)return;let i=!!k.getAccountData(n)?.address,a=!!k.getAccountData(e.chainNamespace)?.address,c=e.chainNamespace!==n,u=X.getConnectorId(n)===j.CONNECTOR_ID.AUTH,d=j.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(p=>p===e.chainNamespace);t||u&&d?Z.push("SwitchNetwork",{...o,network:e}):i&&c&&!a?Z.push("SwitchActiveChain",{switchToChain:e.chainNamespace,navigateTo:"Connect",navigateWithReplace:!0,network:e}):Z.push("SwitchNetwork",{...o,network:e})}}});var Si,sDe,Oe,Mp=h(()=>{Rr();Pn();xn();Iue();ss();su();kr();Gs();fo();tc();In();X4();rc();Si=Xe({loading:!1,loadingNamespaceMap:new Map,open:!1,shake:!1,namespace:void 0}),sDe={state:Si,subscribe(e){return Ot(Si,()=>e(Si))},subscribeKey(e,t){return Ct(Si,e,t)},async open(e){let t=e?.namespace,r=k.state.activeChain,n=t&&t!==r,o=k.getAccountData(e?.namespace)?.caipAddress,s=k.state.noAdapters;if(J.state.wcBasic?de.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1}):await de.prefetch(),X.setFilterByNamespace(e?.namespace),Oe.setLoading(!0,t),t&&n){let i=k.getNetworkData(t)?.caipNetwork||k.getRequestedCaipNetworks(t)[0];i&&(s?(await k.switchActiveNetwork(i),Z.push("ConnectingWalletConnectBasic")):Sue.onSwitchNetwork({network:i,ignoreSwitchConfirmation:!0}))}else W.state.manualWCControl||s&&!o?ee.isMobile()?Z.reset("AllWallets"):Z.reset("ConnectingWalletConnectBasic"):e?.view?Z.reset(e.view,e.data):o?Z.reset("Account"):Z.reset("Connect");Si.open=!0,as.set({open:!0}),xe.sendEvent({type:"track",event:"MODAL_OPEN",properties:{connected:!!o}})},close(){let e=W.state.enableEmbedded,t=!!k.state.activeCaipAddress;Si.open&&xe.sendEvent({type:"track",event:"MODAL_CLOSE",properties:{connected:t}}),Si.open=!1,Z.reset("Connect"),Oe.clearLoading(),e?t?Z.replace("Account"):Z.push("Connect"):as.set({open:!1}),J.resetUri()}
67,setLoading(e,t){t&&Si.loadingNamespaceMap.set(t,e),Si.loading=e,as.set({loading:e})},clearLoading(){Si.loadingNamespaceMap.clear(),Si.loading=!1,as.set({loading:!1})},shake(){Si.shake||(Si.shake=!0,setTimeout(()=>{Si.shake=!1},500))}},Oe=gr(sDe)});var t3,GL,iDe,Gt,aDe,r3,Tue=h(()=>{Rr();Pn();it();ea();ss();su();Lp();kr();In();t3={id:"2b92315d-eab7-5bef-84fa-089a131333f5",name:"USD Coin",symbol:"USDC",networks:[{name:"ethereum-mainnet",display_name:"Ethereum",chain_id:"1",contract_address:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{name:"polygon-mainnet",display_name:"Polygon",chain_id:"137",contract_address:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"}]},GL={id:"USD",payment_method_limits:[{id:"card",min:"10.00",max:"7500.00"},{id:"ach_bank_account",min:"10.00",max:"25000.00"}]},iDe={providers:tk,selectedProvider:null,error:null,purchaseCurrency:t3,paymentCurrency:GL,purchaseCurrencies:[t3],paymentCurrencies:[],quotesLoading:!1},Gt=Xe(iDe),aDe={state:Gt,subscribe(e){return Ot(Gt,()=>e(Gt))},subscribeKey(e,t){return Ct(Gt,e,t)},setSelectedProvider(e){if(e&&e.name==="meld"){let t=k.state.activeChain,r=t===j.CHAIN.SOLANA?"SOL":"USDC",n=t?k.state.chains.get(t)?.accountState?.address??"":"",o=new URL(e.url);o.searchParams.append("publicKey",EX),o.searchParams.append("destinationCurrencyCode",r),o.searchParams.append("walletAddress",n),o.searchParams.append("externalCustomerId",W.state.projectId),Gt.selectedProvider={...e,url:o.toString()}}else Gt.selectedProvider=e},setOnrampProviders(e){if(Array.isArray(e)&&e.every(t=>typeof t=="string")){let t=e,r=tk.filter(n=>t.includes(n.name));Gt.providers=r}else Gt.providers=[]},setPurchaseCurrency(e){Gt.purchaseCurrency=e},setPaymentCurrency(e){Gt.paymentCurrency=e},setPurchaseAmount(e){r3.state.purchaseAmount=e},setPaymentAmount(e){r3.state.paymentAmount=e},async getAvailableCurrencies(){let e=await Me.getOnrampOptions();Gt.purchaseCurrencies=e.purchaseCurrencies,Gt.paymentCurrencies=e.paymentCurrencies,Gt.paymentCurrency=e.paymentCurrencies[0]||GL,Gt.purchaseCurrency=e.purchaseCurrencies[0]||t3,await de.fetchCurrencyImages(e.paymentCurrencies.map(t=>t.id)),await de.fetchTokenImages(e.purchaseCurrencies.map(t=>t.symbol))},async getQuote(){Gt.quotesLoading=!0;try{let e=await Me.getOnrampQuote({purchaseCurrency:Gt.purchaseCurrency,paymentCurrency:Gt.paymentCurrency,amount:Gt.paymentAmount?.toString()||"0",network:Gt.purchaseCurrency?.symbol});return Gt.quotesLoading=!1,Gt.purchaseAmount=Number(e?.purchaseAmount.amount),e}catch(e){return Gt.error=e.message,Gt.quotesLoading=!1,null}finally{Gt.quotesLoading=!1}},resetState(){Gt.selectedProvider=null,Gt.error=null,Gt.purchaseCurrency=t3,Gt.paymentCurrency=GL,Gt.purchaseCurrencies=[t3],Gt.paymentCurrencies=[],Gt.paymentAmount=void 0,Gt.purchaseAmount=void 0,Gt.quotesLoading=!1}},r3=gr(aDe)});var cDe,lDe,uDe,BLt,dDe,kLt,dT=h(()=>{Sc();uy();ZC();cDe=Lt(Cs(),1),lDe="wc",uDe="universal_provider",BLt=`${lDe}@2:${uDe}:`,dDe="https://rpc.walletconnect.org/v1/",kLt=`${dDe}bundler`});var _ue,Pue=h(()=>{_ue={convertEVMChainIdToCoinType(e){if(e>=2147483648)throw new Error("Invalid chainId");return(2147483648|e)>>>0}}});var oc,pDe,H0,YL=h(()=>{Rr();Pn();Pue();ta();ss();Lp();kr();Gs();fo();rc();oc=Xe({suggestions:[],loading:!1}),pDe={state:oc,subscribe(e){return Ot(oc,()=>e(oc))},subscribeKey(e,t){return Ct(oc,e,t)},async resolveName(e){try{return await Me.lookupEnsName(e)}catch(t){let r=t;throw new Error(r?.reasons?.[0]?.description||"Error resolving name")}},async isNameRegistered(e){try{return await Me.lookupEnsName(e),!0}catch{return!1}},async getSuggestions(e){try{oc.loading=!0,oc.suggestions=[];let t=await Me.getEnsNameSuggestions(e);return oc.suggestions=t.suggestions||[],oc.suggestions}catch(t){let r=H0.parseEnsApiError(t,"Error fetching name suggestions");throw new Error(r)}finally{oc.loading=!1}},async getNamesForAddress(e){try{if(!k.state.activeCaipNetwork)return[];let r=ae.getEnsFromCacheForAddress(e);if(r)return r;let n=await Me.reverseLookupEnsName({address:e});return ae.updateEnsCache({address:e,ens:n,timestamp:Date.now()}),n}catch(t){let r=H0.parseEnsApiError(t,"Error fetching names for address");throw new Error(r)}},async registerName(e){let t=k.state.activeCaipNetwork,r=k.getAccountData(t?.chainNamespace)?.address,n=X.getAuthConnector();if(!t)throw new Error("Network not found");if(!r||!n)throw new Error("Address or auth connector not found");oc.loading=!0;try{let o=JSON.stringify({name:e,attributes:{},timestamp:Math.floor(Date.now()/1e3)});Z.pushTransactionStack({onCancel(){Z.replace("RegisterAccountName")}});let s=await J.signMessage(o);oc.loading=!1;let i=t.id;if(!i)throw new Error("Network not found");let a=_ue.convertEVMChainIdToCoinType(Number(i));await Me.registerEnsName({coinType:a,address:r,signature:s,message:o}
67),k.setAccountProp("profileName",e,t.chainNamespace),ae.updateEnsCache({address:r,ens:[{name:e,registered_at:new Date().toISOString(),updated_at:void 0,addresses:{},attributes:[]}],timestamp:Date.now()}),Z.replace("RegisterAccountNameSuccess")}catch(o){let s=H0.parseEnsApiError(o,`Error registering name ${e}`);throw Z.replace("RegisterAccountName"),new Error(s)}finally{oc.loading=!1}},validateName(e){return/^[a-zA-Z0-9-]{4,}$/u.test(e)},parseEnsApiError(e,t){return e?.reasons?.[0]?.description||t}},H0=gr(pDe)});function pT(e){try{return new URL(e)}catch{return null}}function fDe(e){let t=e.split("/"),r=t.length>0&&t[0]!==void 0?t[0]:"",n=r.lastIndexOf(":");return n===-1?{host:r}:{host:r.slice(0,n),port:r.slice(n+1)}}function hDe(e){let t=e.indexOf("://");if(t===-1)return null;let r=e.slice(0,t),n=t+3,o=e.indexOf("/",n);o===-1&&(o=e.length);let s=e.slice(n,o),i=s.lastIndexOf(":");return i===-1?{scheme:r,host:s}:{scheme:r,host:s.slice(0,i),port:s.slice(i+1)}}function Nue(e,t){if(t.includes("://")){let i=pT(t);return i?i.origin===e:!1}let{host:r,port:n}=fDe(t),o=e.indexOf("://");if(o!==-1){let i=o+3,a=e.indexOf("/",i);a===-1&&(a=e.length);let c=e.slice(i,a);if(n!==void 0)return`${r}:${n}`===c;let l=c.split(":")[0];return r===l}let s=pT(e);return s?n!==void 0?r===s.hostname&&n===(s.port||void 0):r===s.hostname:!1}function Rue(e,t,r){let n=r,o,s=n.indexOf("://");s!==-1&&(o=n.slice(0,s),n=n.slice(s+3));let i=n.indexOf("/");i!==-1&&(n=n.slice(0,i));let a=n,c,l=a.lastIndexOf(":");l!==-1&&(c=a.slice(l+1),a=a.slice(0,l));let u=a.split(".");for(let g of u)if(g.includes("*")&&g!=="*")return!1;let d=e.protocol.replace(/:$/u,"");if(o&&o!==d||c!==void 0&&c!=="*"&&c!==e.port)return!1;let p=hDe(t),m=(p?p.host:e.hostname).split(".");if(u.length!==m.length)return!1;for(let g=u.length-1;g>=0;g-=1){let y=u[g],b=m[g];if(y!=="*"&&y!==b)return!1}return!0}var Oue=h(()=>{});var mDe,qc,fT=h(()=>{it();YL();Oue();mDe={ton:["ton_sendMessage","ton_signData"],solana:["solana_signMessage","solana_signTransaction","solana_requestAccounts","solana_getAccounts","solana_signAllTransactions","solana_signAndSendTransaction"],eip155:["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_showCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"],bip122:["sendTransfer","signMessage","signPsbt","getAccountAddresses"],tron:["tron_signMessage","tron_signTransaction"]},qc={RPC_ERROR_CODE:{USER_REJECTED:5e3,USER_REJECTED_METHODS:5002},getMethodsByChainNamespace(e){return mDe[e]||[]},createDefaultNamespace(e){return{methods:this.getMethodsByChainNamespace(e),events:["accountsChanged","chainChanged"],chains:[],rpcMap:{}}},applyNamespaceOverrides(e,t){if(!t)return{...e};let r={...e},n=new Set;if(t.methods&&Object.keys(t.methods).forEach(o=>n.add(o)),t.chains&&Object.keys(t.chains).forEach(o=>n.add(o)),t.events&&Object.keys(t.events).forEach(o=>n.add(o)),t.rpcMap&&Object.keys(t.rpcMap).forEach(o=>{let[s]=o.split(":");s&&n.add(s)}),n.forEach(o=>{r[o]||(r[o]=this.createDefaultNamespace(o))}),t.methods&&Object.entries(t.methods).forEach(([o,s])=>{r[o]&&(r[o].methods=s)}),t.chains&&Object.entries(t.chains).forEach(([o,s])=>{r[o]&&(r[o].chains=s)}),t.events&&Object.entries(t.events).forEach(([o,s])=>{r[o]&&(r[o].events=s)}),t.rpcMap){let o=new Set;Object.entries(t.rpcMap).forEach(([s,i])=>{let[a,c]=s.split(":");!a||!c||!r[a]||(r[a].rpcMap||(r[a].rpcMap={}),o.has(a)||(r[a].rpcMap={},o.add(a)),r[a].rpcMap[c]=i)})}return r},createNamespaces(e,t){let r=e.reduce((n,o)=>{let{id:s,chainNamespace:i,rpcUrls:a}=o,c=a.default.http[0];n[i]||(n[i]=this.createDefaultNamespace(i));let l=`${i}:${s}`,u=n[i];switch(u.chains.push(l),l){case"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":u.chains.push("solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ");break;case"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":u.chains.push("solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K");break;default:}return u?.rpcMap&&c&&(u.rpcMap[s]=c),n},{});return this.applyNamespaceOverrides(r,t)},resolveReownName:async e=>{let t=await H0.resolveName(e);return(t?.addresses?Object.values(t.addresses):[])[0]?.address||!1}
vendor: 4,735 bytes, line 67
67,getChainsFromNamespaces(e={}){return Object.values(e).flatMap(t=>{let r=t.chains||[],n=t.accounts.map(o=>{let[s,i]=o.split(":");return`${s}:${i}`});return Array.from(new Set([...r,...n]))})},isSessionEventData(e){return typeof e=="object"&&e!==null&&"id"in e&&"topic"in e&&"params"in e&&typeof e.params=="object"&&e.params!==null&&"chainId"in e.params&&"event"in e.params&&typeof e.params.event=="object"&&e.params.event!==null},isUserRejectedRequestError(e){try{if(typeof e=="object"&&e!==null){let t=e,r=typeof t.code=="number",n=r&&t.code===qc.RPC_ERROR_CODE.USER_REJECTED_METHODS,o=r&&t.code===qc.RPC_ERROR_CODE.USER_REJECTED;return n||o}return!1}catch{return!1}},isOriginAllowed(e,t,r){let n=[...t,...r];if(t.length===0)return!0;let o=pT(e);if(!o)return n.some(s=>!s.includes("*")&&s===e);if(o.hostname==="localhost"||o.hostname==="127.0.0.1")return!0;for(let s of n)if(s.includes("*")){if(Rue(o,e,s))return!0}else if(Nue(e,s))return!0;return!1},listenWcProvider({universalProvider:e,namespace:t,onConnect:r,onDisconnect:n,onAccountsChanged:o,onChainChanged:s,onDisplayUri:i}){r&&e.on("connect",()=>{let a=qc.getWalletConnectAccounts(e,t);r(a)}),n&&e.on("disconnect",()=>{n()}),o&&e.on("accountsChanged",a=>{try{let c=e.session?.namespaces?.[t]?.accounts||[],l=e.rpcProviders?.[t]?.getDefaultChain(),u=a.map(d=>{let p=c.find(g=>g.includes(`${t}:${l}:${d}`));if(!p)return;let{chainId:f,chainNamespace:m}=Qe.parseCaipAddress(p);return{address:d,chainId:f,chainNamespace:m}}).filter(d=>d!==void 0);u.length>0&&o(u)}catch(c){console.warn("Failed to parse accounts for namespace on accountsChanged event",t,a,c)}}),s&&e.on("chainChanged",a=>{s(a)}),i&&e.on("display_uri",a=>{i(a)})},getWalletConnectAccounts(e,t){let r=new Set,n=e?.session?.namespaces?.[t]?.accounts?.map(o=>Qe.parseCaipAddress(o)).filter(({address:o})=>r.has(o.toLowerCase())?!1:(r.add(o.toLowerCase()),!0));return n&&n.length>0?n:[]}}});var gDe,n3,Bue=h(()=>{dT();it();nc();xn();fT();kr();fo();lT();gDe=[j.CONNECTOR_ID.AUTH,j.CONNECTOR_ID.WALLET_CONNECT],n3=class{constructor(t){this.availableConnectors=[],this.availableConnections=[],this.providerHandlers={},this.eventListeners=new Map,this.getCaipNetworks=r=>k.getCaipNetworks(r),this.getConnectorId=r=>X.getConnectorId(r),t&&this.construct(t)}construct(t){this.projectId=t.projectId,this.namespace=t.namespace,this.adapterType=t.adapterType}get connectors(){return this.availableConnectors}get connections(){return this.availableConnections}get networks(){return this.getCaipNetworks(this.namespace)}onAuthConnected({accounts:t,chainId:r}){let n=this.getCaipNetworks().filter(o=>o.chainNamespace===this.namespace).find(o=>o.id.toString()===r?.toString());t&&n&&this.addConnection({connectorId:j.CONNECTOR_ID.AUTH,accounts:t,caipNetwork:n})}setAuthProvider(t){t.onConnect(this.onAuthConnected.bind(this)),t.onSocialConnected(this.onAuthConnected.bind(this)),this.addConnector({id:j.CONNECTOR_ID.AUTH,type:"AUTH",name:j.CONNECTOR_NAMES.AUTH,provider:t,imageId:void 0,chain:this.namespace,chains:[]})}addConnector(...t){let r=new Set;this.availableConnectors=[...t,...this.availableConnectors].filter(n=>r.has(n.id)?!1:(r.add(n.id),!0)),this.emit("connectors",this.availableConnectors)}addConnection(...t){let r=new Set;this.availableConnections=[...t,...this.availableConnections].filter(n=>r.has(n.connectorId.toLowerCase())?!1:(r.add(n.connectorId.toLowerCase()),!0)),this.emit("connections",this.availableConnections)}deleteConnection(t){this.availableConnections=this.availableConnections.filter(r=>r.connectorId.toLowerCase()!==t.toLowerCase()),this.emit("connections",this.availableConnections)}clearConnections(t=!1){this.availableConnections=[],t&&this.emit("connections",this.availableConnections)}setStatus(t,r){k.setAccountProp("status",t,r)}on(t,r){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t)?.add(r)}off(t,r){let n=this.eventListeners.get(t);n&&n.delete(r)}removeAllEventListeners(){this.eventListeners.forEach(t=>{t.clear()})}emit(t,r){let n=this.eventListeners.get(t);n&&n.forEach(o=>o(r))}async connectWalletConnect(t){try{return{clientId:(await this.getWalletConnectConnector().connectWalletConnect()).clientId}}catch(r){throw qc.isUserRejectedRequestError(r)?new l1(r):r}}async switchNetwork(t){let{caipNetwork:r}=t,n=or.getProviderId(r.chainNamespace),o=or.getProvider(r.chainNamespace);if(!o)throw new Error("Provider not found");if(n==="WALLET_CONNECT"){o.setDefaultChain(r.caipNetworkId);return}if(n==="AUTH"){let s=X.getAuthConnector()?.provider;if(!s)throw new Error("Auth provider not found");let i=Dr(r.chainNamespace);await s.switchNetwork({chainId:r.caipNetworkId});let a=await s.getUser({chainId:r.caipNetworkId,preferredAccountType:i});
67this.emit("switchNetwork",a)}}getWalletConnectConnector(){let t=this.connectors.find(r=>r.id==="walletConnect");if(!t)throw new Error("WalletConnectConnector not found");return t}onConnect(t,r){if(t.length>0){let{address:n,chainId:o}=ee.getAccount(t[0]),s=this.getCaipNetworks().filter(a=>a.chainNamespace===this.namespace).find(a=>a.id.toString()===o?.toString()),i=this.connectors.find(a=>a.id===r);n&&(this.emit("accountChanged",{address:n,chainId:o,connector:i}),this.addConnection({connectorId:r,accounts:t.map(a=>{let{address:c}=ee.getAccount(a);return{address:c}}),caipNetwork:s}))}}onAccountsChanged(t,r,n=!0){if(t.length>0){let{address:o}=ee.getAccount(t[0]),s=this.getConnection({connectorId:r,connections:this.connections,connectors:this.connectors});o&&this.getConnectorId(j.CHAIN.EVM)?.toLowerCase()===r.toLowerCase()&&this.emit("accountChanged",{address:o,chainId:s?.caipNetwork?.id,connector:s?.connector}),this.addConnection({connectorId:r,accounts:t.map(i=>{let{address:a}=ee.getAccount(i);return{address:a}}),caipNetwork:s?.caipNetwork})}else n&&this.onDisconnect(r)}onDisconnect(t){this.removeProviderListeners(t),this.deleteConnection(t),this.getConnectorId(j.CHAIN.EVM)?.toLowerCase()===t.toLowerCase()&&this.emitFirstAvailableConnection(),this.connections.length===0&&this.emit("disconnect")}onChainChanged(t,r){let n=typeof t=="string"&&t.startsWith("0x")?parseInt(t,16).toString():t.toString(),o=this.getConnection({connectorId:r,connections:this.connections,connectors:this.connectors}),s=this.getCaipNetworks().filter(i=>i.chainNamespace===this.namespace).find(i=>i.id.toString()===n);o&&this.addConnection({connectorId:r,accounts:o.accounts,caipNetwork:s}),this.getConnectorId(j.CHAIN.EVM)?.toLowerCase()===r.toLowerCase()&&this.emit("switchNetwork",{chainId:n})}listenProviderEvents(t,r){if(gDe.includes(t))return;let n=i=>this.onAccountsChanged(i,t),o=i=>this.onChainChanged(i,t),s=()=>this.onDisconnect(t);this.providerHandlers[t]||(r.on("disconnect",s),r.on("accountsChanged",n),r.on("chainChanged",o),this.providerHandlers[t]={provider:r,disconnect:s,accountsChanged:n,chainChanged:o})}removeProviderListeners(t){if(this.providerHandlers[t]){let{provider:r,disconnect:n,accountsChanged:o,chainChanged:s}=this.providerHandlers[t];r.removeListener("disconnect",n),r.removeListener("accountsChanged",o),r.removeListener("chainChanged",s),this.providerHandlers[t]=null}}emitFirstAvailableConnection(){let t=this.getConnection({connections:this.connections,connectors:this.connectors});if(t){let[r]=t.accounts;this.emit("accountChanged",{address:r?.address,chainId:t.caipNetwork?.id,connector:t.connector})}}getConnection({address:t,connectorId:r,connections:n,connectors:o}){if(r){let i=n.find(l=>l.connectorId.toLowerCase()===r.toLowerCase());if(!i)return null;let a=o.find(l=>l.id.toLowerCase()===i.connectorId.toLowerCase()),c=t?i.accounts.find(l=>l.address.toLowerCase()===t.toLowerCase()):i.accounts[0];return{...i,account:c,connector:a}}let s=n.find(i=>i.accounts.length>0&&o.some(a=>a.id.toLowerCase()===i.connectorId.toLowerCase()));if(s){let[i]=s.accounts,a=o.find(c=>c.id.toLowerCase()===s.connectorId.toLowerCase());return{...s,account:i,connector:a}}return null}}});var yg,ho,hT=h(()=>{dT();it();D0();kr();Gs();fo();tc();Mp();In();rc();k0();nc();xn();yg=null,ho={getSIWX(){return W.state.siwx},async initializeIfEnabled(e=k.getActiveCaipAddress()){let t=W.state.siwx;if(!(t&&e))return;let[r,n,o]=e.split(":");if(k.checkIfSupportedNetwork(r,`${r}:${n}`))try{if(W.state.remoteFeatures?.emailCapture){let i=k.getAccountData(r)?.user;await Oe.open({view:"DataCapture",data:{email:i?.email??void 0}});return}if(yg&&await yg,(await t.getSessions(`${r}:${n}`,o)).length)return;await Oe.open({view:"SIWXSignMessage"})}catch(s){console.error("SIWXUtil:initializeIfEnabled",s),xe.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(s)}),await J._getClient()?.disconnect().catch(console.error),Z.reset("Connect"),Ze.showError("A problem occurred while trying initialize authentication")}}
67,async isAuthenticated(e=k.getActiveCaipAddress()){if(!W.state.siwx||!e)return!0;let{chainNamespace:r,chainId:n,address:o}=Qe.parseCaipAddress(e),s=`${r}:${n}`;return(await ho.getSessions({address:o,caipNetworkId:s})).length>0},async requestSignMessage(){let e=W.state.siwx,t=ee.getPlainAddress(k.getActiveCaipAddress()),r=mg();if(!e)throw new Error("SIWX is not enabled");if(!t)throw new Error("No ActiveCaipAddress found");if(!r)throw new Error("No ActiveCaipNetwork or client found");try{let n=await e.createMessage({chainId:r.caipNetworkId,accountAddress:t}),o=n.toString(),s="";e.signMessage?s=await e.signMessage({message:o,chainId:r.caipNetworkId,accountAddress:t}):(X.getConnectorId(r.chainNamespace)===j.CONNECTOR_ID.AUTH&&Z.pushTransactionStack({}),s=await J.signMessage(o)||""),await e.addSession({data:n,message:o,signature:s}),k.setLastConnectedSIWECaipNetwork(r),Oe.close(),xe.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:this.getSIWXEventProperties()})}catch(n){(!Oe.state.open||Z.state.view==="ApproveTransaction")&&await Oe.open({view:"SIWXSignMessage"}),Ze.showError("Error signing message"),xe.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:this.getSIWXEventProperties(n)}),console.error("SWIXUtil:requestSignMessage",n)}},async cancelSignMessage(){try{let e=this.getSIWX();if(e?.getRequired?.()){let r=k.getLastConnectedSIWECaipNetwork();if(r){let n=await e?.getSessions(r?.caipNetworkId,ee.getPlainAddress(k.getActiveCaipAddress())||"");n&&n.length>0?await k.switchActiveNetwork(r):await J.disconnect()}else await J.disconnect()}else Oe.close();Oe.close(),xe.sendEvent({event:"CLICK_CANCEL_SIWX",type:"track",properties:this.getSIWXEventProperties()})}catch(e){console.error("SIWXUtil:cancelSignMessage",e)}},async getAllSessions(){let e=this.getSIWX(),t=k.getAllRequestedCaipNetworks(),r=[];return await Promise.all(t.map(async n=>{let o=await e?.getSessions(n.caipNetworkId,ee.getPlainAddress(k.getActiveCaipAddress())||"");o&&r.push(...o)})),r},async getSessions(e){let t=W.state.siwx,r=e?.address;if(!r){let o=k.getActiveCaipAddress();r=ee.getPlainAddress(o)}let n=e?.caipNetworkId;return n||(n=k.getActiveCaipNetwork()?.caipNetworkId),t&&r&&n?t.getSessions(n,r):[]},async isSIWXCloseDisabled(){let e=this.getSIWX();if(e){let t=Z.state.view==="ApproveTransaction",r=Z.state.view==="SIWXSignMessage";
67if(t||r)return e.getRequired?.()&&(await this.getSessions()).length===0}return!1},async authConnectorAuthenticate({authConnector:e,chainId:t,socialUri:r,preferredAccountType:n,chainNamespace:o}){let s=ho.getSIWX(),i=mg();if(!s||!o.includes(j.CHAIN.EVM)||W.state.remoteFeatures?.emailCapture){let d=await e.connect({chainId:t,socialUri:r,preferredAccountType:n});return{address:d.address,chainId:d.chainId,accounts:d.accounts}}let a=`${o}:${t}`,c=await s.createMessage({chainId:a,accountAddress:"<<AccountAddress>>"}),l={accountAddress:c.accountAddress,chainId:c.chainId,domain:c.domain,uri:c.uri,version:c.version,nonce:c.nonce,notBefore:c.notBefore,statement:c.statement,resources:c.resources,requestId:c.requestId,issuedAt:c.issuedAt,expirationTime:c.expirationTime,serializedMessage:c.toString()},u=await e.connect({chainId:t,socialUri:r,siwxMessage:l,preferredAccountType:n});return l.accountAddress=u.address,l.serializedMessage=u.message||"",u.signature&&u.message&&await ho.addEmbeddedWalletSession(l,u.message,u.signature),k.setLastConnectedSIWECaipNetwork(i),{address:u.address,chainId:u.chainId,accounts:u.accounts}},async addEmbeddedWalletSession(e,t,r){if(yg)return yg;let n=ho.getSIWX();return n?(yg=n.addSession({data:e,message:t,signature:r}).finally(()=>{yg=null}),yg):Promise.resolve()},async universalProviderAuthenticate({universalProvider:e,chains:t,methods:r}){let n=ho.getSIWX(),o=mg(),s=new Set(t.map(l=>l.split(":")[0]));if(!n||s.size!==1||!s.has("eip155"))return!1;let i=await n.createMessage({chainId:mg()?.caipNetworkId||"",accountAddress:""}),a=await e.authenticate({nonce:i.nonce,domain:i.domain,uri:i.uri,exp:i.expirationTime,iat:i.issuedAt,nbf:i.notBefore,requestId:i.requestId,version:i.version,resources:i.resources,statement:i.statement,chainId:i.chainId,methods:r,chains:[i.chainId,...t.filter(l=>l!==i.chainId)]});Ze.showLoading("Authenticating...",{autoClose:!1});let c={...a.session.peer.metadata,name:a.session.peer.metadata.name,icon:a.session.peer.metadata.icons?.[0],type:"WALLET_CONNECT"};if(k.setAccountProp("connectedWalletInfo",c,Array.from(s)[0]),a?.auths?.length){let l=a.auths.map(u=>{let d=e.client.formatAuthMessage({request:u.p,iss:u.p.iss});return{data:{...u.p,accountAddress:u.p.iss.split(":").slice(-1).join(""),chainId:u.p.iss.split(":").slice(2,4).join(":"),uri:u.p.aud??"",version:u.p.version||i.version,expirationTime:u.p.exp,issuedAt:u.p.iat,notBefore:u.p.nbf},message:d,signature:u.s.s,cacao:u}});try{await n.setSessions(l),o&&k.setLastConnectedSIWECaipNetwork(o),xe.sendEvent({type:"track",event:"SIWX_AUTH_SUCCESS",properties:ho.getSIWXEventProperties()})}catch(u){throw console.error("SIWX:universalProviderAuth - failed to set sessions",u),xe.sendEvent({type:"track",event:"SIWX_AUTH_ERROR",properties:ho.getSIWXEventProperties(u)}),await e.disconnect().catch(console.error),u}finally{Ze.hide()}}return!0},getSIWXEventProperties(e){let t=k.state.activeChain;if(!t)throw new Error("SIWXUtil:getSIWXEventProperties - namespace is required");return{network:k.state.activeCaipNetwork?.caipNetworkId||"",isSmartAccount:Dr(t)===$r.ACCOUNT_TYPES.SMART_ACCOUNT,message:e?ee.parseError(e):void 0}},async clearSessions(){let e=this.getSIWX();e&&await e.setSessions([])}}});var o3,yDe,kue=h(()=>{dT();it();hT();fT();kr();In();o3=class{constructor({provider:t,namespace:r}){this.id=j.CONNECTOR_ID.WALLET_CONNECT,this.name="WalletConnect",this.type="WALLET_CONNECT",this.imageId="ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",this.getCaipNetworks=k.getCaipNetworks.bind(k),this.caipNetworks=this.getCaipNetworks(),this.provider=t,this.chain=r}get chains(){return this.getCaipNetworks()}async connectWalletConnect(){if(!await this.authenticate()){let r=this.getCaipNetworks(),n=W.state.universalProviderConfigOverride,o=qc.createNamespaces(r,n);await this.provider.connect({optionalNamespaces:o})}return{clientId:await this.provider.client.core.crypto.getClientId(),session:this.provider.session}}async disconnect(){await this.provider.disconnect()}async authenticate(){let t=this.chains.map(r=>r.caipNetworkId);return ho.universalProviderAuthenticate({universalProvider:this.provider,chains:t,methods:yDe})}},yDe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_getCallsStatus","wallet_sendCalls","wallet_getCapabilities","wallet_grantPermissions","wallet_revokePermissions","wallet_getAssets"]});var Fp,Due=h(()=>{it();Fp={getGasPriceInEther(e,t){let r=t*e;return Number(r)/1e18},getGasPriceInUSD(e,t,r){let n=Fp.getGasPriceInEther(t,r);return dt.bigNumber(e).times(n).toNumber()},getPriceImpact({sourceTokenAmount:e,sourceTokenPriceInUSD:t,toTokenPriceInUSD:r,toTokenAmount:n}){let o=dt.bigNumber(e).times(t),s=dt.bigNumber(n).times(r);return o.minus(s).div(o).times(100).toNumber()},getMaxSlippage(e,t){let r=dt.bigNumber(e).div(100);return dt.multiply(t,r).toNumber()},getProviderFee(e,t=.0085){return dt.bigNumber(e).times(t).toString()},isInsufficientNetworkTokenForGas(e,t){let r=t||"0";return dt.bigNumber(e).eq(0)?!0:dt.bigNumber(dt.bigNumber(r)).gt(e)},isInsufficientSourceTokenForSwap(e,t,r){let n=r?.find(s=>
vendor: 5,972 bytes, line 67
67s.address===t)?.quantity?.numeric;return dt.bigNumber(n||"0").lt(e)}}});var Wc,wDe,Jr,JL=h(()=>{Rr();Pn();it();ss();In();Wc=Xe({message:"",variant:"info",open:!1}),wDe={state:Wc,subscribeKey(e,t){return Ct(Wc,e,t)},open(e,t){let{debug:r}=W.state,{code:n,displayMessage:o,debugMessage:s}=e;if(o&&r&&(Wc.message=o,Wc.variant=t,Wc.open=!0),s){if(!j.IS_DEVELOPMENT)return;let i=typeof s=="function"?s():s,a=n?{code:n}:void 0;t==="error"?console.error(i,a):t==="warning"?console.warn(i,a):console.info(i,a)}},warn(e,t,r){Wc.open=!0,Wc.message=e,Wc.variant="warning",t&&console.warn(t,r)},close(){Wc.open=!1,Wc.message="",Wc.variant="info"}},Jr=gr(wDe)});var Uue,bDe,cs,G,mT,et,Lue=h(()=>{Rr();Pn();it();it();D0();jb();nc();ea();xn();WL();Due();ss();JL();Lp();kr();Gs();fo();tc();rc();k0();Uue=15e4,bDe=6,cs={initializing:!1,initialized:!1,loadingPrices:!1,loadingQuote:!1,loadingApprovalTransaction:!1,loadingBuildTransaction:!1,loadingTransaction:!1,switchingTokens:!1,fetchError:!1,approvalTransaction:void 0,swapTransaction:void 0,transactionError:void 0,sourceToken:void 0,sourceTokenAmount:"",sourceTokenPriceInUSD:0,toToken:void 0,toTokenAmount:"",toTokenPriceInUSD:0,networkPrice:"0",networkBalanceInUSD:"0",networkTokenSymbol:"",inputError:void 0,slippage:We.CONVERT_SLIPPAGE_TOLERANCE,tokens:void 0,popularTokens:void 0,suggestedTokens:void 0,foundTokens:void 0,myTokensWithBalance:void 0,tokensPriceMap:{},gasFee:"0",gasPriceInUSD:0,priceImpact:void 0,maxSlippage:void 0,providerFee:void 0},G=Xe({...cs}),mT={state:G,subscribe(e){return Ot(G,()=>e(G))},subscribeKey(e,t){return Ct(G,e,t)},getParams(){let e=k.state.activeChain,t=k.getAccountData(e)?.caipAddress??k.state.activeCaipAddress,r=ee.getPlainAddress(t),n=Vb(),o=X.getConnectorId(k.state.activeChain);if(!r)throw new Error("No address found to swap the tokens from.");let s=!G.toToken?.address||!G.toToken?.decimals,i=!G.sourceToken?.address||!G.sourceToken?.decimals||!dt.bigNumber(G.sourceTokenAmount).gt(0),a=!G.sourceTokenAmount;return{networkAddress:n,fromAddress:r,fromCaipAddress:t,sourceTokenAddress:G.sourceToken?.address,toTokenAddress:G.toToken?.address,toTokenAmount:G.toTokenAmount,toTokenDecimals:G.toToken?.decimals,sourceTokenAmount:G.sourceTokenAmount,sourceTokenDecimals:G.sourceToken?.decimals,invalidToToken:s,invalidSourceToken:i,invalidSourceTokenAmount:a,availableToSwap:t&&!s&&!i&&!a,isAuthConnector:o===j.CONNECTOR_ID.AUTH}},async setSourceToken(e){if(!e){G.sourceToken=e,G.sourceTokenAmount="",G.sourceTokenPriceInUSD=0;return}G.sourceToken=e,await et.setTokenPrice(e.address,"sourceToken")},setSourceTokenAmount(e){G.sourceTokenAmount=e},async setToToken(e){if(!e){G.toToken=e,G.toTokenAmount="",G.toTokenPriceInUSD=0;return}G.toToken=e,await et.setTokenPrice(e.address,"toToken")},setToTokenAmount(e){G.toTokenAmount=e?dt.toFixed(e,bDe):""},async setTokenPrice(e,t){let r=G.tokensPriceMap[e]||0;r||(G.loadingPrices=!0,r=await et.getAddressPrice(e)),t==="sourceToken"?G.sourceTokenPriceInUSD=r:t==="toToken"&&(G.toTokenPriceInUSD=r),G.loadingPrices&&(G.loadingPrices=!1),et.getParams().availableToSwap&&!G.switchingTokens&&et.swapTokens()},async switchTokens(){if(!(G.initializing||!G.initialized||G.switchingTokens)){G.switchingTokens=!0;try{let e=G.toToken?{...G.toToken}:void 0,t=G.sourceToken?{...G.sourceToken}:void 0,r=e&&G.toTokenAmount===""?"1":G.toTokenAmount;et.setSourceTokenAmount(r),et.setToTokenAmount(""),await et.setSourceToken(e),await et.setToToken(t),G.switchingTokens=!1,et.swapTokens()}catch(e){throw G.switchingTokens=!1,e}}},resetState(){G.myTokensWithBalance=cs.myTokensWithBalance,G.tokensPriceMap=cs.tokensPriceMap,G.initialized=cs.initialized,G.initializing=cs.initializing,G.switchingTokens=cs.switchingTokens,G.sourceToken=cs.sourceToken,G.sourceTokenAmount=cs.sourceTokenAmount,G.sourceTokenPriceInUSD=cs.sourceTokenPriceInUSD,G.toToken=cs.toToken,G.toTokenAmount=cs.toTokenAmount,G.toTokenPriceInUSD=cs.toTokenPriceInUSD,G.networkPrice=cs.networkPrice,G.networkTokenSymbol=cs.networkTokenSymbol,G.networkBalanceInUSD=cs.networkBalanceInUSD,G.inputError=cs.inputError},resetValues(){let{networkAddress:e}=et.getParams(),t=G.tokens?.find(r=>r.address===e);et.setSourceToken(t),et.setToToken(void 0)},getApprovalLoadingState(){return G.loadingApprovalTransaction},clearError(){G.transactionError=void 0},async initializeState(){if(!G.initializing){if(G.initializing=!0,!G.initialized)try{await et.fetchTokens(),G.initialized=!0}catch{G.initialized=!1,Ze.showError("Failed to initialize swap"),Z.goBack()}G.initializing=!1}},async fetchTokens(){let{networkAddress:e}=et.getParams();await et.getNetworkTokenPrice(),await et.getMyTokensWithBalance();let t=G.myTokensWithBalance?.find(r=>r.address===e);t&&(G.networkTokenSymbol=t.symbol,et.setSourceToken(t),et.setSourceTokenAmount("0"))},async getTokenList(){let e=k.state.activeCaipNetwork?.caipNetworkId;if(!(G.caipNetworkId===e&&G.tokens))try{G.tokensLoading=!0;let t=await M0.getTokenList(e);G.tokens=t,G.caipNetworkId=e,G.popularTokens=t.sort((i,a)=>i.symbol<a.symbol?-1:i.symbol>a.symbol?1:0);let n=(e&&We.SUGGESTED_TOKENS_BY_CHAIN?.[e]||[]).map(i=>t.find(a=>a.symbol===i)).filter(i=>!!i),s=(We.SWAP_SUGGESTED_TOKENS||[]).map(i=>t.find(a=>a.symbol===i)).filter(i=>!!i).filter(i=>!n.some(a=>a.address===i.address));G.suggestedTokens=[...n,...s]}catch{G.tokens=[],G.popularTokens=[],G.suggestedTokens=[]}finally{G.tokensLoading=!1}},async getAddressPrice(e){let t=G.tokensPriceMap[e];if(t)return t;let n=(await Me.fetchTokenPrice({addresses:[e]}))?.fungibles||[],s=[...G.tokens||[],...G.myTokensWithBalance||[]]?.find(c=>c.address===e)?.symbol,i=n.find(c=>c.symbol.toLowerCase()===s?.toLowerCase())?.price||0,a=parseFloat(i.toString());return G.tokensPriceMap[e]=a,a},async getNetworkTokenPrice(){let{networkAddress:e}=et.getParams(),r=(await Me.fetchTokenPrice({addresses:[e]}).catch(()=>(Ze.showError("Failed to fetch network token price"),{fungibles:[]}))).fungibles?.[0],n=r?.price.toString()||"0";
67G.tokensPriceMap[e]=parseFloat(n),G.networkTokenSymbol=r?.symbol||"",G.networkPrice=n},async getMyTokensWithBalance(e){let t=await jc.getMyTokensWithBalance({forceUpdate:e,caipNetwork:k.state.activeCaipNetwork,address:k.getAccountData()?.address}),r=M0.mapBalancesToSwapTokens(t);r&&(await et.getInitialGasPrice(),et.setBalances(r))},setBalances(e){let{networkAddress:t}=et.getParams(),r=k.state.activeCaipNetwork;if(!r)return;let n=e.find(o=>o.address===t);e.forEach(o=>{G.tokensPriceMap[o.address]=o.price||0}),G.myTokensWithBalance=e.filter(o=>o.address.startsWith(r.caipNetworkId)),G.networkBalanceInUSD=n?dt.multiply(n.quantity.numeric,n.price).toString():"0"},async getInitialGasPrice(){let e=await M0.fetchGasPrice();if(!e)return{gasPrice:null,gasPriceInUSD:null};switch(k.state?.activeCaipNetwork?.chainNamespace){case j.CHAIN.SOLANA:return G.gasFee=e.standard??"0",G.gasPriceInUSD=dt.multiply(e.standard,G.networkPrice).div(1e9).toNumber(),{gasPrice:BigInt(G.gasFee),gasPriceInUSD:Number(G.gasPriceInUSD)};case j.CHAIN.EVM:default:let t=e.standard??"0",r=BigInt(t),n=BigInt(Uue),o=Fp.getGasPriceInUSD(G.networkPrice,n,r);return G.gasFee=t,G.gasPriceInUSD=o,{gasPrice:r,gasPriceInUSD:o}}},async swapTokens(){let e=k.getAccountData()?.address,t=G.sourceToken,r=G.toToken,n=dt.bigNumber(G.sourceTokenAmount).gt(0);if(n||et.setToTokenAmount(""),!r||!t||G.loadingPrices||!n||!e)return;G.loadingQuote=!0;let o=dt.bigNumber(G.sourceTokenAmount).times(10**t.decimals).round(0).toFixed(0);try{let s=await Me.fetchSwapQuote({userAddress:e,from:t.address,to:r.address,gasPrice:G.gasFee,amount:o.toString()});G.loadingQuote=!1;let i=s?.quotes?.[0]?.toAmount;if(!i){Jr.open({displayMessage:"Incorrect amount",debugMessage:"Please enter a valid amount"},"error");return}let a=dt.bigNumber(i).div(10**r.decimals).toString();et.setToTokenAmount(a),et.hasInsufficientToken(G.sourceTokenAmount,t.address)?G.inputError="Insufficient balance":(G.inputError=void 0,et.setTransactionDetails())}catch(s){let i=await M0.handleSwapError(s);G.loadingQuote=!1,G.inputError=i||"Insufficient balance"}},async getTransaction(){let{fromCaipAddress:e,availableToSwap:t}=et.getParams(),r=G.sourceToken,n=G.toToken;if(!(!e||!t||!r||!n||G.loadingQuote))try{G.loadingBuildTransaction=!0;let o=await M0.fetchSwapAllowance({userAddress:e,tokenAddress:r.address,sourceTokenAmount:G.sourceTokenAmount,sourceTokenDecimals:r.decimals}),s;return o?s=await et.createSwapTransaction():s=await et.createAllowanceTransaction(),G.loadingBuildTransaction=!1,G.fetchError=!1,s}catch{Z.goBack(),Ze.showError("Failed to check allowance"),G.loadingBuildTransaction=!1,G.approvalTransaction=void 0,G.swapTransaction=void 0,G.fetchError=!0;return}},async createAllowanceTransaction(){let{fromCaipAddress:e,sourceTokenAddress:t,toTokenAddress:r}=et.getParams();if(!(!e||!r)){if(!t)throw new Error("createAllowanceTransaction - No source token address found.");try{let n=await Me.generateApproveCalldata({from:t,to:r,userAddress:e}),o=ee.getPlainAddress(n.tx.from);if(!o)throw new Error("SwapController:createAllowanceTransaction - address is required");let s={data:n.tx.data,to:o,gasPrice:BigInt(n.tx.eip155.gasPrice),value:BigInt(n.tx.value),toAmount:G.toTokenAmount};return G.swapTransaction=void 0,G.approvalTransaction={data:s.data,to:s.to,gasPrice:s.gasPrice,value:s.value,toAmount:s.toAmount},{data:s.data,to:s.to,gasPrice:s.gasPrice,value:s.value,toAmount:s.toAmount}}catch{Z.goBack(),Ze.showError("Failed to create approval transaction"),G.approvalTransaction=void 0,G.swapTransaction=void 0,G.fetchError=!0;return}}},async createSwapTransaction(){let{networkAddress:e,fromCaipAddress:t,sourceTokenAmount:r}=et.getParams(),n=G.sourceToken,o=G.toToken;if(!t||!r||!n||!o)return;let s=J.parseUnits(r,n.decimals)?.toString();try{let i=await Me.generateSwapCalldata({userAddress:t,from:n.address,to:o.address,amount:s,disableEstimate:!0}),a=n.address===e,c=BigInt(i.tx.eip155.gas),l=BigInt(i.tx.eip155.gasPrice),u=ee.getPlainAddress(i.tx.to);if(!u)throw new Error("SwapController:createSwapTransaction - address is required");
67let d={data:i.tx.data,to:u,gas:c,gasPrice:l,value:BigInt(a?s??"0":"0"),toAmount:G.toTokenAmount};return G.gasPriceInUSD=Fp.getGasPriceInUSD(G.networkPrice,c,l),G.approvalTransaction=void 0,G.swapTransaction=d,d}catch{Z.goBack(),Ze.showError("Failed to create transaction"),G.approvalTransaction=void 0,G.swapTransaction=void 0,G.fetchError=!0;return}},onEmbeddedWalletApprovalSuccess(){Ze.showLoading("Approve limit increase in your wallet"),Z.replace("SwapPreview")},async sendTransactionForApproval(e){let{fromAddress:t,isAuthConnector:r}=et.getParams();G.loadingApprovalTransaction=!0,r?Z.pushTransactionStack({onSuccess:et.onEmbeddedWalletApprovalSuccess}):Ze.showLoading("Approve limit increase in your wallet");try{await J.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:j.CHAIN.EVM}),await et.swapTokens(),await et.getTransaction(),G.approvalTransaction=void 0,G.loadingApprovalTransaction=!1}catch(o){let s=o;G.transactionError=s?.displayMessage,G.loadingApprovalTransaction=!1,Ze.showError(s?.displayMessage||"Transaction error"),xe.sendEvent({type:"track",event:"SWAP_APPROVAL_ERROR",properties:{message:s?.displayMessage||s?.message||"Unknown",network:k.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:et.state.sourceToken?.symbol||"",swapToToken:et.state.toToken?.symbol||"",swapFromAmount:et.state.sourceTokenAmount||"",swapToAmount:et.state.toTokenAmount||"",isSmartAccount:Dr(j.CHAIN.EVM)===$r.ACCOUNT_TYPES.SMART_ACCOUNT}})}},async sendTransactionForSwap(e){if(!e)return;let{fromAddress:t,toTokenAmount:r,isAuthConnector:n}=et.getParams();G.loadingTransaction=!0;let o=`Swapping ${G.sourceToken?.symbol} to ${dt.formatNumberToLocalString(r,3)} ${G.toToken?.symbol}`,s=`Swapped ${G.sourceToken?.symbol} to ${dt.formatNumberToLocalString(r,3)} ${G.toToken?.symbol}`;n?Z.pushTransactionStack({onSuccess(){Z.replace("Account"),Ze.showLoading(o),mT.resetState()}}):Ze.showLoading("Confirm transaction in your wallet");try{let i=[G.sourceToken?.address,G.toToken?.address].join(","),a=await J.sendTransaction({address:t,to:e.to,data:e.data,value:e.value,chainNamespace:j.CHAIN.EVM});return G.loadingTransaction=!1,Ze.showSuccess(s),xe.sendEvent({type:"track",event:"SWAP_SUCCESS",properties:{network:k.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:et.state.sourceToken?.symbol||"",swapToToken:et.state.toToken?.symbol||"",swapFromAmount:et.state.sourceTokenAmount||"",swapToAmount:et.state.toTokenAmount||"",isSmartAccount:Dr(j.CHAIN.EVM)===$r.ACCOUNT_TYPES.SMART_ACCOUNT}}),mT.resetState(),n||Z.replace("Account"),mT.getMyTokensWithBalance(i),a}catch(i){let a=i;G.transactionError=a?.displayMessage,G.loadingTransaction=!1,Ze.showError(a?.displayMessage||"Transaction error"),xe.sendEvent({type:"track",event:"SWAP_ERROR",properties:{message:a?.displayMessage||a?.message||"Unknown",network:k.state.activeCaipNetwork?.caipNetworkId||"",swapFromToken:et.state.sourceToken?.symbol||"",swapToToken:et.state.toToken?.symbol||"",swapFromAmount:et.state.sourceTokenAmount||"",swapToAmount:et.state.toTokenAmount||"",isSmartAccount:Dr(j.CHAIN.EVM)===$r.ACCOUNT_TYPES.SMART_ACCOUNT}});return}},hasInsufficientToken(e,t){return Fp.isInsufficientSourceTokenForSwap(e,t,G.myTokensWithBalance)},setTransactionDetails(){let{toTokenAddress:e,toTokenDecimals:t}=et.getParams();!e||!t||(G.gasPriceInUSD=Fp.getGasPriceInUSD(G.networkPrice,BigInt(G.gasFee),BigInt(Uue)),G.priceImpact=Fp.getPriceImpact({sourceTokenAmount:G.sourceTokenAmount,sourceTokenPriceInUSD:G.sourceTokenPriceInUSD,toTokenPriceInUSD:G.toTokenPriceInUSD,toTokenAmount:G.toTokenAmount}),G.maxSlippage=Fp.getMaxSlippage(G.slippage,G.toTokenAmount),G.providerFee=Fp.getProviderFee(G.sourceTokenAmount))}},et=gr(mT)});var Kc,xDe,Ys,Mue=h(()=>{Rr();Pn();ss();Kc=Xe({message:"",open:!1,triggerRect:{width:0,height:0,top:0,left:0},variant:"shade"}),xDe={state:Kc,subscribe(e){return Ot(Kc,()=>e(Kc))},subscribeKey(e,t){return Ct(Kc,e,t)},showTooltip({message:e,triggerRect:t,variant:r}){Kc.open=!0,Kc.message=e,Kc.triggerRect=t,Kc.variant=r},hide(){Kc.open=!1,Kc.message="",Kc.triggerRect={width:0,height:0,top:0,left:0}}},Ys=gr(xDe)}
vendor: 12,214 bytes, lines 67-68
67);var QL,XL,Hue=h(()=>{QL={network:"eip155:8453",asset:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}},XL={network:"eip155:84532",asset:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",metadata:{name:"USD Coin",symbol:"USDC",decimals:6}}});var s3,$ue=h(()=>{Gs();Mp();rc();hT();s3={isUnsupportedChainView(){return Z.state.view==="UnsupportedChain"||Z.state.view==="SwitchNetwork"&&Z.state.history.includes("UnsupportedChain")},async safeClose(){if(this.isUnsupportedChainView()){Oe.shake();return}if(await ho.isSIWXCloseDisabled()){Oe.shake();return}(Z.state.view==="DataCapture"||Z.state.view==="DataCaptureOtpConfirm")&&J.disconnect(),Oe.close()}}});var st=h(()=>{Mp();rc();kr();lT();Tue();qL();Bue();kue();Gs();VL();fo();k0();su();nT();$L();In();Lp();X4();tc();Lue();KL();Mue();YL();JL();LL();ea();ML();xn();sT();ta();hT();$ue();ss();Hue();Hb();oT();nc();fT()});var zue,vDe,EDe,Fue,gT,ADe,CDe,SDe,yT,wT,bT,xT,vT,ET,AT,CT,ST,IT,IDe,TDe,Vue,TT,_T,eM=h(()=>{KA();zue=Lt(Cs()),vDe=Object.defineProperty,EDe=(e,t,r)=>t in e?vDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fue=(e,t,r)=>EDe(e,typeof t!="symbol"?t+"":t,r),gT=class extends no{constructor(t){super(),this.opts=t,Fue(this,"protocol","wc"),Fue(this,"version",2)}},ADe=Object.defineProperty,CDe=(e,t,r)=>t in e?ADe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SDe=(e,t,r)=>CDe(e,typeof t!="symbol"?t+"":t,r),yT=class extends no{constructor(t,r){super(),this.core=t,this.logger=r,SDe(this,"records",new Map)}},wT=class{constructor(t,r){this.logger=t,this.core=r}},bT=class extends no{constructor(t,r){super(),this.relayer=t,this.logger=r}},xT=class extends no{constructor(t){super()}},vT=class{constructor(t,r,n,o){this.core=t,this.logger=r,this.name=n}},ET=class extends no{constructor(t,r){super(),this.relayer=t,this.logger=r}},AT=class extends no{constructor(t,r){super(),this.core=t,this.logger=r}},CT=class{constructor(t,r,n){this.core=t,this.logger=r,this.store=n}},ST=class{constructor(t,r){this.projectId=t,this.logger=r}},IT=class{constructor(t,r,n){this.core=t,this.logger=r,this.telemetryEnabled=n}},IDe=Object.defineProperty,TDe=(e,t,r)=>t in e?IDe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vue=(e,t,r)=>TDe(e,typeof t!="symbol"?t+"":t,r),TT=class{constructor(t){this.opts=t,Vue(this,"protocol","wc"),Vue(this,"version",2)}},_T=class{constructor(t){this.client=t}}});var jue=h(()=>{});var que,Wue=h(()=>{que="0.1.1"});function Kue(){return que}var Zue=h(()=>{Wue()});function Gue(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Gue(e.cause,t):t?null:e}var $t,$0=h(()=>{Zue();$t=class e extends Error{constructor(t,r={}){let n=(()=>{if(r.cause instanceof e){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,i=`https://oxlib.sh${o??""}`,a=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||o?["",n?`Details: ${n}`:void 0,o?`See: ${i}`:void 0]:[]].filter(c=>typeof c=="string").join(`
68`);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Kue()}`}),this.cause=r.cause,this.details=n,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return Gue(this,t)}}});var bg,Yue=h(()=>{bg=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});function PDe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function xg(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function iu(e,...t){if(!PDe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Jue(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");xg(e.outputLen),xg(e.blockLen)}function Vp(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function PT(e,t){iu(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Que(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function au(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function NT(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Zc(e,t){return e<<32-t|e>>>t}function RDe(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ODe(e){for(let t=0;t<e.length;t++)e[t]=RDe(e[t]);return e}function BDe(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function vg(e){return typeof e=="string"&&(e=BDe(e)),iu(e),e}function Xue(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];iu(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function RT(e){let t=n=>e().update(vg(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function ede(e=32){if(bg&&typeof bg.getRandomValues=="function")return bg.getRandomValues(new Uint8Array(e));if(bg&&typeof bg.randomBytes=="function")return Uint8Array.from(bg.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var NDe,tM,F0,Eg=h(()=>{Yue();NDe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;tM=NDe?e=>e:ODe;F0=class{}});function kDe(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function tde(e,t,r){return e&t^~e&r}function rde(e,t,r){return e&t^e&r^t&r}var OT,zp,nde=h(()=>{Eg();OT=class extends F0{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=NT(this.buffer)}update(t){Vp(this),t=vg(t),iu(t);let{view:r,buffer:n,blockLen:o}=this,s=t.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=NT(t);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Vp(this),PT(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;r[i++]=128,au(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(n,0),i=0);for(let d=i;d<o;d++)r[d]=0;kDe(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=NT(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}},zp=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225])});function DDe(e,t=!1){return t?{h:Number(e&BT),l:Number(e>>ode&BT)}:{h:Number(e>>ode&BT)|0,l:Number(e&BT)|0}}function sde(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=DDe(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}var BT,ode,ide,ade,cde,lde,ude=h(()=>{BT=BigInt(4294967295),ode=BigInt(32);ide=(e,t,r)=>e<<r|t>>>32-r,ade=(e,t,r)=>t<<r|e>>>32-r,cde=(e,t,r)=>t<<r-32|e>>>64-r,lde=(e,t,r)=>e<<r-32|t>>>64-r});function zDe(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,c=(i+2)%10,l=r[c],u=r[c+1],d=dde(l,u,1)^r[a],p=pde(l,u,1)^r[a+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=hde[i],c=dde(o,s,a),l=pde(o,s,a),u=fde[i];o=e[u],s=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=FDe[n],e[1]^=VDe[n]}au(r)}var UDe,i3,LDe,MDe,HDe,$De,fde,hde,mde,gde,FDe,VDe,dde,pde,rM,jDe,yde,wde=h(()=>{ude();Eg();UDe=BigInt(0),i3=BigInt(1),LDe=BigInt(2),MDe=BigInt(7),HDe=BigInt(256),$De=BigInt(113),fde=[],hde=[],mde=[];for(let e=0,t=i3,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],fde.push(2*(5*n+r)),hde.push((e+1)*(e+2)/2%64);let o=UDe;for(let s=0;s<7;s++)t=(t<<i3^(t>>MDe)*$De)%HDe,t&LDe&&(o^=i3<<(i3<<BigInt(s))-i3);mde.push(o)}gde=sde(mde,!0),FDe=gde[0],VDe=gde[1],dde=(e,t,r)=>r>32?cde(e,t,r):ide(e,t,r),pde=(e,t,r)=>r>32?lde(e,t,r):ade(e,t,r);rM=class e extends F0{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,xg(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Que(this.state)}clone(){return this._cloneInto()}keccak(){tM(this.state32),zDe(this.state32,this.rounds),tM(this.state32),this.posOut=0,this.pos=0}update(t){Vp(this),t=vg(t),iu(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Vp(this,!1),iu(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xg(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(PT(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,au(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}},jDe=(e,t,r)=>RT(()=>new rM(t,e,r)),yde=jDe(1,136,256/8)});var qDe,V0,nM,bde,xde=h(()=>{nde();Eg();qDe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 4,513 bytes, line 68
68734187,3204031479,3329325298]),V0=new Uint32Array(64),nM=class extends OT{constructor(t=32){super(64,t,8,!1),this.A=zp[0]|0,this.B=zp[1]|0,this.C=zp[2]|0,this.D=zp[3]|0,this.E=zp[4]|0,this.F=zp[5]|0,this.G=zp[6]|0,this.H=zp[7]|0}get(){let{A:t,B:r,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[t,r,n,o,s,i,a,c]}set(t,r,n,o,s,i,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)V0[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){let p=V0[d-15],f=V0[d-2],m=Zc(p,7)^Zc(p,18)^p>>>3,g=Zc(f,17)^Zc(f,19)^f>>>10;V0[d]=g+V0[d-7]+m+V0[d-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){let p=Zc(a,6)^Zc(a,11)^Zc(a,25),f=u+p+tde(a,c,l)+qDe[d]+V0[d]|0,g=(Zc(n,2)^Zc(n,13)^Zc(n,22))+rde(n,o,s)|0;u=l,l=c,c=a,a=i+f|0,i=s,s=o,o=n,n=f+g|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,s,i,a,c,l,u)}roundClean(){au(V0)}destroy(){this.set(0,0,0,0,0,0,0,0),au(this.buffer)}},bde=RT(()=>new nM)});function qb(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cM(e){if(!qb(e))throw new Error("Uint8Array expected")}function Wb(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function a3(e){let t=e.toString(16);return t.length&1?"0"+t:t}function Ade(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?aM:BigInt("0x"+e)}function Kb(e){if(cM(e),Cde)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=WDe[e[r]];return t}function vde(e){if(e>=jp._0&&e<=jp._9)return e-jp._0;if(e>=jp.A&&e<=jp.F)return e-(jp.A-10);if(e>=jp.a&&e<=jp.f)return e-(jp.a-10)}function c3(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Cde)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=vde(e.charCodeAt(s)),a=vde(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function qp(e){return Ade(Kb(e))}function lM(e){return cM(e),Ade(Kb(Uint8Array.from(e).reverse()))}function Ag(e,t){return c3(e.toString(16).padStart(t*2,"0"))}function uM(e,t){return Ag(e,t).reverse()}function Ii(e,t,r){let n;if(typeof t=="string")try{n=c3(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(qb(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function l3(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];cM(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function kT(e,t,r){return oM(e)&&oM(t)&&oM(r)&&t<=e&&e<r}function Cg(e,t,r,n){if(!kT(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Sde(e){let t;for(t=0;e>aM;e>>=iM,t+=1);return t}function Ide(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=sM(e),o=sM(e),s=0,i=()=>{n.fill(1),o.fill(0),s=0},a=(...d)=>r(o,n,...d),c=(d=sM(0))=>{o=a(Ede([0]),d),n=a(),d.length!==0&&(o=a(Ede([1]),d),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,p=[];for(;d<t;){n=a();let f=n.slice();p.push(f),d+=n.length}return l3(...p)};return(d,p)=>{i(),c(d);let f;for(;!(f=p(l()));)c();return i(),f}}function Ig(e,t,r={}){let n=(o,s,i)=>{let a=KDe[s];if(typeof a!="function")throw new Error("invalid validator function");let c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+c)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(r))n(o,s,!0);return e}function dM(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}var aM,iM,Cde,WDe,jp,oM,Sg,sM,Ede,KDe,DT=h(()=>{aM=BigInt(0),iM=BigInt(1);Cde=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",WDe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));jp={_0:48,_9:57,A:65,F:70,a:97,f:102};oM=e=>typeof e=="bigint"&&aM<=e;Sg=e=>(iM<<BigInt(e))-iM,sM=e=>
68new Uint8Array(e),Ede=e=>Uint8Array.from(e);KDe={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||qb(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)}});function Tde(e,t){if(pM(e)>t)throw new UT({givenSize:pM(e),maxSize:t})}function fM(e){if(e>=Wp.zero&&e<=Wp.nine)return e-Wp.zero;if(e>=Wp.A&&e<=Wp.F)return e-(Wp.A-10);if(e>=Wp.a&&e<=Wp.f)return e-(Wp.a-10)}function _de(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new LT({size:e.length,targetSize:n,type:"Bytes"});let o=new Uint8Array(n);for(let s=0;s<n;s++){let i=r==="right";o[i?s:n-s-1]=e[i?s:e.length-s-1]}return o}var Wp,Pde=h(()=>{z0();Wp={zero:48,nine:57,A:65,F:70,a:97,f:102}});function u3(e,t){if(Ti(e)>t)throw new MT({givenSize:Ti(e),maxSize:t})}function Nde(e,t){if(typeof t=="number"&&t>0&&t>Ti(e)-1)throw new d3({offset:t,position:"start",size:Ti(e)})}function Rde(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Ti(e)!==r-t)throw new d3({offset:r,position:"end",size:Ti(e)})}function hM(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;let o=e.replace("0x","");if(o.length>n*2)throw new HT({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function Ode(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),o=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=r==="left"?n.slice(o):n.slice(0,n.length-o),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}var mM=h(()=>{Kp()});function q0(e,t,r){return JSON.stringify(e,(n,o)=>typeof t=="function"?t(n,o):typeof o=="bigint"?o.toString()+GDe:o,r)}var GDe,Zb=h(()=>{GDe="#__bigint"});function QDe(e,t={}){let{strict:r=!1}=t;if(!e)throw new $T(e);if(typeof e!="string")throw new $T(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new FT(e);if(!e.startsWith("0x"))throw new FT(e)}function _g(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function cu(e){return e instanceof Uint8Array?Js(e):Array.isArray(e)?Js(new Uint8Array(e)):e}function kde(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(u3(r,t.size),f3(r,t.size)):r}function Js(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=JDe[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(u3(n,t.size),h3(n,t.size)):n}function Qs(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let i=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<i){let l=typeof e=="bigint"?"n":"";throw new gM({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:r,size:n,value:`${e}${l}`})}let c=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?f3(c,n):c}function Dde(e,t={}){return Js(YDe.encode(e),t)}function f3(e,t){return hM(e,{dir:"left",size:t})}function h3(e,t){return hM(e,{dir:"right",size:t})}function Gc(e,t,r,n={}){let{strict:o}=n;Nde(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return o&&Rde(s,t,r),s}function Ti(e){return Math.ceil((e.length-2)/2)}function yM(e){return Ode(e,{dir:"left"})}function wM(e,t={}){let{strict:r=!1}=t;try{return QDe(e,{strict:r}),!0}catch{return!1}}var YDe,JDe,gM,$T,FT,MT,d3,HT,Kp=h(()=>{$0();mM();Zb();YDe=new TextEncoder,JDe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));gM=class extends $t{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}},$T=class extends $t{constructor(t){super(`Value \`${typeof t=="object"?q0(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}},FT=class extends $t{constructor(t){super(`Value \`${t}
68\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}},MT=class extends $t{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},d3=class extends $t{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},HT=class extends $t{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}});function eUe(e){if(!(e instanceof Uint8Array)){if(!e)throw new Gb(e);if(typeof e!="object")throw new Gb(e);if(!("BYTES_PER_ELEMENT"in e))throw new Gb(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new Gb(e)}}function Yb(e){return e instanceof Uint8Array?e:typeof e=="string"?m3(e):tUe(e)}function tUe(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function m3(e,t={}){let{size:r}=t,n=e;r&&(u3(e,r),n=h3(e,r));let o=n.slice(2);o.length%2&&(o=`0${o}`);let s=o.length/2,i=new Uint8Array(s);for(let a=0,c=0;a<s;a++){let l=fM(o.charCodeAt(c++)),u=fM(o.charCodeAt(c++));if(l===void 0||u===void 0)throw new $t(`Invalid byte sequence ("${o[c-2]}${o[c-1]}" in "${o}").`);i[a]=l*16+u}return i}function Ude(e,t={}){let{size:r}=t,n=XDe.encode(e);return typeof r=="number"?(Tde(n,r),rUe(n,r)):n}function rUe(e,t){return _de(e,{dir:"right",size:t})}function pM(e){return e.length}function Lde(e){try{return eUe(e),!0}catch{return!1}}var XDe,Gb,UT,LT,z0=h(()=>{$0();Kp();Pde();mM();Zb();XDe=new TextEncoder;Gb=class extends $t{constructor(t){super(`Value \`${typeof t=="object"?q0(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}},UT=class extends $t{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},LT=class extends $t{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}}});function bM(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=yde(Yb(e));return r==="Bytes"?n:Js(n)}var xM=h(()=>{wde();z0();Kp()});var VT,Hde=h(()=>{VT=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}}});var nUe,zT,vM=h(()=>{Hde();nUe={checksum:new VT(8192)},zT=nUe.checksum});function Fde(e,t={}){let{compressed:r}=t,{prefix:n,x:o,y:s}=e;if(r===!1||typeof o=="bigint"&&typeof s=="bigint"){if(n!==4)throw new jT({prefix:n,cause:new CM});return}if(r===!0||typeof o=="bigint"&&typeof s>"u"){if(n!==3&&n!==2)throw new jT({prefix:n,cause:new AM});return}throw new EM({publicKey:e})}function IM(e){let t=(()=>{if(wM(e))return Vde(e);if(Lde(e))return oUe(e);let{prefix:r,x:n,y:o}=e;return typeof n=="bigint"&&typeof o=="bigint"?{prefix:r??4,x:n,y:o}:{prefix:r,x:n}})();return Fde(t),t}function oUe(e){return Vde(Js(e))}function Vde(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new SM({publicKey:e});if(e.length===130){let n=BigInt(Gc(e,0,32)),o=BigInt(Gc(e,32,64));return{prefix:4,x:n,y:o}}if(e.length===132){let n=Number(Gc(e,0,1)),o=BigInt(Gc(e,1,33)),s=BigInt(Gc(e,33,65));return{prefix:n,x:o,y:s}}let t=Number(Gc(e,0,1)),r=BigInt(Gc(e,1,33));return{prefix:t,x:r}}function zde(e,t={}){return m3(g3(e,t))}
68function g3(e,t={}){Fde(e);let{prefix:r,x:n,y:o}=e,{includePrefix:s=!0}=t;return _g(s?Qs(r,{size:1}):"0x",Qs(n,{size:32}),typeof o=="bigint"?Qs(o,{size:32}):"0x")}var EM,jT,AM,CM,SM,qT=h(()=>{z0();$0();Kp();Zb();EM=class extends $t{constructor({publicKey:t}){super(`Value \`${q0(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}},jT=class extends $t{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}},AM=class extends $t{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}},CM=class extends $t{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}},SM=class extends $t{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${Ti(cu(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}}});function Jb(e,t={}){let{strict:r=!0}=t;if(!sUe.test(e))throw new WT({address:e,cause:new _M});if(r){if(e.toLowerCase()===e)return;if(jde(e)!==e)throw new WT({address:e,cause:new PM})}}function jde(e){if(zT.has(e))return zT.get(e);Jb(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=bM(Ude(t),{as:"Bytes"}),n=t.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(r[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());let o=`0x${n.join("")}`;return zT.set(e,o),o}function iUe(e,t={}){let{checksum:r=!1}=t;return Jb(e),r?jde(e):e}function qde(e,t={}){let r=bM(`0x${g3(e).slice(4)}`).substring(26);return iUe(`0x${r}`,t)}function Wde(e,t){return Jb(e,{strict:!1}),Jb(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}var sUe,WT,_M,PM,KT=h(()=>{z0();vM();$0();xM();qT();sUe=/^0x[a-fA-F0-9]{40}$/;WT=class extends $t{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},_M=class extends $t{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},PM=class extends $t{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}});var Kde=h(()=>{});var Zde,Gde,Yde,M$t,H$t,$$t,F$t,V$t,z$t,j$t,q$t,W$t,K$t,Z$t,G$t,Y$t,J$t,Q$t,X$t,eFt,tFt,rFt,nFt,oFt,sFt,iFt,aFt,cFt,lFt,uFt,dFt,pFt,fFt,hFt,mFt,gFt,yFt,wFt,bFt,xFt,vFt,EFt,AFt,CFt,SFt,IFt,TFt,_Ft,PFt,NFt,RFt,OFt,BFt,kFt,DFt,UFt,LFt,MFt,HFt,$Ft,FFt,VFt,zFt,jFt,qFt,WFt,KFt,ZFt,GFt,YFt,JFt,QFt,XFt,eVt,tVt,rVt,nVt,oVt,sVt,iVt,aVt,cVt,lVt,uVt,dVt,pVt,fVt,hVt,mVt,gVt,yVt,wVt,bVt,xVt,vVt,EVt,AVt,CVt,RM,ZT=h(()=>{Zde=/^(.*)\[([0-9]*)\]$/,Gde=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Yde=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,M$t=2n**(8n-1n)-1n,H$t=2n**(16n-1n)-1n,$$t=2n**(24n-1n)-1n,F$t=2n**(32n-1n)-1n,V$t=2n**(40n-1n)-1n,z$t=2n**(48n-1n)-1n,j$t=2n**(56n-1n)-1n,q$t=2n**(64n-1n)-1n,W$t=2n**(72n-1n)-1n,K$t=2n**(80n-1n)-1n,Z$t=2n**(88n-1n)-1n,G$t=2n**(96n-1n)-1n,Y$t=2n**(104n-1n)-1n,J$t=2n**(112n-1n)-1n,Q$t=2n**(120n-1n)-1n,X$t=2n**(128n-1n)-1n,eFt=2n**(136n-1n)-1n,tFt=2n**(144n-1n)-1n,rFt=2n**(152n-1n)-1n,nFt=2n**(160n-1n)-1n,oFt=2n**(168
68n-1n)-1n,sFt=2n**(176n-1n)-1n,iFt=2n**(184n-1n)-1n,aFt=2n**(192n-1n)-1n,cFt=2n**(200n-1n)-1n,lFt=2n**(208n-1n)-1n,uFt=2n**(216n-1n)-1n,dFt=2n**(224n-1n)-1n,pFt=2n**(232n-1n)-1n,fFt=2n**(240n-1n)-1n,hFt=2n**(248n-1n)-1n,mFt=2n**(256n-1n)-1n,gFt=-(2n**(8n-1n)),yFt=-(2n**(16n-1n)),wFt=-(2n**(24n-1n)),bFt=-(2n**(32n-1n)),xFt=-(2n**(40n-1n)),vFt=-(2n**(48n-1n)),EFt=-(2n**(56n-1n)),AFt=-(2n**(64n-1n)),CFt=-(2n**(72n-1n)),SFt=-(2n**(80n-1n)),IFt=-(2n**(88n-1n)),TFt=-(2n**(96n-1n)),_Ft=-(2n**(104n-1n)),PFt=-(2n**(112n-1n)),NFt=-(2n**(120n-1n)),RFt=-(2n**(128n-1n)),OFt=-(2n**(136n-1n)),BFt=-(2n**(144n-1n)),kFt=-(2n**(152n-1n)),DFt=-(2n**(160n-1n)),UFt=-(2n**(168n-1n)),LFt=-(2n**(176n-1n)),MFt=-(2n**(184n-1n)),HFt=-(2n**(192n-1n)),$Ft=-(2n**(200n-1n)),FFt=-(2n**(208n-1n)),VFt=-(2n**(216n-1n)),zFt=-(2n**(224n-1n)),jFt=-(2n**(232n-1n)),qFt=-(2n**(240n-1n)),WFt=-(2n**(248n-1n)),KFt=-(2n**(256n-1n)),ZFt=2n**8n-1n,GFt=2n**16n-1n,YFt=2n**24n-1n,JFt=2n**32n-1n,QFt=2n**40n-1n,XFt=2n**48n-1n,eVt=2n**56n-1n,tVt=2n**64n-1n,rVt=2n**72n-1n,nVt=2n**80n-1n,oVt=2n**88n-1n,sVt=2n**96n-1n,iVt=2n**104n-1n,aVt=2n**112n-1n,cVt=2n**120n-1n,lVt=2n**128n-1n,uVt=2n**136n-1n,dVt=2n**144n-1n,pVt=2n**152n-1n,fVt=2n**160n-1n,hVt=2n**168n-1n,mVt=2n**176n-1n,gVt=2n**184n-1n,yVt=2n**192n-1n,wVt=2n**200n-1n,bVt=2n**208n-1n,xVt=2n**216n-1n,vVt=2n**224n-1n,EVt=2n**232n-1n,AVt=2n**240n-1n,CVt=2n**248n-1n,RM=2n**256n-1n});function BM(e,t){if(e.length!==t.length)throw new DM({expectedLength:e.length,givenLength:t.length});let r=[];for(let n=0;n<e.length;n++){let o=e[n],s=t[n];
68r.push(BM.encode(o,s))}return _g(...r)}var kM,DM,UM,Jde=h(()=>{KT();$0();Kp();ZT();(function(e){function t(r,n,o=!1){if(r==="address"){let c=n;return Jb(c),f3(c.toLowerCase(),o?32:0)}if(r==="string")return Dde(n);if(r==="bytes")return n;if(r==="bool")return f3(kde(n),o?32:1);let s=r.match(Yde);if(s){let[c,l,u="256"]=s,d=Number.parseInt(u,10)/8;return Qs(n,{size:o?32:d,signed:l==="int"})}let i=r.match(Gde);if(i){let[c,l]=i;if(Number.parseInt(l,10)!==(n.length-2)/2)throw new kM({expectedSize:Number.parseInt(l,10),value:n});return h3(n,o?32:0)}let a=r.match(Zde);if(a&&Array.isArray(n)){let[c,l]=a,u=[];for(let d=0;d<n.length;d++)u.push(t(l,n[d],!0));return u.length===0?"0x":_g(...u)}throw new UM(r)}e.encode=t})(BM||(BM={}));kM=class extends $t{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${Ti(r)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}},DM=class extends $t{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${r}`].join(`
69`)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}},UM=class extends $t{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}});var Qde=h(()=>{});var Xde=h(()=>{});var epe=h(()=>{});var tpe=h(()=>{});var rpe=h(()=>{});var npe=h(()=>{});var ope=h(()=>{});var spe=h(()=>{});var GT,LM,ipe=h(()=>{Eg();GT=class extends F0{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,Jue(t);let n=vg(r);if(this.iHash=t.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;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),au(s)}update(t){return Vp(this),this.iHash.update(t),this}digestInto(t){Vp(this),iu(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:o,destroyed:s,blockLen:i,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},LM=(e,t,r)=>new GT(e,t).update(r).digest();LM.create=(e,t)=>new GT(e,t)});function ls(e,t){let r=e%t;return r>=Xs?r:t+r}function ya(e,t,r){let n=e;for(;t-- >Xs;)n*=n,n%=r;return n}function YT(e,t){if(e===Xs)throw new Error("invert: expected non-zero number");if(t<=Xs)throw new Error("invert: expected positive modulus, got "+t);let r=ls(e,t),n=t,o=Xs,s=us,i=us,a=Xs;for(;r!==Xs;){let l=n/r,u=n%r,d=o-i*l,p=s-a*l;n=r,r=u,o=i,s=a,i=d,a=p}if(n!==us)throw new Error("invert: does not exist");return ls(o,t)}function dpe(e,t){let r=(e.ORDER+us)/cpe,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function yUe(e,t){let r=(e.ORDER-lpe)/upe,n=e.mul(t,Pg),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,Pg),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function wUe(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-us,r=0;for(;t%Pg===Xs;)t/=Pg,r++;let n=Pg,o=y3(e);for(;ape(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return dpe;let s=o.pow(n,t),i=(t+us)/Pg;return function(c,l){if(c.is0(l))return l;if(ape(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,s),p=c.pow(l,t),f=c.pow(l,i);for(;!c.eql(p,c.ONE);){if(c.is0(p))return c.ZERO;let m=1,g=c.sqr(p);for(;!c.eql(g,c.ONE);)if(m++,g=c.sqr(g),m===u)throw new Error("Cannot find square root");let y=us<<BigInt(u-m-1),b=c.pow(d,y);u=m,d=c.sqr(b),p=c.mul(p,d),f=c.mul(f,b)}return f}}function bUe(e){return e%cpe===gUe?dpe:e%upe===lpe?yUe:wUe(e)}function MM(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=xUe.reduce((n,o)=>(n[o]="function",n),t);return Ig(e,r)}function vUe(e,t,r){if(r<Xs)throw new Error("invalid exponent, negatives unsupported");if(r===Xs)return e.ONE;if(r===us)return t;let n=e.ONE,o=t;for(;r>Xs;)r&us&&(n=e.mul(n,o)),o=e.sqr(o),r>>=us;return n}function HM(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(n[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(n[c]=e.mul(i,n[c]),e.mul(i,a)),s),n}function ape(e,t){let r=(e.ORDER-us)/Pg,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function $M(e,t){t!==void 0&&xg(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function y3(e,t,r=!1,n={}){if(e<=Xs)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=$M(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i,a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:Sg(o),ZERO:Xs,ONE:us,create:c=>ls(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Xs<=c&&c<e},is0:c=>c===Xs,isOdd:c=>(c&us)===us,neg:c=>
69ls(-c,e),eql:(c,l)=>c===l,sqr:c=>ls(c*c,e),add:(c,l)=>ls(c+l,e),sub:(c,l)=>ls(c-l,e),mul:(c,l)=>ls(c*l,e),pow:(c,l)=>vUe(a,c,l),div:(c,l)=>ls(c*YT(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>YT(c,e),sqrt:n.sqrt||(c=>(i||(i=bUe(e)),i(a,c))),toBytes:c=>r?uM(c,s):Ag(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?lM(c):qp(c)},invertBatch:c=>HM(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function ppe(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function FM(e){let t=ppe(e);return t+Math.ceil(t/2)}function fpe(e,t,r=!1){let n=e.length,o=ppe(t),s=FM(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);let i=r?lM(e):qp(e),a=ls(i,t-us)+us;return r?uM(a,o):Ag(a,o)}var Xs,us,Pg,gUe,cpe,lpe,upe,xUe,JT=h(()=>{Eg();DT();Xs=BigInt(0),us=BigInt(1),Pg=BigInt(2),gUe=BigInt(3),cpe=BigInt(4),lpe=BigInt(5),upe=BigInt(8);xUe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function VM(e,t){let r=t.negate();return e?r:t}function gpe(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function zM(e,t){gpe(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,s=Sg(e),i=BigInt(e);return{windows:r,windowSize:n,mask:s,maxNumber:o,shiftBy:i}}function mpe(e,t,r){let{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r,a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=WM);let l=t*n,u=l+Math.abs(a)-1,d=a===0,p=a<0,f=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:l}}function EUe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function AUe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}function qM(e){return ype.get(e)||1}function wpe(e,t){return{constTimeNegate:VM,hasPrecomputes(r){return qM(r)!==1},unsafeLadder(r,n,o=e.ZERO){let s=r;for(;n>hpe;)n&WM&&(o=o.add(s)),s=s.double(),n>>=WM;return o},precomputeWindow(r,n){let{windows:o,windowSize:s}=zM(n,t),i=[],a=r,c=a;for(let l=0;l<o;l++){c=a,i.push(c);for(let u=1;u<s;u++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(r,n,o){let s=e.ZERO,i=e.BASE,a=zM(r,t);for(let c=0;c<a.windows;c++){let{nextN:l,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:m}=mpe(o,c,a);o=l,d?i=i.add(VM(f,n[m])):s=s.add(VM(p,n[u]))}return{p:s,f:i}},wNAFUnsafe(r,n,o,s=e.ZERO){let i=zM(r,t);for(let a=0;a<i.windows&&o!==hpe;a++){let{nextN:c,offset:l,isZero:u,isNeg:d}=mpe(o,a,i);if(o=c,!u){let p=n[l];s=s.add(d?p.negate():p)}}return s},getPrecomputes(r,n,o){let s=jM.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&jM.set(n,o(s))),s},wNAFCached(r,n,o){let s=qM(r);return this.wNAF(s,this.getPrecomputes(s,r,o),n)},wNAFCachedUnsafe(r,n,o,s){let i=qM(r);return i===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,r,o),n,s)},setWindowSize(r,n){gpe(n,t),ype.set(r,n),jM.delete(r)}}}function bpe(e,t,r,n){EUe(r,e),AUe(n,t);let o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");let i=e.ZERO,a=Sde(BigInt(o)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=Sg(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c,p=i;for(let f=d;f>=0;f-=c){u.fill(i);for(let g=0;g<s;g++){let y=n[g],b=Number(y>>BigInt(f)&l);u[b]=u[b].add(r[g])}let m=i;for(let g=u.length-1,y=i;g>0;g--)y=y.add(u[g]),m=m.add(y);if(p=p.add(m),f!==0)for(let g=0;g<c;g++)p=p.double()}return p}function KM(e){return MM(e.Fp),Ig(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...$M(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}var hpe,WM,jM,ype,xpe=h(()=>{JT();DT();hpe=BigInt(0),WM=BigInt(1);jM=new WeakMap,ype=new WeakMap});function vpe(e){e.lowS!==void 0&&Wb("lowS",e.lowS),e.prehash!==void 0&&Wb("prehash",e.prehash)}function CUe(e){let t=KM(e);Ig(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}function ZM(e,t){return Kb(Ag(e,t))}function IUe(e){let t=CUe(e),{Fp:r}=t,n=y3(t.n,t.nBitLength),o=t.toBytes||((w,x,S)=>{let P=x.toAffine();return l3(Uint8Array.from([4]),r.toBytes(P.x),r.toBytes(P.y))}),s=t.fromBytes||(w=>{let x=w.subarray(1),S=r.fromBytes(x.subarray(0,r.BYTES)),P=r.fromBytes(x.subarray(r.BYTES,2*r.BYTES));return{x:S,y:P}});function i(w){let{a:x,b:S}=t,P=r.sqr(w),D=r.mul(P,w);return r.add(r.add(D,r.mul(w,x)),S)}function a(w,x){let S=r.sqr(x),P=i(w);return r.eql(S,P)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,GM),SUe),l=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,l)))throw new Error("bad curve params: a or b");
vendor: 4,151 bytes, line 69
69function u(w){return kT(w,mo,t.n)}function d(w){let{allowedPrivateKeyLengths:x,nByteLength:S,wrapPrivateKey:P,n:D}=t;if(x&&typeof w!="bigint"){if(qb(w)&&(w=Kb(w)),typeof w!="string"||!x.includes(w.length))throw new Error("invalid private key");w=w.padStart(S*2,"0")}let U;try{U=typeof w=="bigint"?w:qp(Ii("private key",w,S))}catch{throw new Error("invalid private key, expected hex or "+S+" bytes, got "+typeof w)}return P&&(U=ls(U,D)),Cg("private key",U,mo,D),U}function p(w){if(!(w instanceof g))throw new Error("ProjectivePoint expected")}let f=dM((w,x)=>{let{px:S,py:P,pz:D}=w;if(r.eql(D,r.ONE))return{x:S,y:P};let U=w.is0();x==null&&(x=U?r.ONE:r.inv(D));let N=r.mul(S,x),L=r.mul(P,x),I=r.mul(D,x);if(U)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:N,y:L}}),m=dM(w=>{if(w.is0()){if(t.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}let{x,y:S}=w.toAffine();if(!r.isValid(x)||!r.isValid(S))throw new Error("bad point: x or y not FE");if(!a(x,S))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(x,S,P){if(x==null||!r.isValid(x))throw new Error("x required");if(S==null||!r.isValid(S)||r.is0(S))throw new Error("y required");if(P==null||!r.isValid(P))throw new Error("z required");this.px=x,this.py=S,this.pz=P,Object.freeze(this)}static fromAffine(x){let{x:S,y:P}=x||{};if(!x||!r.isValid(S)||!r.isValid(P))throw new Error("invalid affine point");if(x instanceof g)throw new Error("projective point not allowed");let D=U=>r.eql(U,r.ZERO);return D(S)&&D(P)?g.ZERO:new g(S,P,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){let S=HM(r,x.map(P=>P.pz));return x.map((P,D)=>P.toAffine(S[D])).map(g.fromAffine)}static fromHex(x){let S=g.fromAffine(s(Ii("pointHex",x)));return S.assertValidity(),S}static fromPrivateKey(x){return g.BASE.multiply(d(x))}static msm(x,S){return bpe(g,n,x,S)}_setWindowSize(x){C.setWindowSize(this,x)}assertValidity(){m(this)}hasEvenY(){let{y:x}=this.toAffine();if(r.isOdd)return!r.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.eql(r.mul(S,L),r.mul(U,D)),R=r.eql(r.mul(P,L),r.mul(N,D));return I&&R}negate(){return new g(this.px,r.neg(this.py),this.pz)}double(){let{a:x,b:S}=t,P=r.mul(S,GM),{px:D,py:U,pz:N}=this,L=r.ZERO,I=r.ZERO,R=r.ZERO,A=r.mul(D,D),T=r.mul(U,U),v=r.mul(N,N),E=r.mul(D,U);return E=r.add(E,E),R=r.mul(D,N),R=r.add(R,R),L=r.mul(x,R),I=r.mul(P,v),I=r.add(L,I),L=r.sub(T,I),I=r.add(T,I),I=r.mul(L,I),L=r.mul(E,L),R=r.mul(P,R),v=r.mul(x,v),E=r.sub(A,v),E=r.mul(x,E),E=r.add(E,R),R=r.add(A,A),A=r.add(R,A),A=r.add(A,v),A=r.mul(A,E),I=r.add(I,A),v=r.mul(U,N),v=r.add(v,v),A=r.mul(v,E),L=r.sub(L,A),R=r.mul(v,T),R=r.add(R,R),R=r.add(R,R),new g(L,I,R)}add(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.ZERO,R=r.ZERO,A=r.ZERO,T=t.a,v=r.mul(t.b,GM),E=r.mul(S,U),O=r.mul(P,N),B=r.mul(D,L),_=r.add(S,P),M=r.add(U,N);_=r.mul(_,M),M=r.add(E,O),_=r.sub(_,M),M=r.add(S,D);let F=r.add(U,L);return M=r.mul(M,F),F=r.add(E,B),M=r.sub(M,F),F=r.add(P,D),I=r.add(N,L),F=r.mul(F,I),I=r.add(O,B),F=r.sub(F,I),A=r.mul(T,M),I=r.mul(v,B),A=r.add(I,A),I=r.sub(O,A),A=r.add(O,A),R=r.mul(I,A),O=r.add(E,E),O=r.add(O,E),B=r.mul(T,B),M=r.mul(v,M),O=r.add(O,B),B=r.sub(E,B),B=r.mul(T,B),M=r.add(M,B),E=r.mul(O,M),R=r.add(R,E),E=r.mul(F,M),I=r.mul(_,I),I=r.sub(I,E),E=r.mul(_,O),A=r.mul(F,A),A=r.add(A,E),new g(I,R,A)}subtract(x){return this.add(x.negate())}is0(){return this.equals(g.ZERO)}wNAF(x){return C.wNAFCached(this,x,g.normalizeZ)}multiplyUnsafe(x){let{endo:S,n:P}=t;Cg("scalar",x,Gp,P);let D=g.ZERO;if(x===Gp)return D;if(this.is0()||x===mo)return this;if(!S||C.hasPrecomputes(this))return C.wNAFCachedUnsafe(this,x,g.normalizeZ);let{k1neg:U,k1:N,k2neg:L,k2:I}=S.splitScalar(x),R=D,A=D,T=this;for(;N>Gp||I>Gp;)N&mo&&(R=R.add(T)),I&mo&&(A=A.add(T)),T=T.double(),N>>=mo,I>>=mo;return U&&(R=R.negate()),L&&(A=A.negate()),A=new g(r.mul(A.px,S.beta),A.py,A.pz),R.add(A)}multiply(x){let{endo:S,n:P}=t;Cg("scalar",x,mo,P);let D,U;
69if(S){let{k1neg:N,k1:L,k2neg:I,k2:R}=S.splitScalar(x),{p:A,f:T}=this.wNAF(L),{p:v,f:E}=this.wNAF(R);A=C.constTimeNegate(N,A),v=C.constTimeNegate(I,v),v=new g(r.mul(v.px,S.beta),v.py,v.pz),D=A.add(v),U=T.add(E)}else{let{p:N,f:L}=this.wNAF(x);D=N,U=L}return g.normalizeZ([D,U])[0]}multiplyAndAddUnsafe(x,S,P){let D=g.BASE,U=(L,I)=>I===Gp||I===mo||!L.equals(D)?L.multiplyUnsafe(I):L.multiply(I),N=U(this,S).add(U(x,P));return N.is0()?void 0:N}toAffine(x){return f(this,x)}isTorsionFree(){let{h:x,isTorsionFree:S}=t;if(x===mo)return!0;if(S)return S(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:x,clearCofactor:S}=t;return x===mo?this:S?S(g,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return Wb("isCompressed",x),this.assertValidity(),o(g,this,x)}toHex(x=!0){return Wb("isCompressed",x),Kb(this.toRawBytes(x))}}g.BASE=new g(t.Gx,t.Gy,r.ONE),g.ZERO=new g(r.ZERO,r.ONE,r.ZERO);let{endo:y,nBitLength:b}=t,C=wpe(g,y?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function TUe(e){let t=KM(e);return Ig(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Epe(e){let t=TUe(e),{Fp:r,n,nByteLength:o,nBitLength:s}=t,i=r.BYTES+1,a=2*r.BYTES+1;function c(v){return ls(v,n)}function l(v){return YT(v,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:f}=IUe({...t,toBytes(v,E,O){let B=E.toAffine(),_=r.toBytes(B.x),M=l3;return Wb("isCompressed",O),O?M(Uint8Array.from([E.hasEvenY()?2:3]),_):M(Uint8Array.from([4]),_,r.toBytes(B.y))},fromBytes(v){let E=v.length,O=v[0],B=v.subarray(1);if(E===i&&(O===2||O===3)){let _=qp(B);if(!kT(_,mo,r.ORDER))throw new Error("Point is not on curve");let M=p(_),F;try{F=r.sqrt(M)}catch(Q){let Y=Q instanceof Error?": "+Q.message:"";throw new Error("Point is not on curve"+Y)}let q=(F&mo)===mo;return(O&1)===1!==q&&(F=r.neg(F)),{x:_,y:F}}else if(E===a&&O===4){let _=r.fromBytes(B.subarray(0,r.BYTES)),M=r.fromBytes(B.subarray(r.BYTES,2*r.BYTES));return{x:_,y:M}}else{let _=i,M=a;throw new Error("invalid Point, expected length of "+_+", or uncompressed "+M+", got "+E)}}});function m(v){let E=n>>mo;return v>E}function g(v){return m(v)?c(-v):v}let y=(v,E,O)=>qp(v.slice(E,O));class b{constructor(E,O,B){Cg("r",E,mo,n),Cg("s",O,mo,n),this.r=E,this.s=O,B!=null&&(this.recovery=B),Object.freeze(this)}static fromCompact(E){let O=o;return E=Ii("compactSignature",E,O*2),new b(y(E,0,O),y(E,O,2*O))}static fromDER(E){let{r:O,s:B}=Zp.toSig(Ii("DER",E));return new b(O,B)}assertValidity(){}addRecoveryBit(E){return new b(this.r,this.s,E)}recoverPublicKey(E){let{r:O,s:B,recovery:_}=this,M=D(Ii("msgHash",E));if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");let F=_===2||_===3?O+t.n:O;if(F>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(_&1)===0?"02":"03",oe=u.fromHex(q+ZM(F,r.BYTES)),Q=l(F),Y=c(-M*Q),pe=c(B*Q),he=u.BASE.multiplyAndAddUnsafe(oe,Y,pe);if(!he)throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return c3(this.toDERHex())}toDERHex(){return Zp.hexFromSig(this)}toCompactRawBytes(){return c3(this.toCompactHex())}toCompactHex(){let E=o;return ZM(this.r,E)+ZM(this.s,E)}}let C={isValidPrivateKey(v){try{return d(v),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let v=FM(t.n);return fpe(t.randomBytes(v),t.n)},precompute(v=8,E=u.BASE){return E._setWindowSize(v),E.multiply(BigInt(3)),E}};function w(v,E=!0){return u.fromPrivateKey(v).toRawBytes(E)}function x(v){if(typeof v=="bigint")return!1;if(v instanceof u)return!0;let O=Ii("key",v).length,B=r.BYTES,_=B+1,M=2*B+1;if(!(t.allowedPrivateKeyLengths||o===_))return O===_||O===M}function S(v,E,O=!0){if(x(v)===!0)throw new Error("first arg must be private key");if(x(E)===!1)throw new Error("second arg must be public key");return u.fromHex(E).multiply(d(v)).toRawBytes(O)}let P=t.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");
vendor: 5,576 bytes, line 69
69let E=qp(v),O=v.length*8-s;return O>0?E>>BigInt(O):E},D=t.bits2int_modN||function(v){return c(P(v))},U=Sg(s);function N(v){return Cg("num < 2^"+s,v,Gp,U),Ag(v,o)}function L(v,E,O=I){if(["recovered","canonical"].some(me=>me in O))throw new Error("sign() legacy options not supported");let{hash:B,randomBytes:_}=t,{lowS:M,prehash:F,extraEntropy:q}=O;M==null&&(M=!0),v=Ii("msgHash",v),vpe(O),F&&(v=Ii("prehashed msgHash",B(v)));let oe=D(v),Q=d(E),Y=[N(Q),N(oe)];if(q!=null&&q!==!1){let me=q===!0?_(r.BYTES):q;Y.push(Ii("extraEntropy",me))}let pe=l3(...Y),he=oe;function Te(me){let _e=P(me);if(!f(_e))return;let wt=l(_e),Nt=u.BASE.multiply(_e).toAffine(),bt=c(Nt.x);if(bt===Gp)return;let ar=c(wt*c(he+bt*Q));if(ar===Gp)return;let Ar=(Nt.x===bt?0:2)|Number(Nt.y&mo),fl=ar;return M&&m(ar)&&(fl=g(ar),Ar^=1),new b(bt,fl,Ar)}return{seed:pe,k2sig:Te}}let I={lowS:t.lowS,prehash:!1},R={lowS:t.lowS,prehash:!1};function A(v,E,O=I){let{seed:B,k2sig:_}=L(v,E,O),M=t;return Ide(M.hash.outputLen,M.nByteLength,M.hmac)(B,_)}u.BASE._setWindowSize(8);function T(v,E,O,B=R){let _=v;E=Ii("msgHash",E),O=Ii("publicKey",O);let{lowS:M,prehash:F,format:q}=B;if(vpe(B),"strict"in B)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&q!=="compact"&&q!=="der")throw new Error("format must be compact or der");let oe=typeof _=="string"||qb(_),Q=!oe&&!q&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!oe&&!Q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,pe;try{if(Q&&(Y=new b(_.r,_.s)),oe){try{q!=="compact"&&(Y=b.fromDER(_))}catch(Ar){if(!(Ar instanceof Zp.Err))throw Ar}!Y&&q!=="der"&&(Y=b.fromCompact(_))}pe=u.fromHex(O)}catch{return!1}if(!Y||M&&Y.hasHighS())return!1;F&&(E=t.hash(E));let{r:he,s:Te}=Y,me=D(E),_e=l(Te),wt=c(me*_e),Nt=c(he*_e),bt=u.BASE.multiplyAndAddUnsafe(pe,wt,Nt)?.toAffine();return bt?c(bt.x)===he:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:S,sign:A,verify:T,ProjectivePoint:u,Signature:b,utils:C}}var YM,Zp,Gp,mo,UVt,GM,SUe,Ape=h(()=>{xpe();JT();DT();YM=class extends Error{constructor(t=""){super(t)}},Zp={Err:YM,_tlv:{encode:(e,t)=>{let{Err:r}=Zp;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=a3(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?a3(o.length/2|128):"";return a3(e)+s+o+t},decode(e,t){let{Err:r}=Zp,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],s=!!(o&128),i=0;if(!s)i=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=t.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of l)i=i<<8|u;if(n+=c,i<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+i)}}},_int:{encode(e){let{Err:t}=Zp;if(e<Gp)throw new t("integer: negative integers are not allowed");let r=a3(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Zp;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return qp(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=Zp,o=Ii("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=Zp,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),s=n+o;return t.encode(48,s)}};Gp=BigInt(0),mo=BigInt(1),UVt=BigInt(2),GM=BigInt(3),SUe=BigInt(4)});function _Ue(e){return{hash:e,hmac:(t,...r)=>LM(e,t,Xue(...r)),randomBytes:ede}}function Cpe(e,t){let r=n=>Epe({...e,..._Ue(n)});return{...r(t),create:r}}var Spe=h(()=>{ipe();Eg();Ape();});function RUe(e){let t=_pe,r=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=ya(u,r,t)*u%t,p=ya(d,r,t)*u%t,f=ya(p,JM,t)*l%t,m=ya(f,o,t)*f%t,g=ya(m,s,t)*m%t,y=ya(g,a,t)*g%t,b=ya(y,c,t)*y%t,C=ya(b,a,t)*g%t,w=ya(C,r,t)*u%t,x=ya(w,i,t)*m%t,S=ya(x,n,t)*l%t,P=ya(S,JM,t);if(!QM.eql(QM.sqr(P),e))throw new Error("Cannot find square root");return P}var _pe,Ipe,PUe,NUe,JM,Tpe,QM,wa,XM=h(()=>{xde();Spe();JT();_pe=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ipe=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),PUe=BigInt(0),NUe=BigInt(1),JM=BigInt(2),Tpe=(e,t)=>(e+t/JM)/t;QM=y3(_pe,void 0,void 0,{sqrt:RUe}),wa=Cpe({a:PUe,b:BigInt(7),Fp:QM,n:Ipe,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=Ipe,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-NUe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,i=BigInt("0x100000000000000000000000000000000"),a=Tpe(s*e,t),c=Tpe(-n*e,t),l=ls(e-a*r-c*o,t),u=ls(-a*n-c*s,t),d=l>i,p=u>i;
69if(d&&(l=t-l),p&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:p,k2:u}}}},bde)});var o_={};Ce(o_,{InvalidRError:()=>XT,InvalidSError:()=>e_,InvalidSerializedSizeError:()=>QT,InvalidVError:()=>t_,InvalidYParityError:()=>Ng,MissingPropertiesError:()=>Qb,assert:()=>r_,extract:()=>OUe,from:()=>tH,fromBytes:()=>Ppe,fromDerBytes:()=>BUe,fromDerHex:()=>Npe,fromHex:()=>eH,fromLegacy:()=>Rpe,fromRpc:()=>Ope,fromTuple:()=>kUe,toBytes:()=>DUe,toDerBytes:()=>UUe,toDerHex:()=>LUe,toHex:()=>Bpe,toLegacy:()=>MUe,toRpc:()=>HUe,toTuple:()=>$Ue,vToYParity:()=>n_,validate:()=>FUe,yParityToV:()=>rH});function r_(e,t={}){let{recovered:r}=t;if(typeof e.r>"u")throw new Qb({signature:e});if(typeof e.s>"u")throw new Qb({signature:e});if(r&&typeof e.yParity>"u")throw new Qb({signature:e});if(e.r<0n||e.r>RM)throw new XT({value:e.r});if(e.s<0n||e.s>RM)throw new e_({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Ng({value:e.yParity})}function Ppe(e){return eH(Js(e))}function eH(e){if(e.length!==130&&e.length!==132)throw new QT({signature:e});let t=BigInt(Gc(e,0,32)),r=BigInt(Gc(e,32,64)),n=(()=>{let o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return n_(o)}catch{throw new Ng({value:o})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function OUe(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return tH(e)}function tH(e){let t=typeof e=="string"?eH(e):e instanceof Uint8Array?Ppe(e):typeof e.r=="string"?Ope(e):e.v?Rpe(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return r_(t),t}function BUe(e){return Npe(Js(e))}function Npe(e){let{r:t,s:r}=wa.Signature.fromDER(cu(e).slice(2));return{r:t,s:r}}function Rpe(e){return{r:e.r,s:e.s,yParity:n_(e.v)}}function Ope(e){let t=(()=>{let r=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=n_(r)),typeof n!="number")throw new Ng({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function kUe(e){let[t,r,n]=e;return tH({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function DUe(e){return m3(Bpe(e))}function Bpe(e){r_(e);let t=e.r,r=e.s;return _g(Qs(t,{size:32}),Qs(r,{size:32}),typeof e.yParity=="number"?Qs(rH(e.yParity),{size:1}):"0x")}function UUe(e){return new wa.Signature(e.r,e.s).toDERRawBytes()}function LUe(e){return`0x${new wa.Signature(e.r,e.s).toDERHex()}`}function MUe(e){return{r:e.r,s:e.s,v:rH(e.yParity)}}function HUe(e){let{r:t,s:r,yParity:n}=e;return{r:Qs(t,{size:32}),s:Qs(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function $Ue(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":yM(Qs(t)),r===0n?"0x":yM(Qs(r))]}function FUe(e,t={}){try{return r_(e,t),!0}catch{return!1}}function n_(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new t_({value:e})}function rH(e){if(e===0)return 27;if(e===1)return 28;throw new Ng({value:e})}var QT,Qb,XT,e_,Ng,t_,kpe=h(()=>{XM();z0();$0();Kp();Zb();ZT();QT=class extends $t{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Ti(cu(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}},Qb=class extends $t{constructor({signature:t}){super(`Signature \`${q0(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}},XT=class extends $t{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}},e_=class extends $t{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}},Ng=class extends $t{constructor({value:t}){super(`Value \`${t}
69\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}},t_=class extends $t{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}});var Dpe=h(()=>{});var Upe=h(()=>{});var KVt,ZVt,Lpe=h(()=>{KVt=Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[t,e.charCodeAt(0)])),ZVt={...Object.fromEntries(Array.from("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").map((e,t)=>[e.charCodeAt(0),t])),61:0,45:62,95:63}});var Mpe=h(()=>{});var Hpe=h(()=>{});var $pe,KUe,Fpe,ZUe,GVt,Vpe=h(()=>{$pe=6,KUe=32,Fpe=4096,ZUe=KUe*Fpe,GVt=ZUe*$pe-1-1*Fpe*$pe});var zpe=h(()=>{});var jpe=h(()=>{});var qpe=h(()=>{});var Wpe=h(()=>{});var Kpe=h(()=>{});var Zpe=h(()=>{});var Gpe=h(()=>{});var Ype=h(()=>{});var Jpe=h(()=>{});var Qpe=h(()=>{rW()});var Xpe=h(()=>{});var efe=h(()=>{});var tfe,rfe=h(()=>{tfe=!1});var s_={};Ce(s_,{createKeyPair:()=>lLe,getPublicKey:()=>nfe,getSharedSecret:()=>uLe,noble:()=>cLe,randomPrivateKey:()=>ofe,recoverAddress:()=>sfe,recoverPublicKey:()=>ife,sign:()=>dLe,verify:()=>pLe});function lLe(e={}){let{as:t="Hex"}=e,r=ofe({as:t}),n=nfe({privateKey:r});return{privateKey:r,publicKey:n}}function nfe(e){let{privateKey:t}=e,r=wa.ProjectivePoint.fromPrivateKey(cu(t).slice(2));return IM(r)}function uLe(e){let{as:t="Hex",privateKey:r,publicKey:n}=e,i=wa.ProjectivePoint.fromHex(g3(n).slice(2)).multiply(wa.utils.normPrivateKeyToScalar(cu(r).slice(2))).toRawBytes(!0);return t==="Hex"?Js(i):i}function ofe(e={}){let{as:t="Hex"}=e,r=wa.utils.randomPrivateKey();return t==="Hex"?Js(r):r}function sfe(e){return qde(ife(e))}function ife(e){let{payload:t,signature:r}=e,{r:n,s:o,yParity:s}=r,a=new wa.Signature(BigInt(n),BigInt(o)).addRecoveryBit(s).recoverPublicKey(cu(t).substring(2));return IM(a)}function dLe(e){let{extraEntropy:t=tfe,hash:r,payload:n,privateKey:o}=e,{r:s,s:i,recovery:a}=wa.sign(Yb(n),Yb(o),{extraEntropy:typeof t=="boolean"?t:cu(t).slice(2),lowS:!0,...r?{prehash:!0}:{}});return{r:s,s:i,yParity:a}}function pLe(e){let{address:t,hash:r,payload:n,publicKey:o,signature:s}=e;return t?Wde(t,sfe({payload:n,signature:s})):wa.verify(s,Yb(n),zde(o),...r?[{prehash:!0,lowS:!0}]:[])}var cLe,afe=h(()=>{XM();KT();z0();Kp();rfe();qT();cLe=wa});var cfe=h(()=>{});var lfe=h(()=>{});var ufe=h(()=>{});var dfe=h(()=>{AW()});var pfe=h(()=>{});var ffe=h(()=>{});var _i,nH,oH,sH,iH,aH,cH,lH,uH,dH,pH,fH,hH,hfe=h(()=>{_i=class extends Error{constructor(t){let{cause:r,code:n,message:o,data:s,stack:i}=t;super(o,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.BaseError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"stack",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}
vendor: 10,125 bytes, line 69
69),this.cause=r,this.code=n,this.data=s,this.stack=i??""}},nH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Missing or invalid parameters."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidInputError"})}};Object.defineProperty(nH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});oH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Requested resource not found."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceNotFoundError"})}};Object.defineProperty(oH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});sH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Requested resource not available."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ResourceUnavailableError"})}};Object.defineProperty(sH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});iH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Transaction creation failed."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.TransactionRejectedError"})}};Object.defineProperty(iH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});aH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Method is not implemented."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotSupportedError"})}};Object.defineProperty(aH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});cH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Rate limit exceeded."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.LimitExceededError"})}};Object.defineProperty(cH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});lH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"JSON-RPC version not supported."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.VersionNotSupportedError"})}};Object.defineProperty(lH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});uH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Input is not a valid JSON-RPC request."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidRequestError"})}};Object.defineProperty(uH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});dH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Method does not exist."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.MethodNotFoundError"})}};Object.defineProperty(dH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});pH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Invalid method parameters."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InvalidParamsError"})}};Object.defineProperty(pH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});fH=class e extends _i{constructor(t={}){super({cause:t.cause,code:e.code,data:t.data,message:t.message??"Internal JSON-RPC error.",stack:t.stack}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.InternalError"})}};Object.defineProperty(fH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});hH=class e extends _i{constructor(t={}){super({code:e.code,data:t.data,message:t.message??"Failed to parse JSON-RPC response."}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcResponse.ParseError"})}};Object.defineProperty(hH,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700})});var ei,mH,gH,yH,wH,bH,xH,vH,EH,AH,CH,SH,IH,TH,mfe=h(()=>{TW();ei=class extends Error{constructor(t,r){super(r),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t,this.details=r}},mH=class extends ei{constructor({message:t="The user rejected the request."}={}){super(4001,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UserRejectedRequestError"})}};Object.defineProperty(mH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});gH=class extends ei{constructor({message:t="The requested method and/or account has not been authorized by the user."}={}){super(4100,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnauthorizedError"})}};Object.defineProperty(gH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});yH=class extends ei{constructor({message:t="The provider does not support the requested method."}={}){super(4200,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedMethodError"})}};Object.defineProperty(yH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});wH=class extends ei{constructor({message:t="The provider is disconnected from all chains."}={}){super(4900,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DisconnectedError"})}};Object.defineProperty(wH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});bH=class extends ei{constructor({message:t="The provider is not connected to the requested chain."}={}){super(4901,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.ChainDisconnectedError"})}};Object.defineProperty(bH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});xH=class extends ei{constructor({message:t="An error occurred when attempting to switch chain."}={}){super(4902,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.SwitchChainError"})}};Object.defineProperty(xH,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});vH=class extends ei{constructor({message:t="This Wallet does not support a capability that was not marked as optional."}={}){super(5700,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedNonOptionalCapabilityError"})}};Object.defineProperty(vH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});EH=class extends ei{constructor({message:t="This Wallet does not support the requested chain ID."}={}){super(5710,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnsupportedChainIdError"})}};Object.defineProperty(EH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});AH=class extends ei{constructor({message:t="There is already a bundle submitted with this ID."}={}){super(5720,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.DuplicateIdError"})}};Object.defineProperty(AH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});CH=class extends ei{constructor({message:t="This bundle id is unknown / has not been submitted."}={}){super(5730,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.UnknownBundleIdError"})}};Object.defineProperty(CH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});SH=class extends ei{constructor({message:t="The call bundle is too large for the Wallet to process."}={}){super(5740,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.BundleTooLargeError"})}};
69Object.defineProperty(SH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});IH=class extends ei{constructor({message:t="The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."}={}){super(5750,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicReadyWalletRejectedUpgradeError"})}};Object.defineProperty(IH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});TH=class extends ei{constructor({message:t="The wallet does not support atomic execution but the request requires it."}={}){super(5760,t),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Provider.AtomicityNotSupportedError"})}};Object.defineProperty(TH,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760})});var gfe=h(()=>{});var yfe=h(()=>{});var wfe=h(()=>{});var bfe=h(()=>{});var xfe=h(()=>{});var vfe=h(()=>{});var Efe=h(()=>{});var Afe=h(()=>{});var Cfe=h(()=>{});var Sfe=h(()=>{});var Ife=h(()=>{});var Tfe=h(()=>{});var _fe=h(()=>{});var Pfe=h(()=>{});var Nfe=h(()=>{});var Rfe=h(()=>{});var ozt,Ofe=h(()=>{ozt=Uint8Array.from([105,171,180,181,160,222,75,198,42,42,32,31,141,37,186,233])});var Bfe=h(()=>{});var kfe=h(()=>{});var Dfe=h(()=>{jue();Qde();Xde();epe();tpe();Kde();Jde();rpe();npe();KT();ope();Dpe();Upe();Lpe();Mpe();Vpe();qpe();Wpe();Kpe();Zpe();Gpe();z0();vM();Ype();Jpe();Qpe();$0();Xpe();efe();xM();cfe();Kp();Zb();lfe();Hpe();ufe();dfe();pfe();ffe();mfe();qT();spe();gfe();hfe();yfe();wfe();afe();kpe();bfe();ZT();xfe();zpe();Efe();Afe();Cfe();Sfe();Ife();Tfe();_fe();Pfe();Nfe();Rfe();vfe();Ofe();Bfe();jpe();kfe()});function rl(e){let[t,r]=e.split($Le);return{namespace:t,reference:r}}function whe(e,t){return e.includes(":")?[e]:t.chains||[]}function Ae(e,t){let{message:r,code:n}=VLe[e];return{message:t?`${r} ${t}`:r,code:n}}function Ir(e,t){let{message:r,code:n}=FLe[e];return{message:t?`${r} ${t}`:r,code:n}}function I3(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function rf(){return!(0,el.getDocument)()&&!!(0,el.getNavigator)()&&navigator.product===GLe}function bhe(){return rf()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function xhe(){return rf()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function Ug(){return!I3()&&!!(0,el.getNavigator)()&&!!(0,el.getDocument)()}function T3(){return rf()?Ni.reactNative:I3()?Ni.node:Ug()?Ni.browser:Ni.unknown}function i$(){var e;try{return rf()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(e=global.Application)==null?void 0:e.applicationId:void 0}catch{return}}function JLe(e,t){let r=new URLSearchParams(e);return Object.entries(t).sort(([n],[o])=>n.localeCompare(o)).forEach(([n,o])=>{o!=null&&r.set(n,String(o))}),r.toString()}function vhe(e){var t,r;let n=a$();try{return e!=null&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),(t=e?.icons)!=null&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(o=>o!=="")),ZLe(Lfe(Lfe({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:(r=e?.icons)!=null&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(o){return console.warn("Error populating app metadata",o),e||n}}function a$(){return(0,ghe.getWindowMetadata)()||{name:"",description:"",url:"",icons:[""]}}function QLe(){if(T3()===Ni.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){let{OS:r,Version:n}=global.Platform;return[r,n].join("-")}let e=Y5();if(e===null)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function XLe(){var e;let t=T3();return t===Ni.browser?[t,((e=(0,el.getLocation)())==null?void 0:e.host)||"unknown"].join(":"):t}function c$(e,t,r){let n=QLe(),o=XLe();return[[e,t].join("-"),[YLe,r].join("-"),n,o].join("/")}function Ehe({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:o,projectId:s,useOnCloseEvent:i,bundleId:a,packageName:c}){let l=r.split("?"),u=c$(e,t,n),d={auth:o,ua:u,projectId:s,useOnCloseEvent:i||void 0,packageName:c||void 0,bundleId:a||void 0},p=JLe(l[1]||"",d);return l[0]+"?"+p}function Rg(e,t){return e.filter(r=>t.includes(r)).length===e.length}function b_(e){return Object.fromEntries(e.entries())}function x_(e){return new Map(Object.entries(e))}function nf(e=ef.FIVE_MINUTES,t){let r=(0,ef.toMiliseconds)(e||ef.FIVE_MINUTES),n,o,s,i;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a),i=Promise.resolve(a))},reject:a=>{s&&o&&(clearTimeout(s),o(a))},done:()=>new Promise((a,c)=>{if(i)return a(i);s=setTimeout(()=>{let l=Ae("EXPIRED"),u=new Error(t||l.message);u.code=l.code,c(u)},r),n=a,o=c})}}function nl(e,t,r){return new Promise(async(n,o)=>{let s=setTimeout(()=>
vendor: 21,753 bytes, lines 69-70
69o(new Error(r)),t);try{let i=await e;n(i)}catch(i){o(i)}clearTimeout(s)})}function Ahe(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function Che(e){return Ahe("topic",e)}function She(e){return Ahe("id",e)}function v_(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if(t==="topic"&&typeof r=="string")n.topic=r;else if(t==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function sn(e,t){return(0,ef.fromMiliseconds)((t||Date.now())+(0,ef.toMiliseconds)(e))}function xa(e){return Date.now()>=(0,ef.toMiliseconds)(e)}function sr(e,t){return`${e}${t?`:${t}`:""}`}function Qc(e=[],t=[]){return[...new Set([...e,...t])]}async function Ihe({id:e,topic:t,wcDeepLink:r}){var n;try{if(!r)return;let o=typeof r=="string"?JSON.parse(r):r,s=o?.href;if(typeof s!="string")return;let i=eMe(s,e,t),a=T3();if(a===Ni.browser){if(!((n=(0,el.getDocument)())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}tMe(i)}else a===Ni.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(i)}catch(o){console.error(o)}}function eMe(e,t,r){let n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let o=`${e}`;if(e.startsWith("https://t.me")){let s=e.includes("?")?"&startapp=":"?startapp=";o=`${o}${s}${oMe(n,!0)}`}else o=`${o}/wc?${n}`;return o}function tMe(e){let t="_self";nMe()?t="_top":(rMe()||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"),window.open(e,t,"noreferrer noopener")}async function The(e,t){let r="";try{if(Ug()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(n){console.error(n)}return r}function l$(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function u$(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function _3(){return typeof process<"u"&&process.env.IS_VITEST==="true"}function rMe(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function nMe(){try{return window.self!==window.top}catch{return!1}}function oMe(e,t=!1){let r=Buffer.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}function _he(e){return Buffer.from(e,"base64").toString("utf-8")}function Phe(e){return new Promise(t=>setTimeout(t,e))}function Nhe(e,t=!1){return t?{h:Number(e&i_),l:Number(e>>Hfe&i_)}:{h:Number(e>>Hfe&i_)|0,l:Number(e&i_)|0}}function Rhe(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=Nhe(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}function Jc(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}function E_(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function tf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function tl(e,...t){if(!E_(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function A_(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");tf(e.outputLen),tf(e.blockLen)}function nm(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function f$(e,t){tl(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function A3(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function sc(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function _H(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function lu(e,t){return e<<32-t|e>>>t}function Bhe(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function mMe(e){for(let t=0;t<e.length;t++)e[t]=Bhe(e[t]);return e}function r6(e){if(tl(e),khe)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=gMe[e[r]];return t}function Vfe(e){if(e>=Yp._0&&e<=Yp._9)return e-Yp._0;if(e>=Yp.A&&e<=Yp.F)return e-(Yp.A-10);if(e>=Yp.a&&e<=Yp.f)return e-(Yp.a-10)}function p_(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(khe)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=Vfe(e.charCodeAt(s)),a=Vfe(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function Dhe(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Xc(e){return typeof e=="string"&&(e=Dhe(e)),tl(e),e}function tm(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];tl(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}function P3(e){let t=n=>e().update(Xc(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function yMe(e){let t=(n,o)=>e(o).update(Xc(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Lg(e=32){if(Xb&&typeof Xb.getRandomValues=="function")return Xb.getRandomValues(new Uint8Array(e));if(Xb&&typeof Xb.randomBytes=="function")return Uint8Array.from(Xb.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function SMe(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,c=(i+2)%10,l=r[c],u=r[c+1],d=zfe(l,u,1)^r[a],p=jfe(l,u,1)^r[a+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=Lhe[i],c=zfe(o,s,a),l=jfe(o,s,a),u=Uhe[i];o=e[u],s=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=AMe[n],e[1]^=CMe[n]}sc(r)}function _Me(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function PMe(e,t,r){return e&t^~e&r}function NMe(e,t,r){return e&t^e&r^t&r}function Y0(e,t,r,n,o,s){let i=o[s],a=o[s+1],c=Ne[2*e],l=Ne[2*e+1],u=Ne[2*t],d=Ne[2*t+1],p=Ne[2*r],f=Ne[2*r+1],m=Ne[2*n],g=Ne[2*n+1],y=d$(c,u,i);l=p$(y,l,d,a),c=y|0,{Dh:g,Dl:m}={Dh:g^l,Dl:m^c},{Dh:g,Dl:m}={Dh:sMe(g,m),Dl:iMe(g)},{h:f,l:p}=Jc(f,p,g,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^p},{Bh:d,Bl:u}={Bh:Q0(d,u,24),Bl:X0(d,u,24)},Ne[2*e]=c,Ne[2*e+1]=l,Ne[2*t]=u,Ne[2*t+1]=d,Ne[2*r]=p,Ne[2*r+1]=f,Ne[2*n]=m,Ne[2*n+1]=g}function J0(e,t,r,n,o,s){let i=o[s],a=o[s+1],c=Ne[2*e],l=Ne[2*e+1],u=Ne[2*t],d=Ne[2*t+1],p=Ne[2*r],f=Ne[2*r+1],m=Ne[2*n],g=Ne[2*n+1],y=d$(c,u,i);l=p$(y,l,d,a),c=y|0,{Dh:g,Dl:m}={Dh:g^l,Dl:m^c},{Dh:g,Dl:m}={Dh:Q0(g,m,16),Dl:X0(g,m,16)},{h:f,l:p}=Jc(f,p,g,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^p},{Bh:d,Bl:u}={Bh:x3(d,u,63),Bl:v3(d,u,63)},Ne[2*e]=c,Ne[2*e+1]=l,Ne[2*t]=u,Ne[2*t+1]=d,Ne[2*r]=p,Ne[2*r+1]=f,Ne[2*n]=m,Ne[2*n+1]=g}function MMe(e,t={},r,n,o){if(tf(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");let{key:s,salt:i,personalization:a}=t;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(i!==void 0&&i.length!==n)throw new Error("salt must be undefined or "+n);if(a!==void 0&&a.length!==o)throw new Error("personalization must be undefined or "+o)}function Fhe(e){let t=`�Ethereum Signed Message:
70${e.length}`,r=new TextEncoder().encode(t+e);return"0x"+Buffer.from(TMe(r)).toString("hex")}async function FMe(e,t,r,n,o,s){switch(r.t){case"eip191":return await VMe(e,t,r.s);case"eip1271":return await zMe(e,t,r.s,n,o,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function VMe(e,t,r){let n=o_.fromHex(r);return s_.recoverAddress({payload:Fhe(t),signature:n}).toLowerCase()===e.toLowerCase()}async function zMe(e,t,r,n,o,s){let i=rl(n);if(!i.namespace||!i.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{let a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=r.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),d=(t.startsWith("0x")?t:Fhe(t)).substring(2),p=a+d+c+u+l,f=await fetch(`${s||$Me}/?chainId=${n}&projectId=${o}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:jMe(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:p},"latest"]})}),{result:m}=await f.json();return m?m.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function jMe(){return Date.now()+Math.floor(Math.random()*1e3)}function Vhe(e){let t=atob(e),r=new Uint8Array(t.length);for(let i=0;i<t.length;i++)r[i]=t.charCodeAt(i);let n=r[0];if(n===0)throw new Error("No signatures found");let o=1+n*64;if(r.length<o)throw new Error("Transaction data too short for claimed signature count");if(r.length<100)throw new Error("Transaction too short");let s=Buffer.from(e,"base64").slice(1,65);return Na.encode(s)}function zhe(e){let t=new Uint8Array(Buffer.from(e,"base64")),r=Array.from("TransactionData::").map(s=>s.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);let o=HMe(n,{dkLen:32});return Na.encode(o)}function h$(e){let t=new Uint8Array(C_(qMe(e)));return Na.encode(t)}function qMe(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="object"&&e!=null&&e.data)return new Uint8Array(Object.values(e.data));if(typeof e=="object"&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function m$(e){let t=Buffer.from(e,"base64"),r=Ex(t).txn;if(!r)throw new Error("Invalid signed transaction: missing 'txn' field");let n=wx(r),o=Buffer.from("TX"),s=Buffer.concat([o,Buffer.from(n)]),i=UMe(s);return LE.encode(i).replace(/=+$/,"")}function PH(e){let t=[],r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),Buffer.from(t)}function jhe(e){let t=Buffer.from(e.signed.bodyBytes,"base64"),r=Buffer.from(e.signed.authInfoBytes,"base64"),n=Buffer.from(e.signature.signature,"base64"),o=[];o.push(Buffer.from([10])),o.push(PH(t.length)),o.push(t),o.push(Buffer.from([18])),o.push(PH(r.length)),o.push(r),o.push(Buffer.from([26])),o.push(PH(n.length)),o.push(n);let s=Buffer.concat(o),i=C_(s);return Buffer.from(i).toString("hex").toUpperCase()}function qhe(e){var t,r;let n=[];try{if(typeof e=="string")return n.push(e),n;if(typeof e!="object")return n;e!=null&&e.id&&n.push(e.id);let o=(r=(t=e?.capabilities)==null?void 0:t.caip345)==null?void 0:r.transactionHashes;o&&n.push(...o)}catch(o){console.warn("getWalletSendCallsHashes failed: ",o)}return n}async function g$(e){let{cacao:t,projectId:r}=e,{s:n,p:o}=t,s=y$(o,o.iss),i=N3(o.iss);return await FMe(i,s,n,I_(o.iss),r)}function nHe(e){return Buffer.from(JSON.stringify(e)).toString("base64")}function oHe(e){return JSON.parse(Buffer.from(e,"base64").toString("utf-8"))}function Dg(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");let t=Object.keys(e.att);if(!(t!=null&&t.length))throw new Error("No resources found in `att` property");t.forEach(r=>{let n=e.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(o=>{let s=n[o];if(!Array.isArray(s))throw new Error(`Ability limits ${o} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${o} is empty array, must be an array with objects`);s.forEach(i=>{if(typeof i!="object")throw new Error(`Ability limits (${o}) must be an array of objects, found: ${i}`)})})})}function sHe(e,t,r,n={}){return r?.sort((o,s)=>o.localeCompare(s)),{att:{[e]:iHe(t,r,n)}}}function iHe(e,t,r={}){t=t?.sort((o,s)=>o.localeCompare(s));let n=t.map(o=>({[`${e}/${o}`]:[r]}));return Object.assign({},...n)}function Khe(e){return Dg(e),`urn:recap:${nHe(e).replace(/=/g,"")}`}function S3(e){let t=oHe(e.replace("urn:recap:",""));return Dg(t),t}function Zhe(e,t,r){let n=sHe(e,t,r);return Khe(n)}function aHe(e){return e&&e.includes("urn:recap:")}function Ghe(e,t){let r=S3(e),n=S3(t),o=cHe(r,n);return Khe(o)}function cHe(e,t){Dg(e),Dg(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((o,s)=>o.localeCompare(s)),n={att:{}};return r.forEach(o=>{var s,i;Object.keys(((s=e.att)==null?void 0:s[o])||{}).concat(Object.keys(((i=t.att)==null?void 0:i[o])||{})).sort((a,c)=>a.localeCompare(c)).forEach(a=>{var c,l;n.att[o]=QMe(JMe({},n.att[o]),{[a]:((c=e.att[o])==null?void 0:c[a])||((l=t.att[o])==null?void 0:l[a])})})}),n}function lHe(e="",t){Dg(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let n=[],o=0;Object.keys(t.att).forEach(a=>{let c=Object.keys(t.att[a]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,p)=>d.action.localeCompare(p.action));let l={};c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});let u=Object.keys(l).map(d=>(o++,`(${o}) '${d}': '${l[d].join("', '")}' for '${a}'.`));n.push(u.join(", ").replace(".,","."))});let s=n.join(" "),i=`${r}${s}`;return`${e?e+" ":""}${i}`}function w$(e){var t;let r=S3(e);Dg(r);let n=(t=r.att)==null?void 0:t.eip155;return n?Object.keys(n).map(o=>o.split("/")[1]):[]}function b$(e){let t=S3(e);Dg(t);let r=[];return Object.values(t.att).forEach(n=>{Object.values(n).forEach(o=>{var s;(s=o?.[0])!=null&&s.chains&&r.push(o[0].chains)})}),[...new Set(r.flat())]}function R3(e){if(!e)return;let t=e?.[e.length-1];return aHe(t)?t:void 0}function Yhe(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function KH(e){if(typeof e!="boolean")throw new Error(`boolean expected, not ${e}`)}function NH(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Pi(e,...t){if(!Yhe(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Kfe(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function uHe(e,t){Pi(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function rm(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function s6(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function dHe(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function fHe(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function ZH(e){if(typeof e=="string")e=fHe(e);else if(Yhe(e))e=GH(e);else throw new Error("Uint8Array expected, got "+typeof e);return e}function hHe(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function mHe(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}function Zfe(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(t.length!==e)throw new Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!wHe(t))throw new Error("invalid output, must be aligned");return t}function Gfe(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function yHe(e,t,r){KH(r);let n=new Uint8Array(16),o=dHe(n);return Gfe(o,0,BigInt(t),r),Gfe(o,8,BigInt(e),r),n}function wHe(e){return e.byteOffset%4===0}function GH(e){return Uint8Array.from(e)}function Xt(e,t){return e<<t|e>>>32-t}function YH(e){return e.byteOffset%4===0}function CHe(e,t,r,n,o,s,i,a){let c=o.length,l=new Uint8Array(a_),u=rm(l),d=YH(o)&&YH(s),p=d?rm(o):Yfe,f=d?rm(s):Yfe;for(let m=0;m<c;i++){if(e(t,r,n,u,i,a),i>=Qhe)throw new Error("arx: counter overflow");let g=Math.min(a_,c-m);if(d&&g===a_){let y=m/4;if(m%4!==0)throw new Error("arx: invalid block position");for(let b=0,C;b<AHe;b++)C=y+b,f[C]=p[C]^u[b];m+=a_;continue}for(let y=0,b;y<g;y++)b=m+y,s[b]=o[b]^l[y];m+=g}}function SHe(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:s,rounds:i}=hHe({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return NH(o),NH(i),KH(s),KH(r),(a,c,l,u,d=0)=>{Pi(a),Pi(c),Pi(l);let p=l.length;if(u===void 0&&(u=new Uint8Array(p)),Pi(u),NH(d),d<0||d>=Qhe)throw new Error("arx: counter overflow");if(u.length<p)throw new Error(`arx: output (${u.length}) is shorter than data (${p})`);let f=[],m=a.length,g,y;if(m===32)f.push(g=GH(a)),y=EHe;else if(m===16&&r)g=new Uint8Array(32),g.set(a),g.set(a,16),y=vHe,f.push(g);else throw new Error(`arx: invalid 32-byte key, got length=${m}`);YH(c)||f.push(c=GH(c));let b=rm(g);if(n){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(y,b,rm(c.subarray(0,16)),b),c=c.subarray(16)}let C=16-o;if(C!==c.length)throw new Error(`arx: nonce must be ${C} or 16 bytes`);if(C!==12){let x=new Uint8Array(12);x.set(c,s?0:12-c.length),c=x,f.push(c)}let w=rm(c);return CHe(e,y,b,w,l,u,d,i),s6(...f),u}}function IHe(e){let t=(n,o)=>e(o).update(ZH(n)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function _He(e,t,r,n,o,s=20){let i=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],y=t[6],b=t[7],C=o,w=r[0],x=r[1],S=r[2],P=i,D=a,U=c,N=l,L=u,I=d,R=p,A=f,T=m,v=g,E=y,O=b,B=C,_=w,M=x,F=S;for(let oe=0;oe<s;oe+=2)P=P+L|0,B=Xt(B^P,16),T=T+B|0,L=Xt(L^T,12),P=P+L|0,B=Xt(B^P,8),T=T+B|0,L=Xt(L^T,7),D=D+I|0,_=Xt(_^D,16),v=v+_|0,I=Xt(I^v,12),D=D+I|0,_=Xt(_^D,8),v=v+_|0,I=Xt(I^v,7),U=U+R|0,M=Xt(M^U,16),E=E+M|0,R=Xt(R^E,12),U=U+R|0,M=Xt(M^U,8),E=E+M|0,R=Xt(R^E,7),N=N+A|0,F=Xt(F^N,16),O=O+F|0,A=Xt(A^O,12),N=N+A|0,F=Xt(F^N,8),O=O+F|0,A=Xt(A^O,7),P=P+I|0,F=Xt(F^P,16),E=E+F|0,I=Xt(I^E,12),P=P+I|0,F=Xt(F^P,8),E=E+F|0,I=Xt(I^E,7),D=D+R|0,B=Xt(B^D,16),O=O+B|0,R=Xt(R^O,12),D=D+R|0,B=Xt(B^D,8),O=O+B|0,R=Xt(R^O,7),U=U+A|0,_=Xt(_^U,16),T=T+_|0,A=Xt(A^T,12),U=U+A|0,_=Xt(_^U,8),T=T+_|0,A=Xt(A^T,7),N=N+L|0,M=Xt(M^N,16),v=v+M|0,L=Xt(L^v,12),N=N+L|0,M=Xt(M^N,8),v=v+M|0,L=Xt(L^v,7);let q=0;n[q++]=i+P|0,n[q++]=a+D|0,n[q++]=c+U|0,n[q++]=l+N|0,n[q++]=u+L|0,n[q++]=d+I|0,n[q++]=p+R|0,n[q++]=f+A|0,n[q++]=m+T|0,n[q++]=g+v|0,n[q++]=y+E|0,n[q++]=b+O|0,n[q++]=C+B|0,n[q++]=w+_|0,n[q++]=x+M|0,n[q++]=S+F|0}function Qfe(e,t,r,n,o){let s=e(t,r,RHe),i=THe.create(s);o&&Jfe(i,o),Jfe(i,n);let a=yHe(n.length,o?o.length:0,!0);i.update(a);let c=i.digest();return s6(s,a),c}function BHe(e,t,r){return A_(e),r===void 0&&(r=new Uint8Array(e.outputLen)),T_(e,Xc(r),Xc(t))}function kHe(e,t,r,n=32){A_(e),tf(n);let o=e.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");let s=Math.ceil(n/o);r===void 0&&(r=Xfe);let i=new Uint8Array(s*o),a=T_.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;u<s;u++)RH[0]=u+1,c.update(u===0?Xfe:l).update(r).update(RH).digestInto(l),i.set(l,o*u),a._cloneInto(c);return a.destroy(),c.destroy(),sc(l,RH),i.slice(0,n)}function m_(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}"`;throw new Error(r+"expected boolean, got type="+typeof e)}return e}function Og(e,t,r=""){let n=E_(e),o=e?.length,s=t!==void 0;if(!n||s&&o!==t){let i=r&&`"${r}" `,a=s?` of length ${t}`:"",c=n?`length=${o}`:`type=${typeof e}`;throw new Error(i+"expected Uint8Array"+a+", got "+c)}return e}function c_(e){let t=e.toString(16);return t.length&1?"0"+t:t}function e0e(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?x$:BigInt("0x"+e)}function P_(e){return e0e(r6(e))}function g_(e){return tl(e),e0e(r6(Uint8Array.from(e).reverse()))}function v$(e,t){return p_(e.toString(16).padStart(t*2,"0"))}function E$(e,t){return v$(e,t).reverse()}function hs(e,t,r){let n;if(typeof t=="string")try{n=p_(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(E_(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function UHe(e,t,r){return OH(e)&&OH(t)&&OH(r)&&t<=e&&e<r}function XH(e,t,r,n){if(!UHe(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function t0e(e){let t;for(t=0;e>x$;e>>=QH,t+=1);return t}function LHe(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=p=>new Uint8Array(p),o=p=>
vendor: 4,561 bytes, line 70
70Uint8Array.of(p),s=n(e),i=n(e),a=0,c=()=>{s.fill(1),i.fill(0),a=0},l=(...p)=>r(i,s,...p),u=(p=n(0))=>{i=l(o(0),p),s=l(),p.length!==0&&(i=l(o(1),p),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let p=0,f=[];for(;p<t;){s=l();let m=s.slice();f.push(m),p+=s.length}return tm(...f)};return(p,f)=>{c(),u(p);let m;for(;!(m=f(d()));)u();return c(),m}}function N_(e,t,r={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function n(o,s,i){let a=e[o];if(i&&a===void 0)return;let c=typeof a;if(c!==s||a===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${c}`)}Object.entries(t).forEach(([o,s])=>n(o,s,!1)),Object.entries(r).forEach(([o,s])=>n(o,s,!0))}function ehe(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}function ba(e,t){let r=e%t;return r>=Ri?r:t+r}function Yc(e,t,r){let n=e;for(;t-- >Ri;)n*=n,n%=r;return n}function the(e,t){if(e===Ri)throw new Error("invert: expected non-zero number");if(t<=Ri)throw new Error("invert: expected positive modulus, got "+t);let r=ba(e,t),n=t,o=Ri,s=ti;for(;r!==Ri;){let i=n/r,a=n%r,c=o-s*i;n=r,r=a,o=s,s=c}if(n!==ti)throw new Error("invert: does not exist");return ba(o,t)}function A$(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function a0e(e,t){let r=(e.ORDER+ti)/n0e,n=e.pow(t,r);return A$(e,n,t),n}function $He(e,t){let r=(e.ORDER-o0e)/s0e,n=e.mul(t,Bg),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,Bg),o),a=e.mul(s,e.sub(i,e.ONE));return A$(e,a,t),a}function FHe(e){let t=im(e),r=c0e(e),n=r(t,t.neg(t.ONE)),o=r(t,n),s=r(t,t.neg(n)),i=(e+MHe)/i0e;return(a,c)=>{let l=a.pow(c,i),u=a.mul(l,n),d=a.mul(l,o),p=a.mul(l,s),f=a.eql(a.sqr(u),c),m=a.eql(a.sqr(d),c);l=a.cmov(l,u,f),u=a.cmov(p,d,m);let g=a.eql(a.sqr(u),c),y=a.cmov(l,u,g);return A$(a,y,c),y}}function c0e(e){if(e<r0e)throw new Error("sqrt is not defined for small field");let t=e-ti,r=0;for(;t%Bg===Ri;)t/=Bg,r++;let n=Bg,o=im(e);for(;rhe(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return a0e;let s=o.pow(n,t),i=(t+ti)/Bg;return function(a,c){if(a.is0(c))return c;if(rhe(a,c)!==1)throw new Error("Cannot find square root");let l=r,u=a.mul(a.ONE,s),d=a.pow(c,t),p=a.pow(c,i);for(;!a.eql(d,a.ONE);){if(a.is0(d))return a.ZERO;let f=1,m=a.sqr(d);for(;!a.eql(m,a.ONE);)if(f++,m=a.sqr(m),f===l)throw new Error("Cannot find square root");let g=ti<<BigInt(l-f-1),y=a.pow(u,g);l=f,u=a.sqr(y),d=a.mul(d,u),p=a.mul(p,y)}return p}}function VHe(e){return e%n0e===r0e?a0e:e%s0e===o0e?$He:e%i0e===HHe?FHe(e):c0e(e)}function jHe(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=zHe.reduce((n,o)=>(n[o]="function",n),t);return N_(e,r),e}function qHe(e,t,r){if(r<Ri)throw new Error("invalid exponent, negatives unsupported");if(r===Ri)return e.ONE;if(r===ti)return t;let n=e.ONE,o=t;for(;r>Ri;)r&ti&&(n=e.mul(n,o)),o=e.sqr(o),r>>=ti;return n}function l0e(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(n[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(n[c]=e.mul(i,n[c]),e.mul(i,a)),s),n}function rhe(e,t){let r=(e.ORDER-ti)/Bg,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function u0e(e,t){t!==void 0&&tf(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function im(e,t,r=!1,n={}){if(e<=Ri)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s,i=!1,a;if(typeof t=="object"&&t!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");let p=t;p.BITS&&(o=p.BITS),p.sqrt&&(s=p.sqrt),typeof p.isLE=="boolean"&&(r=p.isLE),typeof p.modFromBytes=="boolean"&&(i=p.modFromBytes),a=p.allowedLengths}else typeof t=="number"&&(o=t),n.sqrt&&(s=n.sqrt);let{nBitLength:c,nByteLength:l}=u0e(e,o);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u,d=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:l,MASK:O3(c),ZERO:Ri,ONE:ti,allowedLengths:a,create:p=>ba(p,e),isValid:p=>{if(typeof p!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof p);return Ri<=p&&p<e},is0:p=>p===Ri,isValidNot0:p=>!d.is0(p)&&d.isValid(p),isOdd:p=>(p&ti)===ti,neg:p=>ba(-p,e),eql:(p,f)=>p===f,sqr:p=>ba(p*p,e),add:(p,f)=>ba(p+f,e),sub:(p,f)=>ba(p-f,e),mul:(p,f)=>ba(p*f,e),pow:(p,f)=>qHe(d,p,f),div:(p,f)=>ba(p*the(f,e),e),sqrN:p=>p*p,addN:(p,f)=>p+f,subN:(p,f)=>p-f,mulN:(p,f)=>
vendor: 4,376 bytes, line 70
70p*f,inv:p=>the(p,e),sqrt:s||(p=>(u||(u=VHe(e)),u(d,p))),toBytes:p=>r?E$(p,l):v$(p,l),fromBytes:(p,f=!0)=>{if(a){if(!a.includes(p.length)||p.length>l)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+p.length);let g=new Uint8Array(l);g.set(p,r?0:g.length-p.length),p=g}if(p.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+p.length);let m=r?g_(p):P_(p);if(i&&(m=ba(m,e)),!f&&!d.isValid(m))throw new Error("invalid field element: outside of range 0..ORDER");return m},invertBatch:p=>l0e(d,p),cmov:(p,f,m)=>m?f:p});return Object.freeze(d)}function d0e(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function p0e(e){let t=d0e(e);return t+Math.ceil(t/2)}function WHe(e,t,r=!1){let n=e.length,o=d0e(t),s=p0e(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);let i=r?g_(e):P_(e),a=ba(i,t-ti)+ti;return r?E$(a,o):v$(a,o)}function y_(e,t){let r=t.negate();return e?r:t}function BH(e,t){let r=l0e(e.Fp,t.map(n=>n.Z));return t.map((n,o)=>e.fromAffine(n.toAffine(r[o])))}function f0e(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function kH(e,t){f0e(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,s=O3(e),i=BigInt(e);return{windows:r,windowSize:n,mask:s,maxNumber:o,shiftBy:i}}function nhe(e,t,r){let{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r,a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=kg);let l=t*n,u=l+Math.abs(a)-1,d=a===0,p=a<0,f=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:l}}function KHe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function ZHe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}function UH(e){return h0e.get(e)||1}function ohe(e){if(e!==i6)throw new Error("invalid wNAF")}function GHe(e,t,r,n){let o=t,s=e.ZERO,i=e.ZERO;for(;r>i6||n>i6;)r&kg&&(s=s.add(o)),n&kg&&(i=i.add(o)),o=o.double(),r>>=kg,n>>=kg;return{p1:s,p2:i}}function YHe(e,t,r,n){KHe(r,e),ZHe(n,t);let o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");let i=e.ZERO,a=t0e(BigInt(o)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=O3(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c,p=i;for(let f=d;f>=0;f-=c){u.fill(i);for(let g=0;g<s;g++){let y=n[g],b=Number(y>>BigInt(f)&l);u[b]=u[b].add(r[g])}let m=i;for(let g=u.length-1,y=i;g>0;g--)y=y.add(u[g]),m=m.add(y);if(p=p.add(m),f!==0)for(let g=0;g<c;g++)p=p.double()}return p}function she(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return jHe(t),t}else return im(e,{isLE:r})}function JHe(e,t,r={},n){if(n===void 0&&(n=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let a of["p","n","h"]){let c=t[a];if(!(typeof c=="bigint"&&c>i6))throw new Error(`CURVE.${a} must be positive bigint`)}let o=she(t.p,r.Fp,n),s=she(t.n,r.Fn,n),i=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let a of i)if(!o.isValid(t[a]))throw new Error(`CURVE.${a} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:s}}function QHe(e){return N_(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function XHe(e){let t=QHe(e),{P:r,type:n,adjustScalarBytes:o,powPminus2:s,randomBytes:i}=t,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let c=i||Lg,l=a?255:448,u=a?32:56,d=BigInt(a?9:5),p=BigInt(a?121665:39081),f=a?l_**BigInt(254):l_**BigInt(447),m=a?BigInt(8)*l_**BigInt(251)-e6:BigInt(4)*l_**BigInt(445)-e6,g=f+m+e6,y=R=>ba(R,r),b=C(d);function C(R){return E$(y(R),u)}function w(R){let A=hs("u coordinate",R,u);return a&&(A[31]&=127),y(g_(A))}function x(R){return g_(o(hs("scalar",R,u)))}function S(R,A){let T=U(w(A),x(R));if(T===b3)throw new Error("invalid private or public key received");return C(T)}function P(R){return S(R,b)}function D(R,A,T){let v=y(R*(A-T));return A=y(A-v),T=y(T+v),{x_2:A,x_3:T}}function U(R,A){XH("u",R,b3,r),XH("scalar",A,f,g);let T=A,v=R,E=e6,O=b3,B=R,_=e6,M=b3;for(let q=BigInt(l-1);q>=b3;q--){let oe=T>>q&e6;M^=oe,{x_2:E,x_3:B}=D(M,E,B),{x_2:O,x_3:_}=D(M,O,_),M=oe;
70let Q=E+O,Y=y(Q*Q),pe=E-O,he=y(pe*pe),Te=Y-he,me=B+_,_e=B-_,wt=y(_e*Q),Nt=y(me*pe),bt=wt+Nt,ar=wt-Nt;B=y(bt*bt),_=y(v*y(ar*ar)),E=y(Y*he),O=y(Te*(Y+y(p*Te)))}({x_2:E,x_3:B}=D(M,E,B)),{x_2:O,x_3:_}=D(M,O,_);let F=s(O);return y(E*F)}let N={secretKey:u,publicKey:u,seed:u},L=(R=c(u))=>(tl(R,N.seed),R);function I(R){let A=L(R);return{secretKey:A,publicKey:P(A)}}return{keygen:I,getSharedSecret:(R,A)=>S(R,A),getPublicKey:R=>P(R),scalarMult:S,scalarMultBase:P,utils:{randomSecretKey:L,randomPrivateKey:L},GuBytes:b.slice(),lengths:N}}function s$e(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=m0e,i=e*e%s*e%s,a=Yc(i,ihe,s)*i%s,c=Yc(a,e$e,s)*e%s,l=Yc(c,r$e,s)*c%s,u=Yc(l,t,s)*l%s,d=Yc(u,r,s)*u%s,p=Yc(d,n,s)*d%s,f=Yc(p,o,s)*p%s,m=Yc(f,o,s)*p%s,g=Yc(m,t,s)*l%s;return{pow_p_5_8:Yc(g,ihe,s)*e%s,b2:i}}function i$e(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function c$e(e,t,r){let[[n,o],[s,i]]=t,a=ahe(i*e,r),c=ahe(-o*e,r),l=e-a*n-c*s,u=-a*o-c*i,d=l<Xp,p=u<Xp;d&&(l=-l),p&&(u=-u);let f=O3(Math.ceil(t0e(r)/2))+n6;if(l<Xp||l>=f||u<Xp||u>=f)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:l,k2neg:p,k2:u}}function r$(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function LH(e,t){let r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];return m_(r.lowS,"lowS"),m_(r.prehash,"prehash"),r.format!==void 0&&r$(r.format),r}function t6(e,t){let{BYTES:r}=e,n;if(typeof t=="bigint")n=t;else{let o=hs("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function u$e(e,t={}){let r=JHe("weierstrass",e,t),{Fp:n,Fn:o}=r,s=r.CURVE,{h:i,n:a}=s;N_(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:c}=t;if(c&&(!n.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let l=w0e(n,o);function u(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(R,A,T){let{x:v,y:E}=A.toAffine(),O=n.toBytes(v);if(m_(T,"isCompressed"),T){u();let B=!n.isOdd(E);return tm(y0e(B),O)}else return tm(Uint8Array.of(4),O,n.toBytes(E))}function p(R){Og(R,void 0,"Point");let{publicKey:A,publicKeyUncompressed:T}=l,v=R.length,E=R[0],O=R.subarray(1);if(v===A&&(E===2||E===3)){let B=n.fromBytes(O);if(!n.isValid(B))throw new Error("bad point: is not on curve, wrong x");let _=g(B),M;try{M=n.sqrt(_)}catch(q){let oe=q instanceof Error?": "+q.message:"";throw new Error("bad point: is not on curve, sqrt error"+oe)}u();let F=n.isOdd(M);return(E&1)===1!==F&&(M=n.neg(M)),{x:B,y:M}}else if(v===T&&E===4){let B=n.BYTES,_=n.fromBytes(O.subarray(0,B)),M=n.fromBytes(O.subarray(B,B*2));if(!y(_,M))throw new Error("bad point: is not on curve");return{x:_,y:M}}else throw new Error(`bad point: got length ${v}, expected compressed=${A} or uncompressed=${T}`)}let f=t.toBytes||d,m=t.fromBytes||p;
vendor: 9,021 bytes, line 70
70function g(R){let A=n.sqr(R),T=n.mul(A,R);return n.add(n.add(T,n.mul(R,s.a)),s.b)}function y(R,A){let T=n.sqr(A),v=g(R);return n.eql(T,v)}if(!y(s.Gx,s.Gy))throw new Error("bad curve params: generator point");let b=n.mul(n.pow(s.a,u_),l$e),C=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(b,C)))throw new Error("bad curve params: a or b");function w(R,A,T=!1){if(!n.isValid(A)||T&&n.is0(A))throw new Error(`bad point coordinate ${R}`);return A}function x(R){if(!(R instanceof N))throw new Error("ProjectivePoint expected")}function S(R){if(!c||!c.basises)throw new Error("no endo");return c$e(R,c.basises,o.ORDER)}let P=ehe((R,A)=>{let{X:T,Y:v,Z:E}=R;if(n.eql(E,n.ONE))return{x:T,y:v};let O=R.is0();A==null&&(A=O?n.ONE:n.inv(E));let B=n.mul(T,A),_=n.mul(v,A),M=n.mul(E,A);if(O)return{x:n.ZERO,y:n.ZERO};if(!n.eql(M,n.ONE))throw new Error("invZ was invalid");return{x:B,y:_}}),D=ehe(R=>{if(R.is0()){if(t.allowInfinityPoint&&!n.is0(R.Y))return;throw new Error("bad point: ZERO")}let{x:A,y:T}=R.toAffine();if(!n.isValid(A)||!n.isValid(T))throw new Error("bad point: x or y not field elements");if(!y(A,T))throw new Error("bad point: equation left != right");if(!R.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function U(R,A,T,v,E){return T=new N(n.mul(T.X,R),T.Y,T.Z),A=y_(v,A),T=y_(E,T),A.add(T)}class N{constructor(A,T,v){this.X=w("x",A),this.Y=w("y",T,!0),this.Z=w("z",v),Object.freeze(this)}static CURVE(){return s}static fromAffine(A){let{x:T,y:v}=A||{};if(!A||!n.isValid(T)||!n.isValid(v))throw new Error("invalid affine point");if(A instanceof N)throw new Error("projective point not allowed");return n.is0(T)&&n.is0(v)?N.ZERO:new N(T,v,n.ONE)}static fromBytes(A){let T=N.fromAffine(m(Og(A,void 0,"point")));return T.assertValidity(),T}static fromHex(A){return N.fromBytes(hs("pointHex",A))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(A=8,T=!0){return I.createCache(this,A),T||this.multiply(u_),this}assertValidity(){D(this)}hasEvenY(){let{y:A}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(A)}equals(A){x(A);let{X:T,Y:v,Z:E}=this,{X:O,Y:B,Z:_}=A,M=n.eql(n.mul(T,_),n.mul(O,E)),F=n.eql(n.mul(v,_),n.mul(B,E));return M&&F}negate(){return new N(this.X,n.neg(this.Y),this.Z)}double(){let{a:A,b:T}=s,v=n.mul(T,u_),{X:E,Y:O,Z:B}=this,_=n.ZERO,M=n.ZERO,F=n.ZERO,q=n.mul(E,E),oe=n.mul(O,O),Q=n.mul(B,B),Y=n.mul(E,O);return Y=n.add(Y,Y),F=n.mul(E,B),F=n.add(F,F),_=n.mul(A,F),M=n.mul(v,Q),M=n.add(_,M),_=n.sub(oe,M),M=n.add(oe,M),M=n.mul(_,M),_=n.mul(Y,_),F=n.mul(v,F),Q=n.mul(A,Q),Y=n.sub(q,Q),Y=n.mul(A,Y),Y=n.add(Y,F),F=n.add(q,q),q=n.add(F,q),q=n.add(q,Q),q=n.mul(q,Y),M=n.add(M,q),Q=n.mul(O,B),Q=n.add(Q,Q),q=n.mul(Q,Y),_=n.sub(_,q),F=n.mul(Q,oe),F=n.add(F,F),F=n.add(F,F),new N(_,M,F)}add(A){x(A);let{X:T,Y:v,Z:E}=this,{X:O,Y:B,Z:_}=A,M=n.ZERO,F=n.ZERO,q=n.ZERO,oe=s.a,Q=n.mul(s.b,u_),Y=n.mul(T,O),pe=n.mul(v,B),he=n.mul(E,_),Te=n.add(T,v),me=n.add(O,B);Te=n.mul(Te,me),me=n.add(Y,pe),Te=n.sub(Te,me),me=n.add(T,E);let _e=n.add(O,_);return me=n.mul(me,_e),_e=n.add(Y,he),me=n.sub(me,_e),_e=n.add(v,E),M=n.add(B,_),_e=n.mul(_e,M),M=n.add(pe,he),_e=n.sub(_e,M),q=n.mul(oe,me),M=n.mul(Q,he),q=n.add(M,q),M=n.sub(pe,q),q=n.add(pe,q),F=n.mul(M,q),pe=n.add(Y,Y),pe=n.add(pe,Y),he=n.mul(oe,he),me=n.mul(Q,me),pe=n.add(pe,he),he=n.sub(Y,he),he=n.mul(oe,he),me=n.add(me,he),Y=n.mul(pe,me),F=n.add(F,Y),Y=n.mul(_e,me),M=n.mul(Te,M),M=n.sub(M,Y),Y=n.mul(Te,pe),q=n.mul(_e,q),q=n.add(q,Y),new N(M,F,q)}subtract(A){return this.add(A.negate())}is0(){return this.equals(N.ZERO)}multiply(A){let{endo:T}=t;if(!o.isValidNot0(A))throw new Error("invalid scalar: out of range");let v,E,O=B=>I.cached(this,B,_=>BH(N,_));if(T){let{k1neg:B,k1:_,k2neg:M,k2:F}=S(A),{p:q,f:oe}=O(_),{p:Q,f:Y}=O(F);E=oe.add(Y),v=U(T.beta,q,Q,B,M)}else{let{p:B,f:_}=O(A);v=B,E=_}return BH(N,[v,E])[0]}multiplyUnsafe(A){let{endo:T}=t,v=this;if(!o.isValid(A))throw new Error("invalid scalar: out of range");if(A===Xp||v.is0())return N.ZERO;if(A===n6)return v;if(I.hasCache(this))return this.multiply(A);if(T){let{k1neg:E,k1:O,k2neg:B,k2:_}=S(A),{p1:M,p2:F}=GHe(N,v,O,_);return U(T.beta,M,F,E,B)}else return I.unsafe(v,A)}multiplyAndAddUnsafe(A,T,v){let E=this.multiplyUnsafe(T).add(A.multiplyUnsafe(v));return E.is0()?void 0:E}toAffine(A){return P(this,A)}isTorsionFree(){let{isTorsionFree:A}=t;return i===n6?!0:A?A(N,this):I.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:A}=t;return i===n6?this:A?A(N,this):this.multiplyUnsafe(i)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}toBytes(A=!0){return m_(A,"isCompressed"),this.assertValidity(),f(N,this,A)}toHex(A=!0){return r6(this.toBytes(A))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(A=!0){return this.toBytes(A)}_setWindowSize(A){this.precompute(A)}static normalizeZ(A){return BH(N,A)}static msm(A,T){return YHe(N,o,A,T)}static fromPrivateKey(A){return N.BASE.multiply(t6(o,A))}}N.BASE=new N(s.Gx,s.Gy,n.ONE),N.ZERO=new N(n.ZERO,n.ONE,n.ZERO),N.Fp=n,N.Fn=o;let L=o.BITS,I=new e$(N,t.endo?Math.ceil(L/2):L);return N.BASE.precompute(8),N}function y0e(e){return Uint8Array.of(e?2:3)}function w0e(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function d$e(e,t={}){let{Fn:r}=e,n=t.randomBytes||Lg,o=Object.assign(w0e(e.Fp,r),{seed:p0e(r.ORDER)});function s(p){try{return!!t6(r,p)}catch{return!1}}function i(p,f){let{publicKey:m,publicKeyUncompressed:g}=o;try{let y=p.length;return f===!0&&y!==m||f===!1&&y!==g?!1:!!e.fromBytes(p)}catch{return!1}}function a(p=n(o.seed)){return WHe(Og(p,o.seed,"seed"),r.ORDER)}function c(p,f=!0){return e.BASE.multiply(t6(r,p)).toBytes(f)}function l(p){let f=a(p);return{secretKey:f,publicKey:c(f)}}function u(p){if(typeof p=="bigint")return!1;if(p instanceof e)return!0;let{secretKey:f,publicKey:m,publicKeyUncompressed:g}=o;if(r.allowedLengths||f===m)return;let y=hs("key",p).length;return y===m||y===g}function d(p,f,m=!0){if(u(p)===!0)throw new Error("first arg must be private key");if(u(f)===!1)throw new Error("second arg must be public key");let g=t6(r,p);return e.fromHex(f).multiply(g).toBytes(m)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:{isValidSecretKey:s,isValidPublicKey:i,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:p=>t6(r,p),precompute(p=8,f=e.BASE){return f.precompute(p,!1)}},lengths:o})}function p$e(e,t,r={}){A_(t),N_(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||Lg,o=r.hmac||((T,...v)=>T_(t,T,tm(...v))),{Fp:s,Fn:i}=e,{ORDER:a,BITS:c}=i,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:p,lengths:f}=d$e(e,r),m={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},g="compact";function y(T){let v=a>>n6;return T>v}function b(T,v){if(!i.isValidNot0(v))throw new Error(`invalid signature ${T}: out of range 1..Point.Fn.ORDER`);return v}function C(T,v){r$(v);let E=f.signature,O=v==="compact"?E:v==="recovered"?E+1:void 0;return Og(T,O,`${v} signature`)}class w{constructor(v,E,O){this.r=b("r",v),this.s=b("s",E),O!=null&&(this.recovery=O),Object.freeze(this)}static fromBytes(v,E=g){C(v,E);let O;if(E==="der"){let{r:F,s:q}=Qp.toSig(Og(v));return new w(F,q)}E==="recovered"&&(O=v[0],E="compact",v=v.subarray(1));let B=i.BYTES,_=v.subarray(0,B),M=v.subarray(B,B*2);return new w(i.fromBytes(_),i.fromBytes(M),O)}static fromHex(v,E){return this.fromBytes(p_(v),E)}addRecoveryBit(v){return new w(this.r,this.s,v)}recoverPublicKey(v){let E=s.ORDER,{r:O,s:B,recovery:_}=this;if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");if(a*g0e<E&&_>1)throw new Error("recovery id is ambiguous for h>1 curve");let M=_===2||_===3?O+a:O;if(!s.isValid(M))throw new Error("recovery id 2 or 3 invalid");let F=s.toBytes(M),q=e.fromBytes(tm(y0e((_&1)===0),F)),oe=i.inv(M),Q=S(hs("msgHash",v)),Y=i.create(-Q*oe),pe=i.create(B*oe),he=e.BASE.multiplyUnsafe(Y).add(q.multiplyUnsafe(pe));if(he.is0())throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return y(this.s)}toBytes(v=g){if(r$(v),v==="der")return p_(Qp.hexFromSig(this));let E=i.toBytes(this.r),O=i.toBytes(this.s);if(v==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return tm(Uint8Array.of(this.recovery),E,O)}return tm(E,O)}toHex(v){return r6(this.toBytes(v))}assertValidity(){}static fromCompact(v){return w.fromBytes(hs("sig",v),"compact")}static fromDER(v){return w.fromBytes(hs("sig",v),"der")}normalizeS(){return this.hasHighS()?new w(this.r,i.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return r6(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return r6(this.toBytes("compact"))}}let x=r.bits2int||function(T){if(T.length>8192)throw new Error("input is too large");
70let v=P_(T),E=T.length*8-c;return E>0?v>>BigInt(E):v},S=r.bits2int_modN||function(T){return i.create(x(T))},P=O3(c);function D(T){return XH("num < 2^"+c,T,Xp,P),i.toBytes(T)}function U(T,v){return Og(T,void 0,"message"),v?Og(t(T),void 0,"prehashed message"):T}function N(T,v,E){if(["recovered","canonical"].some(pe=>pe in E))throw new Error("sign() legacy options not supported");let{lowS:O,prehash:B,extraEntropy:_}=LH(E,m);T=U(T,B);let M=S(T),F=t6(i,v),q=[D(F),D(M)];if(_!=null&&_!==!1){let pe=_===!0?n(f.secretKey):_;q.push(hs("extraEntropy",pe))}let oe=tm(...q),Q=M;function Y(pe){let he=x(pe);if(!i.isValidNot0(he))return;let Te=i.inv(he),me=e.BASE.multiply(he).toAffine(),_e=i.create(me.x);if(_e===Xp)return;let wt=i.create(Te*i.create(Q+_e*F));if(wt===Xp)return;let Nt=(me.x===_e?0:2)|Number(me.y&n6),bt=wt;return O&&y(wt)&&(bt=i.neg(wt),Nt^=1),new w(_e,bt,Nt)}return{seed:oe,k2sig:Y}}function L(T,v,E={}){T=hs("message",T);let{seed:O,k2sig:B}=N(T,v,E);return LHe(t.outputLen,i.BYTES,o)(O,B)}function I(T){let v,E=typeof T=="string"||E_(T),O=!E&&T!==null&&typeof T=="object"&&typeof T.r=="bigint"&&typeof T.s=="bigint";if(!E&&!O)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(O)v=new w(T.r,T.s);else if(E){try{v=w.fromBytes(hs("sig",T),"der")}catch(B){if(!(B instanceof Qp.Err))throw B}if(!v)try{v=w.fromBytes(hs("sig",T),"compact")}catch{return!1}}return v||!1}function R(T,v,E,O={}){let{lowS:B,prehash:_,format:M}=LH(O,m);if(E=hs("publicKey",E),v=U(hs("message",v),_),"strict"in O)throw new Error("options.strict was renamed to lowS");let F=M===void 0?I(T):w.fromBytes(hs("sig",T),M);if(F===!1)return!1;try{let q=e.fromBytes(E);if(B&&F.hasHighS())return!1;let{r:oe,s:Q}=F,Y=S(v),pe=i.inv(Q),he=i.create(Y*pe),Te=i.create(oe*pe),me=e.BASE.multiplyUnsafe(he).add(q.multiplyUnsafe(Te));return me.is0()?!1:i.create(me.x)===oe}catch{return!1}}function A(T,v,E={}){let{prehash:O}=LH(E,m);return v=U(v,O),w.fromBytes(T,"recovered").recoverPublicKey(v).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:p,lengths:f,Point:e,sign:L,verify:R,recoverPublicKey:A,Signature:w,hash:t})}function f$e(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(i=>Math.ceil(i/2)))):void 0,o=im(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),s={Fp:r,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:s}}function h$e(e){let{CURVE:t,curveOpts:r}=f$e(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function m$e(e,t){let r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,u0e(r.Fn.ORDER,r.Fn.BITS))})}function g$e(e){let{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=h$e(e),s=u$e(t,r),i=p$e(s,n,o);return m$e(e,i)}function o$(e,t){let r=n=>g$e({...e,hash:n});return{...r(t),create:r}}function C0e(){let e=t$.utils.randomPrivateKey(),t=t$.getPublicKey(e);return{privateKey:Rt(e,ms),publicKey:Rt(t,ms)}}function R_(){let e=Lg(C$);return Rt(e,ms)}function S0e(e,t){let r=t$.getSharedSecret(Yt(e,ms),Yt(t,ms)),n=DHe(__,r,void 0,void 0,C$);return Rt(n,ms)}function c6(e){let t=__(Yt(e,ms));return Rt(t,ms)}function Oi(e){let t=__(Yt(e,B3));return Rt(t,ms)}function I0e(e){return Yt(`${e}`,E0e)}function om(e){return Number(Rt(e,E0e))}function T0e(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _0e(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function P0e(e){let t=I0e(typeof e.type<"u"?e.type:A0e);if(om(t)===ol&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");let r=typeof e.senderPublicKey<"u"?Yt(e.senderPublicKey,ms):void 0,n=typeof e.iv<"u"?Yt(e.iv,ms):Lg(E3),o=Yt(e.symKey,ms),s=Xhe(o,n).encrypt(Yt(e.message,B3)),i=B0e({type:t,sealed:s,iv:n,senderPublicKey:r});return e.encoding===of?T0e(i):i}function N0e(e){let t=Yt(e.symKey,ms),{sealed:r,iv:n}=l6({encoded:e.encoded,encoding:e.encoding}),o=Xhe(t,n).decrypt(r);if(o===null)throw new Error("Failed to decrypt");return Rt(o,B3)}function R0e(e,t){let r=I0e(a6),n=Lg(E3),o=Yt(e,B3),s=B0e({type:r,sealed:o,iv:n});return t===of?T0e(s):s}function O0e(e,t){let{sealed:r}=l6({encoded:e,encoding:t});return Rt(r,B3)}function B0e(e){if(om(e.type)===a6)return Rt(_s([e.type,e.sealed]),gs);if(om(e.type)===ol){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");
70return Rt(_s([e.type,e.senderPublicKey,e.iv,e.sealed]),gs)}return Rt(_s([e.type,e.iv,e.sealed]),gs)}function l6(e){let t=(e.encoding||gs)===of?_0e(e.encoded):e.encoded,r=Yt(t,gs),n=r.slice(E$e,che),o=che;if(om(n)===ol){let c=o+C$,l=c+E3,u=r.slice(o,c),d=r.slice(c,l),p=r.slice(l);return{type:n,sealed:p,iv:d,senderPublicKey:u}}if(om(n)===a6){let c=r.slice(o),l=Lg(E3);return{type:n,sealed:c,iv:l}}let s=o+E3,i=r.slice(o,s),a=r.slice(s);return{type:n,sealed:a,iv:i}}function k0e(e,t){let r=l6({encoded:e,encoding:t?.encoding});return S$({type:om(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Rt(r.senderPublicKey,ms):void 0,receiverPublicKey:t?.receiverPublicKey})}function S$(e){let t=e?.type||A0e;if(t===ol){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function I$(e){return e.type===ol&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}function T$(e){return e.type===a6}function A$e(e){let t=Buffer.from(e.x,"base64"),r=Buffer.from(e.y,"base64");return _s([new Uint8Array([4]),t,r])}function D0e(e,t){let[r,n,o]=e.split("."),s=Buffer.from(_0e(o),"base64");if(s.length!==64)throw new Error("Invalid signature length");let i=s.slice(0,32),a=s.slice(32,64),c=`${r}.${n}`,l=__(c),u=A$e(t);if(!v$e.verify(_s([i,a]),l,u))throw new Error("Invalid signature");return Al(e).payload}function k3(e){return e?.relay||{protocol:C$e}}function Mg(e){let t=IA[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}function R$e(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(o=>{if(o.startsWith(n)){let s=o.replace(n,""),i=e[o];r[s]=i}}),r}function _$(e){if(!e.includes("wc:")){let l=_he(e);l!=null&&l.includes("wc:")&&(e=l)}e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;let t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),s=typeof r<"u"?e.substring(r):"",i=new URLSearchParams(s),a=Object.fromEntries(i.entries()),c=typeof a.methods=="str
70ing"?a.methods.split(","):void 0;return{protocol:n,topic:O$e(o[0]),version:parseInt(o[1],10),symKey:a.symKey,relay:R$e(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function O$e(e){return e.startsWith("//")?e.substring(2):e}function B$e(e,t="-"){let r="relay",n={};return Object.keys(e).forEach(o=>{let s=o,i=r+t+s;e[s]&&(n[i]=e[s])}),n}function P$(e){let t=new URLSearchParams,r=MH(MH(N$e(MH({},B$e(e.relay)),{symKey:e.symKey}),e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()}),e.methods&&{methods:e.methods.join(",")});return Object.entries(r).sort(([n],[o])=>n.localeCompare(o)).forEach(([n,o])=>{o!==void 0&&t.append(n,String(o))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function D3(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}function u6(e){let t=[];return e.forEach(r=>{let[n,o]=r.split(":");t.push(`${n}:${o}`)}),t}function N$(e){let t=[];return Object.values(e).forEach(r=>{t.push(...u6(r.accounts))}),[...new Set(t)]}function U0e(e){let t=[];return Object.values(e).forEach(r=>{t.push(...r.methods)}),[...new Set(t)]}function L0e(e){let t=[];return Object.values(e).forEach(r=>{t.push(...r.events)}),[...new Set(t)]}function F$e(e,t){let r=[];return Object.values(e).forEach(n=>{u6(n.accounts).includes(t)&&r.push(...n.methods)}),r}function V$e(e,t){let r=[];return Object.values(e).forEach(n=>{u6(n.accounts).includes(t)&&r.push(...n.events)}),r}function U3(e){return e.includes(":")}function Hg(e){return U3(e)?e.split(":")[0]:e}function fhe(e){var t,r,n;let o={};if(!ic(e))return o;for(let[s,i]of Object.entries(e)){let a=U3(s)?[s]:i.chains,c=i.methods||[],l=i.events||[],u=Hg(s);o[u]=$$e(H$e({},o[u]),{chains:Qc(a,(t=o[u])==null?void 0:t.chains),methods:Qc(c,(r=o[u])==null?void 0:r.methods),events:Qc(l,(n=o[u])==null?void 0:n.events)})}return o}function z$e(e){let t={};return e?.forEach(r=>{var n;let[o,s]=r.split(":");t[o]||(t[o]={accounts:[],chains:[],events:[],methods:[]}),t[o].accounts.push(r),(n=t[o].chains)==null||n.push(`${o}:${s}`)}),t}function R$(e,t){t=t.map(n=>n.replace("did:pkh:",""));let r=z$e(t);for(let[n,o]of Object.entries(r))o.methods?o.methods=Qc(o.methods,e):o.methods=e,o.events=["chainChanged","accountsChanged"];return r}function M0e(e,t){var r,n,o,s,i,a;let c=fhe(e),l=fhe(t),u={},d=Object.keys(c).concat(Object.keys(l));for(let p of d)u[p]={chains:Qc((r=c[p])==null?void 0:r.chains,(n=l[p])==null?void 0:n.chains),methods:Qc((o=c[p])==null?void 0:o.methods,(s=l[p])==null?void 0:s.methods),events:Qc((i=c[p])==null?void 0:i.events,(a=l[p])==null?void 0:a.events)};return u}function sl(e,t){return Array.isArray(e)?typeof t<"u"&&e.length?e.every(t):!0:!1}function ic(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function _n(e){return typeof e>"u"}function fn(e,t){return t&&_n(e)?!0:typeof e=="string"&&!!e.trim().length}function O$(e,t){return t&&_n(e)?!0:typeof e=="number"&&!isNaN(e)}function H0e(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),o=Object.keys(r),s=!0;return Rg(o,n)?(n.forEach(i=>{let{accounts:a,methods:c,events:l}=e.namespaces[i],u=u6(a),d=r[i];(!Rg(whe(i,d),u)||!Rg(d.methods,c)||!Rg(d.events,l))&&(s=!1)}),s):!1}function w_(e){return fn(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function j$e(e){if(fn(e,!1)&&e.includes(":")){let t=e.split(":");if(t.length===3){let r=t[0]+":"+t[1];return!!t[2]&&w_(r)}}return!1}function $0e(e){function t(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(fn(e,!1)){if(t(e))return!0;let r=_he(e);return t(r)}}catch{}return!1}function F0e(e){var t;return(t=e?.proposer)==null?void 0:t.publicKey}function V0e(e){return e?.topic}function z0e(e,t){let r=null;return fn(e?.publicKey,!1)||(r=Ae("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}function hhe(e){let t=!0;return sl(e)?e.length&&(t=e.every(r=>fn(r,!1))):t=!1,t}function q$e(e,t,r){let n=null;return sl(t)&&t.length?t.forEach(o=>{n||w_(o)||(n=Ir("UNSUPPORTED_CHAINS",`${r}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):w_(e)||(n=Ir("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:
705"] }`)),n}function W$e(e,t,r){let n=null;return Object.entries(e).forEach(([o,s])=>{if(n)return;let i=q$e(o,whe(o,s),`${t} ${r}`);i&&(n=i)}),n}function K$e(e,t){let r=null;return sl(e)?e.forEach(n=>{r||j$e(n)||(r=Ir("UNSUPPORTED_ACCOUNTS",`${t}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=Ir("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function Z$e(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;let o=K$e(n?.accounts,`${t} namespace`);o&&(r=o)}),r}function G$e(e,t){let r=null;return hhe(e?.methods)?hhe(e?.events)||(r=Ir("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=Ir("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}function j0e(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;let o=G$e(n,`${t}, namespace`);o&&(r=o)}),r}function q0e(e,t,r){let n=null;if(e&&ic(e)){let o=j0e(e,t);o&&(n=o);let s=W$e(e,t,r);s&&(n=s)}else n=Ae("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}function O_(e,t){let r=null;if(e&&ic(e)){let n=j0e(e,t);n&&(r=n);let o=Z$e(e,t);o&&(r=o)}else r=Ae("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function B$(e){return fn(e.protocol,!0)}function W0e(e,t){let r=!1;return t&&!e?r=!0:e&&sl(e)&&e.length&&e.forEach(n=>{r=B$(n)}),r}function K0e(e){return typeof e=="number"}function ys(e){return typeof e<"u"&&typeof e!==null}function Z0e(e){return!(!e||typeof e!="object"||!e.code||!O$(e.code,!1)||!e.message||!fn(e.message,!1))}function G0e(e){return!(_n(e)||!fn(e.method,!1))}function Y0e(e){return!(_n(e)||_n(e.result)&&_n(e.error)||!O$(e.id,!1)||!fn(e.jsonrpc,!1))}function J0e(e){return!(_n(e)||!fn(e.name,!1))}function k$(e,t){return!(!w_(t)||!N$(e).includes(t))}function Q0e(e,t,r){return fn(r,!1)?F$e(e,t).includes(r):!1}function X0e(e,t,r){return fn(r,!1)?V$e(e,t).includes(r):!1}function D$(e,t,r){let n=null,o=Y$e(e),s=J$e(t),i=Object.keys(o),a=Object.keys(s),c=mhe(Object.keys(e)),l=mhe(Object.keys(t)),u=c.filter(d=>!l.includes(d));return u.length&&(n=Ae("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
71      Required: ${u.toString()}
72      Received: ${Object.keys(t).toString()}`)),Rg(i,a)||(n=Ae("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
73      Required: ${i.toString()}
74      Approved: ${a.toString()}`)),Object.keys(t).forEach(d=>{if(!d.includes(":")||n)return;let p=u6(t[d].accounts);p.includes(d)||(n=Ae("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${d}
75        Required: ${d}
76        Approved: ${p.toString()}`))}
vendor: 4,336 bytes, line 76
76),i.forEach(d=>{n||(Rg(o[d].methods,s[d].methods)?Rg(o[d].events,s[d].events)||(n=Ae("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${d}`)):n=Ae("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${d}`))}),n}function Y$e(e){let t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:(n=e[r].chains)==null||n.forEach(o=>{t[o]={methods:e[r].methods,events:e[r].events}})}),t}function mhe(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function J$e(e){let t={};return Object.keys(e).forEach(r=>{r.includes(":")?t[r]=e[r]:u6(e[r].accounts)?.forEach(o=>{t[o]={accounts:e[r].accounts.filter(s=>s.includes(`${o}:`)),methods:e[r].methods,events:e[r].events}})}),t}function eme(e,t){return O$(e,!1)&&e<=t.max&&e>=t.min}function U$(){let e=T3();return new Promise(t=>{switch(e){case Ni.browser:t(Q$e());break;case Ni.reactNative:t(X$e());break;case Ni.node:t(eFe());break;default:t(!0)}})}function Q$e(){return Ug()&&navigator?.onLine}async function X$e(){return rf()&&typeof global<"u"&&global!=null&&global.NetInfo?(await(global==null?void 0:global.NetInfo.fetch()))?.isConnected:!0}function eFe(){return!0}function tme(e){switch(T3()){case Ni.browser:tFe(e);break;case Ni.reactNative:rFe(e);break;case Ni.node:break}}function tFe(e){!rf()&&Ug()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function rFe(e){rf()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(t=>e(t?.isConnected))}function rme(){var e;return Ug()&&(0,el.getDocument)()?((e=(0,el.getDocument)())==null?void 0:e.visibilityState)==="visible":!0}function nFe(e){let t=Na.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}function oFe({publicKey:e,signature:t,payload:r}){var n;let o=s$(r.method),s=128|parseInt(((n=r.version)==null?void 0:n.toString())||"4"),i=aFe(r.address),a=r.era==="00"?new Uint8Array([0]):s$(r.era);if(a.length!==1&&a.length!==2)throw new Error("Invalid era length");let c=parseInt(r.nonce,16),l=new Uint8Array([c&255,c>>8&255]),u=BigInt(`0x${iFe(r.tip)}`),d=lFe(u),p=new Uint8Array([0,...e,i,...t,...a,...l,...d,...o]),f=cFe(p.length+1);return new Uint8Array([...f,s,...p])}function sFe(e){let t=s$(e),r=(0,yhe.blake2b)(t,void 0,32);return"0x"+Buffer.from(r).toString("hex")}function s$(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(t=>parseInt(t,16)))}function iFe(e){return e.startsWith("0x")?e.slice(2):e}function aFe(e){let t=Na.decode(e)[0];return t===42?0:t===60?2:1}function cFe(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([t&255,t>>8&255])}else if(e<1<<30){let t=e<<2|2;return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function lFe(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){let t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}else if(e<BigInt(1)<<BigInt(30)){let t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}else throw new Error("BigInt compact encoding not supported > 2^30")}function nme(e){let t=Uint8Array.from(Buffer.from(e.signature,"hex")),r=nFe(e.transaction.address),n=oFe({publicKey:r,signature:t,payload:e.transaction}),o=Buffer.from(n).toString("hex");return sFe(o)}function d6({logger:e,name:t}){let r=typeof e=="string"?Sl({opts:{level:e,name:t}}).logger:e;return r.level=typeof e=="string"?e:e.level,r}var ef,el,ghe,yhe,$Le,FLe,VLe,zLe,jLe,qLe,Ufe,WLe,KLe,$H,Lfe,ZLe,Mfe,GLe,Ni,YLe,d_,i_,Hfe,$fe,Ffe,Q0,X0,x3,v3,sMe,iMe,aMe,cMe,lMe,uMe,d$,p$,dMe,pMe,fMe,hMe,Xb,Ohe,Jp,em,khe,gMe,Yp,o6,wMe,w3,bMe,xMe,vMe,EMe,Uhe,Lhe,Mhe,Hhe,AMe,CMe,zfe,jfe,FH,IMe,TMe,f_,W0,ds,ps,RMe,K0,VH,$he,OMe,BMe,Z0,G0,C3,zH,fs,jH,C_,kMe,DMe,UMe,LMe,Gn,Ne,qH,WH,HMe,$Me,WMe,KMe,ZMe,qfe,GMe,YMe,Wfe,JMe,QMe,Whe,XMe,eHe,S_,tHe,rHe,I_,N3,y$,pHe,gHe,Jhe,bHe,xHe,vHe,EHe,a_,AHe,Qhe,Yfe,Ro,JH,THe,PHe,NHe,Jfe,RHe,OHe,Xhe,h_,T_,RH,Xfe,DHe,__,x$,QH,OH,O3,Ri,ti,Bg,r0e,n0e,o0e,MHe,s0e,HHe,i0e,zHe,i6,kg,DH,h0e,e$,b3,e6,l_,e$e,ihe,t$e,r$e,n$e,m
760e,o$e,a$e,t$,ahe,n$,Qp,Xp,n6,g0e,u_,l$e,b0e,x0e,v0e,y$e,w$e,b$e,x$e,v$e,E0e,ms,gs,of,B3,A0e,ol,a6,E$e,che,E3,C$,C$e,S$e,I$e,T$e,lhe,_$e,P$e,uhe,MH,N$e,k$e,D$e,U$e,dhe,L$e,M$e,phe,H$e,$$e,HH,sm,B_=h(()=>{dP();ef=Lt(Sd(),1),el=Lt(_2(),1),ghe=Lt(wP(),1);Dfe();NN();wN();Zm();Nx();rO();yhe=Lt(iO(),1);jf();$Le=":";FLe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},VLe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};zLe=Object.defineProperty,jLe=Object.defineProperties,qLe=Object.getOwnPropertyDescriptors,Ufe=Object.getOwnPropertySymbols,WLe=Object.prototype.hasOwnProperty,KLe=Object.prototype.propertyIsEnumerable,$H=(e,t,r)=>t in e?zLe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lfe=(e,t)=>{for(var r in t||(t={}))WLe.call(t,r)&&$H(e,r,t[r]);if(Ufe)for(var r of Ufe(t))KLe.call(t,r)&&$H(e,r,t[r]);return e},ZLe=(e,t)=>jLe(e,qLe(t)),Mfe=(e,t,r)=>$H(e,typeof t!="symbol"?t+"":t,r),GLe="ReactNative",Ni={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},YLe="js";d_=class{constructor({limit:t}){Mfe(this,"limit"),Mfe(this,"set"),this.limit=t,this.set=new Set}add(t){if(!this.set.has(t)){if(this.set.size>=this.limit){let r=this.set.values().next().value;r&&this.set.delete(r)}this.set.add(t)}}has(t){return this.set.has(t)}},i_=BigInt(2**32-1),Hfe=BigInt(32);$fe=(e,t,r)=>e>>>r,Ffe=(e,t,r)=>e<<32-r|t>>>r,Q0=(e,t,r)=>e>>>r|t<<32-r,X0=(e,t,r)=>e<<32-r|t>>>r,x3=(e,t,r)=>e<<64-r|t>>>r-32,v3=(e,t,r)=>e>>>r-32|t<<64-r,sMe=(e,t)=>t,iMe=(e,t)=>e,aMe=(e,t,r)=>e<<r|t>>>32-r,cMe=(e,t,r)=>t<<r|e>>>32-r,lMe=(e,t,r)=>t<<r-32|e>>>64-r,uMe=(e,t,r)=>e<<r-32|t>>>64-r;d$=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),p$=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,dMe=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),pMe=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,fMe=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),hMe=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0,Xb=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;Ohe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;Jp=Ohe?e=>e:e=>Bhe(e);em=Ohe?e=>e:mMe,khe=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",gMe=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));Yp={_0:48,_9:57,A:65,F:70,a:97,f:102};o6=class{};wMe=BigInt(0),w3=BigInt(1),bMe=BigInt(2),xMe=BigInt(7),vMe=BigInt(256),EMe=BigInt(113),Uhe=[],Lhe=[],Mhe=[];for(let e=0,t=w3,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Uhe.push(2*(5*n+r)),Lhe.push((e+1)*(e+2)/2%64);let o=wMe;for(let s=0;s<7;s++)t=(t<<w3^(t>>xMe)*EMe)%vMe,t&bMe&&(o^=w3<<(w3<<BigInt(s))-w3);Mhe.push(o)}Hhe=Rhe(Mhe,!0),AMe=Hhe[0],CMe=Hhe[1],zfe=(e,t,r)=>r>32?lMe(e,t,r):aMe(e,t,r),jfe=(e,t,r)=>r>32?uMe(e,t,r):cMe(e,t,r);FH=class e extends o6{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,tf(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=A3(this.state)}clone(){return this._cloneInto()}keccak(){em(this.state32),SMe(this.state32,this.rounds),em(this.state32),this.posOut=0,this.pos=0}update(t){nm(this),t=Xc(t),tl(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){nm(this,!1),tl(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return tf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(f$(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,sc(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}},IMe=(e,t,r)=>P3(()=>new FH(t,e,r)),TMe=IMe(1,136,256/8);f_=class extends o6{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=_H(this.buffer)}update(t){nm(this),t=Xc(t),tl(t);let{view:r,buffer:n,blockLen:o}=this,s=t.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=_H(t);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){nm(this),f$(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;r[i++]=128,sc(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(n,0),i=0);for(let d=i;d<o;d++)r[d]=0;_Me(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=_H(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}},W0=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ds=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),ps=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),RMe=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,003 bytes, line 76
76734187,3204031479,3329325298]),K0=new Uint32Array(64),VH=class extends f_{constructor(t=32){super(64,t,8,!1),this.A=W0[0]|0,this.B=W0[1]|0,this.C=W0[2]|0,this.D=W0[3]|0,this.E=W0[4]|0,this.F=W0[5]|0,this.G=W0[6]|0,this.H=W0[7]|0}get(){let{A:t,B:r,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[t,r,n,o,s,i,a,c]}set(t,r,n,o,s,i,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)K0[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){let p=K0[d-15],f=K0[d-2],m=lu(p,7)^lu(p,18)^p>>>3,g=lu(f,17)^lu(f,19)^f>>>10;K0[d]=g+K0[d-7]+m+K0[d-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){let p=lu(a,6)^lu(a,11)^lu(a,25),f=u+p+PMe(a,c,l)+RMe[d]+K0[d]|0,m=(lu(n,2)^lu(n,13)^lu(n,22))+NMe(n,o,s)|0;u=l,l=c,c=a,a=i+f|0,i=s,s=o,o=n,n=f+m|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,s,i,a,c,l,u)}roundClean(){sc(K0)}destroy(){this.set(0,0,0,0,0,0,0,0),sc(this.buffer)}},$he=Rhe(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
765771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),OMe=$he[0],BMe=$he[1],Z0=new Uint32Array(80),G0=new Uint32Array(80),C3=class extends f_{constructor(t=64){super(128,t,16,!1),this.Ah=ps[0]|0,this.Al=ps[1]|0,this.Bh=ps[2]|0,this.Bl=ps[3]|0,this.Ch=ps[4]|0,this.Cl=ps[5]|0,this.Dh=ps[6]|0,this.Dl=ps[7]|0,this.Eh=ps[8]|0,this.El=ps[9]|0,this.Fh=ps[10]|0,this.Fl=ps[11]|0,this.Gh=ps[12]|0,this.Gl=ps[13]|0,this.Hh=ps[14]|0,this.Hl=ps[15]|0}get(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:p,Gh:f,Gl:m,Hh:g,Hl:y}=this;return[t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y]}set(t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=p|0,this.Gh=f|0,this.Gl=m|0,this.Hh=g|0,this.Hl=y|0}process(t,r){for(let w=0;w<16;w++,r+=4)Z0[w]=t.getUint32(r),G0[w]=t.getUint32(r+=4);for(let w=16;w<80;w++){let x=Z0[w-15]|0,S=G0[w-15]|0,P=Q0(x,S,1)^Q0(x,S,8)^$fe(x,S,7),D=X0(x,S,1)^X0(x,S,8)^Ffe(x,S,7),U=Z0[w-2]|0,N=G0[w-2]|0,L=Q0(U,N,19)^x3(U,N,61)^$fe(U,N,6),I=X0(U,N,19)^v3(U,N,61)^Ffe(U,N,6),R=dMe(D,I,G0[w-7],G0[w-16]),A=pMe(R,P,L,Z0[w-7],Z0[w-16]);Z0[w]=A|0,G0[w]=R|0}let{Ah:n,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:p,Fh:f,Fl:m,Gh:g,Gl:y,Hh:b,Hl:C}=this;for(let w=0;w<80;w++){let x=Q0(d,p,14)^Q0(d,p,18)^x3(d,p,41),S=X0(d,p,14)^X0(d,p,18)^v3(d,p,41),P=d&f^~d&g,D=p&m^~p&y,U=fMe(C,S,D,BMe[w],G0[w]),N=hMe(U,b,x,P,OMe[w],Z0[w]),L=U|0,I=Q0(n,o,28)^x3(n,o,34)^x3(n,o,39),R=X0(n,o,28)^v3(n,o,34)^v3(n,o,39),A=n&s^n&a^s&a,T=o&i^o&c^i&c;b=g|0,C=y|0,g=f|0,y=m|0,f=d|0,m=p|0,{h:d,l:p}=Jc(l|0,u|0,N|0,L|0),l=a|0,u=c|0,a=s|0,c=i|0,s=n|0,i=o|0;let v=d$(L,R,T);n=p$(v,N,I,A),o=v|0}({h:n,l:o}=Jc(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:i}=Jc(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=Jc(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Jc(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:p}=Jc(this.Eh|0,this.El|0,d|0,p|0),{h:f,l:m}=Jc(this.Fh|0,this.Fl|0,f|0,m|0),{h:g,l:y}=Jc(this.Gh|0,this.Gl|0,g|0,y|0),{h:b,l:C}=Jc(this.Hh|0,this.Hl|0,b|0,C|0),this.set(n,o,s,i,a,c,l,u,d,p,f,m,g,y,b,C)}roundClean(){sc(Z0,G0)}destroy(){sc(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},zH=class extends C3{constructor(){super(48),this.Ah=ds[0]|0,this.Al=ds[1]|0,this.Bh=ds[2]|0,this.Bl=ds[3]|0,this.Ch=ds[4]|0,this.Cl=ds[5]|0,this.Dh=ds[6]|0,this.Dl=ds[7]|0,this.Eh=ds[8]|0,this.El=ds[9]|0,this.Fh=ds[10]|0,this.Fl=ds[11]|0,this.Gh=ds[12]|0,this.Gl=ds[13]|0,this.Hh=ds[14]|0,this.Hl=ds[15]|0}},fs=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),jH=class extends C3{constructor(){super(32),this.Ah=fs[0]|0,this.Al=fs[1]|0,this.Bh=fs[2]|0,this.Bl=fs[3]|0,this.Ch=fs[4]|0,this.Cl=fs[5]|0,this.Dh=fs[6]|0,this.Dl=fs[7]|0,this.Eh=fs[8]|0,this.El=fs[9]|0,this.Fh=fs[10]|0,this.Fl=fs[11]|0,this.Gh=fs[12]|0,this.Gl=fs[13]|0,this.Hh=fs[14]|0,this.Hl=fs[15]|0}},C_=P3(()=>new VH),kMe=P3(()=>new C3),DMe=P3(()=>new zH),UMe=P3(()=>new jH),LMe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]),Gn=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Ne=new Uint32Array(32);qH=class extends o6{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,tf(t),tf(r),this.blockLen=t,this.outputLen=r,this.buffer=new Uint8Array(t),this.buffer32=A3(this.buffer)}update(t){nm(this),t=Xc(t),tl(t);let{blockLen:r,buffer:n,buffer32:o}=this,s=t.length,i=t.byteOffset,a=t.buffer;for(let c=0;c<s;){this.pos===r&&(em(o),this.compress(o,0,!1),em(o),this.pos=0);let l=Math.min(r-this.pos,s-c),u=i+c;if(l===r&&!(u%4)&&c+l<s){let d=new Uint32Array(a,u,Math.floor((s-c)/4));em(d);for(let p=0;c+r<s;p+=o.length,c+=r)this.length+=r,this.compress(d,p,!1);em(d);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){nm(this),f$(t,this);let{pos:r,buffer32:n}=this;this.finished=!0,sc(this.buffer.subarray(r)),em(n),this.compress(n,0,!0),em(n);let o=A3(t);
76this.get().forEach((s,i)=>o[i]=Jp(s))}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){let{buffer:r,length:n,finished:o,destroyed:s,outputLen:i,pos:a}=this;return t||(t=new this.constructor({dkLen:i})),t.set(...this.get()),t.buffer.set(r),t.destroyed=s,t.finished=o,t.length=n,t.pos=a,t.outputLen=i,t}clone(){return this._cloneInto()}},WH=class extends qH{constructor(t={}){let r=t.dkLen===void 0?64:t.dkLen;super(128,r),this.v0l=Gn[0]|0,this.v0h=Gn[1]|0,this.v1l=Gn[2]|0,this.v1h=Gn[3]|0,this.v2l=Gn[4]|0,this.v2h=Gn[5]|0,this.v3l=Gn[6]|0,this.v3h=Gn[7]|0,this.v4l=Gn[8]|0,this.v4h=Gn[9]|0,this.v5l=Gn[10]|0,this.v5h=Gn[11]|0,this.v6l=Gn[12]|0,this.v6h=Gn[13]|0,this.v7l=Gn[14]|0,this.v7h=Gn[15]|0,MMe(r,t,64,16,16);let{key:n,personalization:o,salt:s}=t,i=0;if(n!==void 0&&(n=Xc(n),i=n.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,s!==void 0){s=Xc(s);let a=A3(s);this.v4l^=Jp(a[0]),this.v4h^=Jp(a[1]),this.v5l^=Jp(a[2]),this.v5h^=Jp(a[3])}if(o!==void 0){o=Xc(o);let a=A3(o);this.v6l^=Jp(a[0]),this.v6h^=Jp(a[1]),this.v7l^=Jp(a[2]),this.v7h^=Jp(a[3])}if(n!==void 0){let a=new Uint8Array(this.blockLen);a.set(n),this.update(a)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:o,v2l:s,v2h:i,v3l:a,v3h:c,v4l:l,v4h:u,v5l:d,v5h:p,v6l:f,v6h:m,v7l:g,v7h:y}=this;return[t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y]}set(t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=o|0,this.v2l=s|0,this.v2h=i|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=p|0,this.v6l=f|0,this.v6h=m|0,this.v7l=g|0,this.v7h=y|0}compress(t,r,n){this.get().forEach((c,l)=>Ne[l]=c),Ne.set(Gn,16);let{h:o,l:s}=Nhe(BigInt(this.length));Ne[24]=Gn[8]^s,Ne[25]=Gn[9]^o,n&&(Ne[28]=~Ne[28],Ne[29]=~Ne[29]);let i=0,a=LMe;for(let c=0;c<12;c++)Y0(0,4,8,12,t,r+2*a[i++]),J0(0,4,8,12,t,r+2*a[i++]),Y0(1,5,9,13,t,r+2*a[i++]),J0(1,5,9,13,t,r+2*a[i++]),Y0(2,6,10,14,t,r+2*a[i++]),J0(2,6,10,14,t,r+2*a[i++]),Y0(3,7,11,15,t,r+2*a[i++]),J0(3,7,11,15,t,r+2*a[i++]),Y0(0,5,10,15,t,r+2*a[i++]),J0(0,5,10,15,t,r+2*a[i++]),Y0(1,6,11,12,t,r+2*a[i++]),J0(1,6,11,12,t,r+2*a[i++]),Y0(2,7,8,13,t,r+2*a[i++]),J0(2,7,8,13,t,r+2*a[i++]),Y0(3,4,9,14,t,r+2*a[i++]),J0(3,4,9,14,t,r+2*a[i++]);this.v0l^=Ne[0]^Ne[16],this.v0h^=Ne[1]^Ne[17],this.v1l^=Ne[2]^Ne[18],this.v1h^=Ne[3]^Ne[19],this.v2l^=Ne[4]^Ne[20],this.v2h^=Ne[5]^Ne[21],this.v3l^=Ne[6]^Ne[22],this.v3h^=Ne[7]^Ne[23],this.v4l^=Ne[8]^Ne[24],this.v4h^=Ne[9]^Ne[25],this.v5l^=Ne[10]^Ne[26],this.v5h^=Ne[11]^Ne[27],this.v6l^=Ne[12]^Ne[28],this.v6h^=Ne[13]^Ne[29],this.v7l^=Ne[14]^Ne[30],this.v7h^=Ne[15]^Ne[31],sc(Ne)}destroy(){this.destroyed=!0,sc(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},HMe=yMe(e=>new WH(e)),$Me="https://rpc.walletconnect.org/v1";WMe=Object.defineProperty,KMe=Object.defineProperties,ZMe=Object.getOwnPropertyDescriptors,qfe=Object.getOwnPropertySymbols,GMe=Object.prototype.hasOwnProperty,YMe=Object.prototype.propertyIsEnumerable,Wfe=(e,t,r)=>t in e?WMe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,JMe=(e,t)=>{for(var r in t||(t={}))GMe.call(t,r)&&Wfe(e,r,t[r]);if(qfe)for(var r of qfe(t))YMe.call(t,r)&&Wfe(e,r,t[r]);return e},QMe=(e,t)=>KMe(e,ZMe(t)),Whe="did:pkh:",XMe={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},eHe=e=>e?XMe[e]||e:"",S_=e=>e?.split(":"),tHe=e=>{let t=e&&S_(e);if(t)return e.includes(Whe)?t[3]:t[1]},rHe=e=>{let t=e&&S_(e);if(t)return e.includes(Whe)?t[2]:t[0]},I_=e=>{let t=e&&S_(e);if(t)return t[2]+":"+t[3]},N3=e=>{let t=e&&S_(e);if(t)return t.pop()};y$=(e,t)=>{let r=rHe(t);if(!r)throw new Error("Invalid issuer: "+t);let n=`${e.domain} wants you to sign in with your ${eHe(r)} account:`,o=N3(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0,i=`URI: ${e.aud||e.uri}`,a=`Version: ${e.version}`,c=`Chain ID: ${tHe(t)}`,l=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,d=e.exp?`Expiration Time: ${e.exp}`:void 0,p=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,m=e.resources?`Resources:${e.resources.map(y=>`
77- ${y}`).join("")}`:void 0,g=R3(e.resources);if(g){let y=S3(g);s=lHe(s,y)}return[n,o,"",s,"",i,a,c,l,u,d,p,f,m].filter(y=>y!=null).join(`
78`)};pHe=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;gHe=(e,t)=>{function r(n,...o){if(Pi(n),!pHe)throw new Error("Non little-endian hardware is not yet supported");if(e.nonceLength!==void 0){let l=o[0];if(!l)throw new Error("nonce / iv required");e.varSizeNonce?Pi(l):Pi(l,e.nonceLength)}let s=e.tagLength;s&&o[1]!==void 0&&Pi(o[1]);let i=t(n,...o),a=(l,u)=>{if(u!==void 0){if(l!==2)throw new Error("cipher output not supported");Pi(u)}},c=!1;
vendor: 4,335 bytes, line 78
78return{encrypt(l,u){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,Pi(l),a(i.encrypt.length,u),i.encrypt(l,u)},decrypt(l,u){if(Pi(l),s&&l.length<s)throw new Error("invalid ciphertext length: smaller than tagLength="+s);return a(i.decrypt.length,u),i.decrypt(l,u)}}}return Object.assign(r,e),r};Jhe=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),bHe=Jhe("expand 16-byte k"),xHe=Jhe("expand 32-byte k"),vHe=rm(bHe),EHe=rm(xHe);a_=64,AHe=16,Qhe=2**32-1,Yfe=new Uint32Array;Ro=(e,t)=>e[t++]&255|(e[t++]&255)<<8,JH=class{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=ZH(t),Pi(t,32);let r=Ro(t,0),n=Ro(t,2),o=Ro(t,4),s=Ro(t,6),i=Ro(t,8),a=Ro(t,10),c=Ro(t,12),l=Ro(t,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|o<<6)&7939,this.r[3]=(o>>>7|s<<9)&8191,this.r[4]=(s>>>4|i<<12)&255,this.r[5]=i>>>1&8190,this.r[6]=(i>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ro(t,16+2*u)}process(t,r,n=!1){let o=n?0:2048,{h:s,r:i}=this,a=i[0],c=i[1],l=i[2],u=i[3],d=i[4],p=i[5],f=i[6],m=i[7],g=i[8],y=i[9],b=Ro(t,r+0),C=Ro(t,r+2),w=Ro(t,r+4),x=Ro(t,r+6),S=Ro(t,r+8),P=Ro(t,r+10),D=Ro(t,r+12),U=Ro(t,r+14),N=s[0]+(b&8191),L=s[1]+((b>>>13|C<<3)&8191),I=s[2]+((C>>>10|w<<6)&8191),R=s[3]+((w>>>7|x<<9)&8191),A=s[4]+((x>>>4|S<<12)&8191),T=s[5]+(S>>>1&8191),v=s[6]+((S>>>14|P<<2)&8191),E=s[7]+((P>>>11|D<<5)&8191),O=s[8]+((D>>>8|U<<8)&8191),B=s[9]+(U>>>5|o),_=0,M=_+N*a+L*(5*y)+I*(5*g)+R*(5*m)+A*(5*f);_=M>>>13,M&=8191,M+=T*(5*p)+v*(5*d)+E*(5*u)+O*(5*l)+B*(5*c),_+=M>>>13,M&=8191;let F=_+N*c+L*a+I*(5*y)+R*(5*g)+A*(5*m);_=F>>>13,F&=8191,F+=T*(5*f)+v*(5*p)+E*(5*d)+O*(5*u)+B*(5*l),_+=F>>>13,F&=8191;let q=_+N*l+L*c+I*a+R*(5*y)+A*(5*g);_=q>>>13,q&=8191,q+=T*(5*m)+v*(5*f)+E*(5*p)+O*(5*d)+B*(5*u),_+=q>>>13,q&=8191;let oe=_+N*u+L*l+I*c+R*a+A*(5*y);_=oe>>>13,oe&=8191,oe+=T*(5*g)+v*(5*m)+E*(5*f)+O*(5*p)+B*(5*d),_+=oe>>>13,oe&=8191;let Q=_+N*d+L*u+I*l+R*c+A*a;_=Q>>>13,Q&=8191,Q+=T*(5*y)+v*(5*g)+E*(5*m)+O*(5*f)+B*(5*p),_+=Q>>>13,Q&=8191;let Y=_+N*p+L*d+I*u+R*l+A*c;_=Y>>>13,Y&=8191,Y+=T*a+v*(5*y)+E*(5*g)+O*(5*m)+B*(5*f),_+=Y>>>13,Y&=8191;let pe=_+N*f+L*p+I*d+R*u+A*l;_=pe>>>13,pe&=8191,pe+=T*c+v*a+E*(5*y)+O*(5*g)+B*(5*m),_+=pe>>>13,pe&=8191;let he=_+N*m+L*f+I*p+R*d+A*u;_=he>>>13,he&=8191,he+=T*l+v*c+E*a+O*(5*y)+B*(5*g),_+=he>>>13,he&=8191;let Te=_+N*g+L*m+I*f+R*p+A*d;_=Te>>>13,Te&=8191,Te+=T*u+v*l+E*c+O*a+B*(5*y),_+=Te>>>13,Te&=8191;let me=_+N*y+L*g+I*m+R*f+A*p;_=me>>>13,me&=8191,me+=T*d+v*u+E*l+O*c+B*a,_+=me>>>13,me&=8191,_=(_<<2)+_|0,_=_+M|0,M=_&8191,_=_>>>13,F+=_,s[0]=M,s[1]=F,s[2]=q,s[3]=oe,s[4]=Q,s[5]=Y,s[6]=pe,s[7]=he,s[8]=Te,s[9]=me}finalize(){let{h:t,pad:r}=this,n=new Uint16Array(10),o=t[1]>>>13;t[1]&=8191;for(let a=2;a<10;a++)t[a]+=o,o=t[a]>>>13,t[a]&=8191;t[0]+=o*5,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,n[0]=t[0]+5,o=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=t[a]+o,o=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(o^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)t[a]=t[a]&s|n[a];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let i=t[0]+r[0];t[0]=i&65535;for(let a=1;a<8;a++)i=(t[a]+r[a]|0)+(i>>>16)|0,t[a]=i&65535;s6(n)}update(t){Kfe(this),t=ZH(t),Pi(t);let{buffer:r,blockLen:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(n-this.pos,o-s);if(i===n){for(;n<=o-s;s+=n)this.process(t,s);continue}r.set(t.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){s6(this.h,this.r,this.buffer,this.pad)}digestInto(t){Kfe(this),uHe(t,this),this.finished=!0;let{buffer:r,h:n}=this,{pos:o}=this;if(o){for(r[o++]=1;o<16;o++)r[o]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let i=0;i<8;i++)t[s++]=n[i]>>>0,t[s++]=n[i]>>>8;return t}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}};THe=IHe(e=>new JH(e));PHe=SHe(_He,{counterRight:!1,counterLength:4,allowShortKeys:!1}),NHe=new Uint8Array(16),Jfe=(e,t)=>
78{e.update(t);let r=t.length%16;r&&e.update(NHe.subarray(r))},RHe=new Uint8Array(32);OHe=e=>(t,r,n)=>({encrypt(o,s){let i=o.length;s=Zfe(i+16,s,!1),s.set(o);let a=s.subarray(0,-16);e(t,r,a,a,1);let c=Qfe(e,t,r,a,n);return s.set(c,i),s6(c),s},decrypt(o,s){s=Zfe(o.length-16,s,!1);let i=o.subarray(0,-16),a=o.subarray(-16),c=Qfe(e,t,r,i,n);if(!mHe(a,c))throw new Error("invalid tag");return s.set(o.subarray(0,-16)),e(t,r,s,s,1),s6(c),s}}),Xhe=gHe({blockSize:64,nonceLength:12,tagLength:16},OHe(PHe)),h_=class extends o6{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,A_(t);let n=Xc(r);if(this.iHash=t.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;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),sc(s)}update(t){return nm(this),this.iHash.update(t),this}digestInto(t){nm(this),tl(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:o,destroyed:s,blockLen:i,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},T_=(e,t,r)=>new h_(e,t).update(r).digest();T_.create=(e,t)=>new h_(e,t);RH=Uint8Array.from([0]),Xfe=Uint8Array.of();DHe=(e,t,r,n,o)=>kHe(e,BHe(e,t,r),n,o),__=C_,x$=BigInt(0),QH=BigInt(1);OH=e=>typeof e=="bigint"&&x$<=e;O3=e=>(QH<<BigInt(e))-QH;Ri=BigInt(0),ti=BigInt(1),Bg=BigInt(2),r0e=BigInt(3),n0e=BigInt(4),o0e=BigInt(5),MHe=BigInt(7),s0e=BigInt(8),HHe=BigInt(9),i0e=BigInt(16);zHe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];i6=BigInt(0),kg=BigInt(1);DH=new WeakMap,h0e=new WeakMap;e$=class{constructor(t,r){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,n=this.ZERO){let o=t;for(;r>i6;)r&kg&&(n=n.add(o)),o=o.double(),r>>=kg;return n}precomputeWindow(t,r){let{windows:n,windowSize:o}=kH(r,this.bits),s=[],i=t,a=i;for(let c=0;c<n;c++){a=i,s.push(a);for(let l=1;l<o;l++)a=a.add(i),s.push(a);i=a.double()}return s}wNAF(t,r,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let o=this.ZERO,s=this.BASE,i=kH(t,this.bits);for(let a=0;a<i.windows;a++){let{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:p,offsetF:f}=nhe(n,a,i);n=c,u?s=s.add(y_(p,r[f])):o=o.add(y_(d,r[l]))}return ohe(n),{p:o,f:s}}wNAFUnsafe(t,r,n,o=this.ZERO){let s=kH(t,this.bits);for(let i=0;i<s.windows&&n!==i6;i++){let{nextN:a,offset:c,isZero:l,isNeg:u}=nhe(n,i,s);if(n=a,!l){let d=r[c];o=o.add(u?d.negate():d)}}return ohe(n),o}getPrecomputes(t,r,n){let o=DH.get(r);return o||(o=this.precomputeWindow(r,t),t!==1&&(typeof n=="function"&&(o=n(o)),DH.set(r,o))),o}cached(t,r,n){let o=UH(t);return this.wNAF(o,this.getPrecomputes(o,t,n),r)}unsafe(t,r,n,o){let s=UH(t);return s===1?this._unsafeLadder(t,r,o):this.wNAFUnsafe(s,this.getPrecomputes(s,t,n),r,o)}createCache(t,r){f0e(r,this.bits),h0e.set(t,r),DH.delete(t)}hasCache(t){return UH(t)!==1}};BigInt(0),BigInt(1),BigInt(2),BigInt(8),Dhe("HashToScalar-");b3=BigInt(0),e6=BigInt(1),l_=BigInt(2);e$e=BigInt(1),ihe=BigInt(2),t$e=BigInt(3),r$e=BigInt(5),n$e=BigInt(8),m0e=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),o$e={p:m0e,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:n$e,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};a$e=im(o$e.p,{isLE:!0}),t$=(()=>{let e=a$e.ORDER;return XHe({P:e,type:"x25519",powPminus2:t=>{let{pow_p_5_8:r,b2:n}
vendor: 4,158 bytes, line 78
78=s$e(t);return ba(Yc(r,t$e,e)*n,e)},adjustScalarBytes:i$e})})(),ahe=(e,t)=>(e+(e>=0?t:-t)/g0e)/t;n$=class extends Error{constructor(t=""){super(t)}},Qp={Err:n$,_tlv:{encode:(e,t)=>{let{Err:r}=Qp;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=c_(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?c_(o.length/2|128):"";return c_(e)+s+o+t},decode(e,t){let{Err:r}=Qp,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],s=!!(o&128),i=0;if(!s)i=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=t.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of l)i=i<<8|u;if(n+=c,i<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+i)}}},_int:{encode(e){let{Err:t}=Qp;if(e<Xp)throw new t("integer: negative integers are not allowed");let r=c_(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Qp;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return P_(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=Qp,o=hs("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=Qp,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),s=n+o;return t.encode(48,s)}},Xp=BigInt(0),n6=BigInt(1),g0e=BigInt(2),u_=BigInt(3),l$e=BigInt(4);b0e={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},x0e={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},v0e={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")}
vendor: 4,247 bytes, line 78
78,y$e=im(b0e.p),w$e=im(x0e.p),b$e=im(v0e.p),x$e=o$({...b0e,Fp:y$e,lowS:!1},C_);o$({...x0e,Fp:w$e,lowS:!1},DMe),o$({...v0e,Fp:b$e,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},kMe);v$e=x$e,E0e="base10",ms="base16",gs="base64pad",of="base64url",B3="utf8",A0e=0,ol=1,a6=2,E$e=0,che=1,E3=12,C$=32;C$e="irn";S$e=Object.defineProperty,I$e=Object.defineProperties,T$e=Object.getOwnPropertyDescriptors,lhe=Object.getOwnPropertySymbols,_$e=Object.prototype.hasOwnProperty,P$e=Object.prototype.propertyIsEnumerable,uhe=(e,t,r)=>t in e?S$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,MH=(e,t)=>{for(var r in t||(t={}))_$e.call(t,r)&&uhe(e,r,t[r]);if(lhe)for(var r of lhe(t))P$e.call(t,r)&&uhe(e,r,t[r]);return e},N$e=(e,t)=>I$e(e,T$e(t));k$e=Object.defineProperty,D$e=Object.defineProperties,U$e=Object.getOwnPropertyDescriptors,dhe=Object.getOwnPropertySymbols,L$e=Object.prototype.hasOwnProperty,M$e=Object.prototype.propertyIsEnumerable,phe=(e,t,r)=>t in e?k$e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H$e=(e,t)=>{for(var r in t||(t={}))L$e.call(t,r)&&phe(e,r,t[r]);if(dhe)for(var r of dhe(t))M$e.call(t,r)&&phe(e,r,t[r]);return e},$$e=(e,t)=>D$e(e,U$e(t));HH={},sm=class{static get(t){return HH[t]}static set(t,r){HH[t]=r}static delete(t){delete HH[t]}}});function jFe(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var o=0;o<e.length;o++){var s=e.charAt(o),i=s.charCodeAt(0);if(r[i]!==255)throw new TypeError(s+" is ambiguous");r[i]=o}var a=e.length,c=e.charAt(0),l=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(m){if(m instanceof Uint8Array||(ArrayBuffer.isView(m)?m=new Uint8Array(m.buffer,m.byteOffset,m.byteLength):Array.isArray(m)&&(m=Uint8Array.from(m))),!(m instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(m.length===0)return"";for(var g=0,y=0,b=0,C=m.length;b!==C&&m[b]===0;)b++,g++;for(var w=(C-b)*u+1>>>0,x=new Uint8Array(w);b!==C;){for(var S=m[b],P=0,D=w-1;(S!==0||P<y)&&D!==-1;D--,P++)S+=256*x[D]>>>0,x[D]=S%a>>>0,S=S/a>>>0;if(S!==0)throw new Error("Non-zero carry");y=P,b++}for(var U=w-y;U!==w&&x[U]===0;)U++;for(var N=c.repeat(g);U<w;++U)N+=e.charAt(x[U]);return N}function p(m){if(typeof m!="string")throw new TypeError("Expected String");if(m.length===0)return new Uint8Array;var g=0;if(m[g]!==" "){for(var y=0,b=0;m[g]===c;)y++,g++;for(var C=(m.length-g)*l+1>>>0,w=new Uint8Array(C);m[g];){var x=r[m.charCodeAt(g)];if(x===255)return;for(var S=0,P=C-1;(x!==0||S<b)&&P!==-1;P--,S++)x+=a*w[P]>>>0,w[P]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");b=S,g++}if(m[g]!==" "){for(var D=C-b;D!==C&&w[D]===0;)D++;for(var U=new Uint8Array(y+(C-D)),N=y;D!==C;)U[N++]=w[D++];return U}}}function f(m){var g=p(m);if(g)return g;throw new Error(`Non-${t} character`)}return{encode:d,decodeUnsafe:p,decode:f}}function RVe(e){return e.reduce((t,r)=>(t+=PVe[r],t),"")}function OVe(e){let t=[];for(let r of e){let n=NVe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}function Ume(e,t,r){t=t||[],r=r||0;for(var n=r;e>=MVe;)t[r++]=e&255|ime,e/=128;for(;e&LVe;)t[r++]=e&255|ime,e>>>=7;return t[r]=e|0,Ume.bytes=r-n+1,t}function q$(e,n){var r=0,n=n||0,o=0,s=n,i,a=e.length;do{if(s>=a)throw q$.bytes=0,new RangeError("Could not decode varint");i=e[s++],r+=o<28?(i&ame)<<o:(i&ame)*Math.pow(2,o),o+=7}while(i>=$Ve);return q$.bytes=s-n,r}function Vme(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function sze(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Vme(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function zme(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}function aze(e,t="utf8"){let r=ize[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Vme(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function kze(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function wme(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
vendor: 4,308 bytes, line 78
78function bme(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function vme(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function sje(e,t,r){return $3(e,t,void 0,void 0,void 0,void 0,r)}function $3(e,t,r,n,o,s,i){let a=i(e,t,r,n,o,s);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return F3(e,t,s,i)}return F3(e,t,s,i)}function F3(e,t,r,n){if(Object.is(e,t))return!0;let o=bme(e),s=bme(t);if(o===xme&&(o=H$),s===xme&&(s=H$),o!==s)return!1;switch(o){case Uze:return e.toString()===t.toString();case Lze:{let c=e.valueOf(),l=t.valueOf();return kze(c,l)}case Mze:case $ze:case Hze:return Object.is(e.valueOf(),t.valueOf());case Dze:return e.source===t.source&&e.flags===t.flags;case jze:return e===t}r=r??new Map;let i=r.get(e),a=r.get(t);if(i!=null&&a!=null)return i===t;r.set(e,t),r.set(t,e);try{switch(o){case Fze:{if(e.size!==t.size)return!1;for(let[c,l]of e.entries())if(!t.has(c)||!$3(l,t.get(c),c,e,t,r,n))return!1;return!0}case Vze:{if(e.size!==t.size)return!1;let c=Array.from(e.values()),l=Array.from(t.values());for(let u=0;u<c.length;u++){let d=c[u],p=l.findIndex(f=>$3(d,f,void 0,e,t,r,n));if(p===-1)return!1;l.splice(p,1)}return!0}case zze:case Zze:case Gze:case Yze:case Jze:case Qze:case Xze:case eje:case tje:case rje:case nje:case oje:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!$3(e[c],t[c],c,e,t,r,n))return!1;return!0}case qze:return e.byteLength!==t.byteLength?!1:F3(new Uint8Array(e),new Uint8Array(t),r,n);case Kze:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:F3(new Uint8Array(e),new Uint8Array(t),r,n);case Wze:return e.name===t.name&&e.message===t.message;case H$:{if(!(F3(e.constructor,t.constructor,r,n)||vme(e)&&vme(t)))return!1;let c=[...Object.keys(e),...wme(e)],l=[...Object.keys(t),...wme(t)];if(c.length!==l.length)return!1;for(let u=0;u<c.length;u++){let d=c[u],p=e[d];if(!Object.hasOwn(t,d))return!1;let f=t[d];if(!$3(p,f,d,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function ije(){}function aje(e,t){return sje(e,t,ije)}var sf,Ke,_me,Pme,Nme,D_,pu,uFe,dFe,pFe,ome,fFe,hFe,mFe,gFe,yFe,wFe,bFe,gF,xFe,Rme,vFe,hn,EFe,ac,AFe,$$,Lr,k_,CFe,SFe,sme,Ea,IFe,TFe,_zt,_Fe,PFe,L3,am,il,NFe,RFe,OFe,Aa,BFe,kFe,DFe,Ome,h6,UFe,LFe,MFe,HFe,al,du,lc,cm,lm,m6,$Fe,FFe,VFe,zFe,qFe,WFe,Bme,KFe,ZFe,F$,V$,z$,kme,j$,U_,V3,GFe,YFe,Bo,JFe,QFe,XFe,eVe,tVe,rVe,nVe,oVe,sVe,iVe,aVe,cVe,lVe,uVe,dVe,pVe,fVe,hVe,mVe,gVe,yVe,wVe,bVe,xVe,vVe,EVe,AVe,CVe,SVe,IVe,TVe,_Ve,Dme,PVe,NVe,BVe,kVe,DVe,ime,UVe,LVe,MVe,HVe,$Ve,ame,FVe,VVe,zVe,jVe,qVe,WVe,KVe,ZVe,GVe,YVe,JVe,Lme,cme,lme,W$,K$,Mme,Z$,Hme,QVe,XVe,eze,$me,tze,Fme,rze,nze,oze,ume,dme,L$,ize,cze,lze,uu,G$,uze,dze,go,Y$,pze,fze,hze,pme,mze,gze,J$,yze,wze,va,Q$,bze,xze,vze,fme,Eze,Aze,X$,p6,hme,cc,eF,Cze,Sze,f6,tF,Ize,Tze,_ze,mme,Pze,Nze,rF,M3,M$,Tr,nF,Rze,gme,Oze,Bze,oF,yme,Bt,sF,Dze,Uze,Lze,Mze,xme,Hze,$ze,Fze,Vze,zze,jze,qze,H$,Wze,Kze,Zze,Gze,Yze,Jze,Qze,Xze,eje,tje,rje,nje,oje,cje,Eme,lje,uje,iF,Ame,Bi,fu,dje,pje,Ft,aF,fje,hje,Oo,cF,mje,gje,ws,lF,yje,wje,Ln,uF,bje,xje,Cme,dF,vje,Sme,Eje,Aje,pF,H3,yo,fF,Cje,Ime,Sje,Ije,hF,Tme,Ur,mF,jme,qme=h(()=>{sf=Lt(Cs(),1);jO();QO();jf();eM();Ke=Lt(Sd(),1);Wm();Zm();Zm();B_();Nx();uy();Sc();iB();_me=Lt(_2(),1),Pme="wc",Nme=2,D_="core",pu=`${Pme}@2:${D_}:`,uFe={name:D_,logger:"error"},dFe={database:":memory:"},pFe="crypto",ome="client_ed25519_seed",fFe=Ke.ONE_DAY,hFe="keychain",mFe="0.3",gFe="messages",yFe="0.3",wFe=Ke.SIX_HOURS,bFe="publisher",gF="irn",xFe="error",Rme="wss://relay.walletconnect.org",vFe="relayer",hn={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},EFe="_subscription",ac={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"}
vendor: 6,134 bytes, line 78
78,AFe=.1,$$="2.23.7",Lr={link_mode:"link_mode",relay:"relay"},k_={inbound:"inbound",outbound:"outbound"},CFe="0.3",SFe="WALLETCONNECT_CLIENT_ID",sme="WALLETCONNECT_LINK_MODE_APPS",Ea={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},IFe="subscription",TFe="0.3",_zt=Ke.FIVE_SECONDS*1e3,_Fe="pairing",PFe="0.3",L3={wc_pairingDelete:{req:{ttl:Ke.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ke.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ke.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ke.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ke.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ke.ONE_DAY,prompt:!1,tag:0}}},am={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},il={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},NFe="history",RFe="0.3",OFe="expirer",Aa={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},BFe="0.3",kFe="verify-api",DFe="https://verify.walletconnect.com",Ome="https://verify.walletconnect.org",h6=Ome,UFe=`${h6}/v3`,LFe=[DFe,Ome],MFe="echo",HFe="https://echo.walletconnect.com",al={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},du={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},lc={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},cm={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},lm={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},m6={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},$Fe=.1,FFe="event-client",VFe=86400,zFe="https://pulse.walletconnect.org/batch";qFe=jFe,WFe=qFe,Bme=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},KFe=e=>new TextEncoder().encode(e),ZFe=e=>new TextDecoder().decode(e),F$=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}},V$=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name}
78 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return kme(this,t)}},z$=class{constructor(t){this.decoders=t}or(t){return kme(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},kme=(e,t)=>new z$({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),j$=class{constructor(t,r,n,o){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=o,this.encoder=new F$(t,r,n),this.decoder=new V$(t,r,o)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}},U_=({name:e,prefix:t,encode:r,decode:n})=>new j$(e,t,r,n),V3=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:o}=WFe(r,t);return U_({prefix:e,name:t,encode:n,decode:s=>Bme(o(s))})},GFe=(e,t,r,n)=>{let o={};for(let u=0;u<t.length;++u)o[t[u]]=u;let s=e.length;for(;e[s-1]==="=";)--s;let i=new Uint8Array(s*r/8|0),a=0,c=0,l=0;for(let u=0;u<s;++u){let d=o[e[u]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,a+=r,a>=8&&(a-=8,i[l++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return i},YFe=(e,t,r)=>{let n=t[t.length-1]==="=",o=(1<<r)-1,s="",i=0,a=0;for(let c=0;c<e.length;++c)for(a=a<<8|e[c],i+=8;i>r;)i-=r,s+=t[o&a>>i];if(i&&(s+=t[o&a<<r-i]),n)for(;s.length*r&7;)s+="=";return s},Bo=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>U_({prefix:t,name:e,encode(o){return YFe(o,n,r)},decode(o){return GFe(o,n,r,e)}}),JFe=U_({prefix:"\0",name:"identity",encode:e=>ZFe(e),decode:e=>KFe(e)}),QFe=Object.freeze({__proto__:null,identity:JFe}),XFe=Bo({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),eVe=Object.freeze({__proto__:null,base2:XFe}),tVe=Bo({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),rVe=Object.freeze({__proto__:null,base8:tVe}),nVe=V3({prefix:"9",name:"base10",alphabet:"0123456789"}),oVe=Object.freeze({__proto__:null,base10:nVe}),sVe=Bo({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),iVe=Bo({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),aVe=Object.freeze({__proto__:null,base16:sVe,base16upper:iVe}),cVe=Bo({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),lVe=Bo({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),uVe=Bo({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),dVe=Bo({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),pVe=Bo({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),fVe=Bo({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),hVe=Bo({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),mVe=Bo({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),gVe=Bo({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),yVe=Object.freeze({__proto__:null,base32:cVe,base32upper:lVe,base32pad:uVe,base32padupper:dVe,base32hex:pVe,base32hexupper:fVe,base32hexpad:hVe,base32hexpadupper:mVe,base32z:gVe}),wVe=V3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),bVe=V3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),xVe=Object.freeze({__proto__:null,base36:wVe,base36upper:bVe}),vVe=V3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),EVe=V3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),AVe=Object.freeze({__proto__:null,base58btc:vVe,base58flickr:EVe}),CVe=Bo({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),SVe=Bo({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
78+/=",bitsPerChar:6}),IVe=Bo({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TVe=Bo({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),_Ve=Object.freeze({__proto__:null,base64:CVe,base64pad:SVe,base64url:IVe,base64urlpad:TVe}),Dme=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}
78\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),PVe=Dme.reduce((e,t,r)=>(e[r]=t,e),[]),NVe=Dme.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);BVe=U_({prefix:"\u{1F680}",name:"base256emoji",encode:RVe,decode:OVe}),kVe=Object.freeze({__proto__:null,base256emoji:BVe}),DVe=Ume,ime=128,UVe=127,LVe=~UVe,MVe=Math.pow(2,31);HVe=q$,$Ve=128,ame=127;FVe=Math.pow(2,7),VVe=Math.pow(2,14),zVe=Math.pow(2,21),jVe=Math.pow(2,28),qVe=Math.pow(2,35),WVe=Math.pow(2,42),KVe=Math.pow(2,49),ZVe=Math.pow(2,56),GVe=Math.pow(2,63),YVe=function(e){return e<FVe?1:e<VVe?2:e<zVe?3:e<jVe?4:e<qVe?5:e<WVe?6:e<KVe?7:e<ZVe?8:e<GVe?9:10},JVe={encode:DVe,decode:HVe,encodingLength:YVe},Lme=JVe,cme=(e,t,r=0)=>(Lme.encode(e,t,r),t),lme=e=>Lme.encodingLength(e),W$=(e,t)=>{let r=t.byteLength,n=lme(e),o=n+lme(r),s=new Uint8Array(o+r);return cme(e,s,0),cme(r,s,n),s.set(t,o),new K$(e,r,t,s)},K$=class{constructor(t,r,n,o){this.code=t,this.size=r,this.digest=n,this.bytes=o}},Mme=({name:e,code:t,encode:r})=>new Z$(e,t,r),Z$=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?W$(this.code,r):r.then(n=>W$(this.code,n))}else throw Error("Unknown type, must be binary type")}},Hme=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),QVe=Mme({name:"sha2-256",code:18,encode:Hme("SHA-256")}),XVe=Mme({name:"sha2-512",code:19,encode:Hme("SHA-512")}),eze=Object.freeze({__proto__:null,sha256:QVe,sha512:XVe}),$me=0,tze="identity",Fme=Bme,rze=e=>W$($me,Fme(e)),nze={code:$me,name:tze,encode:Fme,digest:rze},oze=Object.freeze({__proto__:null,identity:nze});new TextEncoder,new TextDecoder;ume={...QFe,...eVe,...rVe,...oVe,...aVe,...yVe,...xVe,...AVe,..._Ve,...kVe};({...eze,...oze});dme=zme("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),L$=zme("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=sze(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),ize={utf8:dme,"utf-8":dme,hex:ume.base16,latin1:L$,ascii:L$,binary:L$,...ume};cze=Object.defineProperty,lze=(e,t,r)=>t in e?cze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uu=(e,t,r)=>lze(e,typeof t!="symbol"?t+"":t,r),G$=class{constructor(t,r){this.core=t,this.logger=r,uu(this,"keychain",new Map),uu(this,"name",hFe),uu(this,"version",mFe),uu(this,"initialized",!1),uu(this,"storagePrefix",pu),uu(this,"init",async()=>{if(!this.initialized){let n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}}),uu(this,"has",n=>(this.isInitialized(),this.keychain.has(n))),uu(this,"set",async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()}),uu(this,"get",n=>{this.isInitialized();let o=this.keychain.get(n);if(typeof o>"u"){let{message:s}=Ae("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return o}),uu(this,"del",async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()}),this.core=t,this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,b_(t))}async getKeyChain(){let t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?x_(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},uze=Object.defineProperty,dze=(e,t,r)=>t in e?uze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,go=(e,t,r)=>dze(e,typeof t!="symbol"?t+"":t,r),Y$=class{constructor(t,r,n){this.core=t,this.logger=r,go(this,"name",pFe),go(this,"keychain"),go(this,"randomSessionIdentifier",R_()),go(this,"initialized",!1),go(this,"clientId"),go(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),go(this,"hasKeys",o=>(this.isInitialized(),this.keychain.has(o))),go(this,"getClientId",async()=>
78{if(this.isInitialized(),this.clientId)return this.clientId;let o=await this.getClientSeed(),s=ey(o),i=Hx(s.publicKey);return this.clientId=i,i}),go(this,"generateKeyPair",()=>{this.isInitialized();let o=C0e();return this.setPrivateKey(o.publicKey,o.privateKey)}),go(this,"signJWT",async o=>{this.isInitialized();let s=await this.getClientSeed(),i=ey(s),a=this.randomSessionIdentifier;return await SA(a,o,fFe,i)}),go(this,"generateSharedKey",(o,s,i)=>{this.isInitialized();let a=this.getPrivateKey(o),c=S0e(a,s);return this.setSymKey(c,i)}),go(this,"setSymKey",async(o,s)=>{this.isInitialized();let i=s||c6(o);return await this.keychain.set(i,o),i}),go(this,"deleteKeyPair",async o=>{this.isInitialized(),await this.keychain.del(o)}),go(this,"deleteSymKey",async o=>{this.isInitialized(),await this.keychain.del(o)}),go(this,"encode",async(o,s,i)=>{this.isInitialized();let a=S$(i),c=si(s);if(T$(a))return R0e(c,i?.encoding);if(I$(a)){let p=a.senderPublicKey,f=a.receiverPublicKey;o=await this.generateSharedKey(p,f)}let l=this.getSymKey(o),{type:u,senderPublicKey:d}=a;return P0e({type:u,symKey:l,message:c,senderPublicKey:d,encoding:i?.encoding})}),go(this,"decode",async(o,s,i)=>{this.isInitialized();let a=k0e(s,i);if(T$(a)){let c=O0e(s,i?.encoding);return Rs(c)}if(I$(a)){let c=a.receiverPublicKey,l=a.senderPublicKey;o=await this.generateSharedKey(c,l)}try{let c=this.getSymKey(o),l=N0e({symKey:c,encoded:s,encoding:i?.encoding});return Rs(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}}),go(this,"getPayloadType",(o,s=gs)=>{let i=l6({encoded:o,encoding:s});return om(i.type)}),go(this,"getPayloadSenderPublicKey",(o,s=gs)=>{let i=l6({encoded:o,encoding:s});return i.senderPublicKey?Rt(i.senderPublicKey,ms):void 0}),this.core=t,this.logger=br(r,this.name),this.keychain=n||new G$(this.core,this.logger)}get context(){return rr(this.logger)}async setPrivateKey(t,r){return await this.keychain.set(t,r),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(ome)}catch{t=R_(),await this.keychain.set(ome,t)}return aze(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},pze=Object.defineProperty,fze=Object.defineProperties,hze=Object.getOwnPropertyDescriptors,pme=Object.getOwnPropertySymbols,mze=Object.prototype.hasOwnProperty,gze=Object.prototype.propertyIsEnumerable,J$=(e,t,r)=>t in e?pze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yze=(e,t)=>{for(var r in t||(t={}))mze.call(t,r)&&J$(e,r,t[r]);if(pme)for(var r of pme(t))gze.call(t,r)&&J$(e,r,t[r]);return e},wze=(e,t)=>fze(e,hze(t)),va=(e,t,r)=>J$(e,typeof t!="symbol"?t+"":t,r),Q$=class extends wT{constructor(t,r){super(t,r),this.logger=t,this.core=r,va(this,"messages",new Map),va(this,"messagesWithoutClientAck",new Map),va(this,"name",gFe),va(this,"version",yFe),va(this,"initialized",!1),va(this,"storagePrefix",pu),va(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n);let o=await this.getRelayerMessagesWithoutClientAck();typeof o<"u"&&(this.messagesWithoutClientAck=o),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}}),va(this,"set",async(n,o,s)=>{this.isInitialized();let i=Oi(o),a=this.messages.get(n);if(typeof a>"u"&&(a={}),typeof a[i]<"u")return i;if(a[i]=o,this.messages.set(n,a),s===k_.inbound){let c=this.messagesWithoutClientAck.get(n)||{};this.messagesWithoutClientAck.set(n,wze(yze({},c),{[i]:o}))}return await this.persist(),i}),va(this,"get",n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o}),va(this,"getWithoutAck",n=>{this.isInitialized();let o={};for(let s of n){let i=this.messagesWithoutClientAck.get(s)||{};o[s]=Object.values(i)}return o}
vendor: 17,116 bytes, line 78
78),va(this,"has",(n,o)=>{this.isInitialized();let s=this.get(n),i=Oi(o);return typeof s[i]<"u"}),va(this,"ack",async(n,o)=>{this.isInitialized();let s=this.messagesWithoutClientAck.get(n);if(typeof s>"u")return;let i=Oi(o);delete s[i],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(n):this.messagesWithoutClientAck.set(n,s),await this.persist()}),va(this,"del",async n=>{this.isInitialized(),this.messages.delete(n),this.messagesWithoutClientAck.delete(n),await this.persist()}),this.logger=br(t,this.name),this.core=r}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,b_(t))}async setRelayerMessagesWithoutClientAck(t){await this.core.storage.setItem(this.storageKeyWithoutClientAck,b_(t))}async getRelayerMessages(){let t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?x_(t):void 0}async getRelayerMessagesWithoutClientAck(){let t=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof t<"u"?x_(t):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},bze=Object.defineProperty,xze=Object.defineProperties,vze=Object.getOwnPropertyDescriptors,fme=Object.getOwnPropertySymbols,Eze=Object.prototype.hasOwnProperty,Aze=Object.prototype.propertyIsEnumerable,X$=(e,t,r)=>t in e?bze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p6=(e,t)=>{for(var r in t||(t={}))Eze.call(t,r)&&X$(e,r,t[r]);if(fme)for(var r of fme(t))Aze.call(t,r)&&X$(e,r,t[r]);return e},hme=(e,t)=>xze(e,vze(t)),cc=(e,t,r)=>X$(e,typeof t!="symbol"?t+"":t,r),eF=class extends bT{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,cc(this,"events",new sf.EventEmitter),cc(this,"name",bFe),cc(this,"queue",new Map),cc(this,"publishTimeout",(0,Ke.toMiliseconds)(Ke.ONE_MINUTE)),cc(this,"initialPublishTimeout",(0,Ke.toMiliseconds)(Ke.ONE_SECOND*15)),cc(this,"needsTransportRestart",!1),cc(this,"publish",async(n,o,s)=>{var i,a,c,l,u;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:s}});let d=s?.ttl||wFe,p=s?.prompt||!1,f=s?.tag||0,m=s?.id||bn().toString(),g=Mg(k3().protocol),y={id:m,method:s?.publishMethod||g.publish,params:p6({topic:n,message:o,ttl:d,prompt:p,tag:f,attestation:s?.attestation},s?.tvf)},b=`Failed to publish payload, please try again. id:${m} tag:${f}`;try{_n((i=y.params)==null?void 0:i.prompt)&&((a=y.params)==null||delete a.prompt),_n((c=y.params)==null?void 0:c.tag)&&((l=y.params)==null||delete l.tag);let C=new Promise(async w=>{let x=({id:P})=>{var D;((D=y.id)==null?void 0:D.toString())===P.toString()&&(this.removeRequestFromQueue(P),this.relayer.events.removeListener(hn.publish,x),w())};this.relayer.events.on(hn.publish,x);let S=nl(new Promise((P,D)=>{this.rpcPublish(y,s).then(P).catch(U=>{this.logger.warn(U,U?.message),D(U)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${m} tag:${f}`);try{await S,this.events.removeListener(hn.publish,x)}catch(P){this.queue.set(m,{request:y,opts:s,attempt:1}),this.logger.warn(P,P?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:m,topic:n,message:o,opts:s}}),await nl(C,this.publishTimeout,b)}catch(C){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(C),(u=s?.internal)!=null&&u.throwOnFailedPublish)throw C}finally{this.queue.delete(m)}}),cc(this,"publishCustom",async n=>{var o,s,i,a,c;this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:n});let{payload:l,opts:u={}}=n,{attestation:d,tvf:p,publishMethod:f,prompt:m,tag:g,ttl:y=Ke.FIVE_MINUTES}=u,b=u.id||bn().toString(),C=Mg(k3().protocol),w=f||C.publish,x={id:b,method:w,params:p6(hme(p6({},l),{ttl:y,prompt:m,tag:g,attestation:d}),p)},S=`Failed to publish custom payload, please try again. id:${b} tag:${g}`;try{_n((o=x.params)==null?void 0:o.prompt)&&((s=x.params)==null||delete s.prompt),_n((i=x.params)==null?void 0:i.tag)&&((a=x.params)==null||delete a.tag);let P=new Promise(async D=>{let U=({id:L})=>{var I;((I=x.id)==null?void 0:I.toString())===L.toString()&&(this.removeRequestFromQueue(L),this.relayer.events.removeListener(hn.publish,U),D())};this.relayer.events.on(hn.publish,U);let N=nl(new Promise((L,I)=>{this.rpcPublish(x,u).then(L).catch(R=>{this.logger.warn(R,R?.message),I(R)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${w} id:${b} tag:${g}`);try{await N,this.events.removeListener(hn.publish,U)}catch(L){this.queue.set(b,{request:x,opts:u,attempt:1}),this.logger.warn(L,L?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:b,payload:l,opts:u}}),await nl(P,this.publishTimeout,S)}catch(P){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(P),(c=u?.internal)!=null&&c.throwOnFailedPublish)throw P}finally{this.queue.delete(b)}}),cc(this,"on",(n,o)=>{this.events.on(n,o)}),cc(this,"once",(n,o)=>{this.events.once(n,o)}),cc(this,"off",(n,o)=>{this.events.off(n,o)}),cc(this,"removeListener",(n,o)=>{this.events.removeListener(n,o)}),this.relayer=t,this.logger=br(r,this.name),this.registerEventListeners()}get context(){return rr(this.logger)}async rpcPublish(t,r){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:t});let n=await this.relayer.request(t);return this.relayer.events.emit(hn.publish,p6(p6({},t),r)),this.logger.debug("Successfully Published Payload"),n}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async(t,r)=>{var n;let o=t.attempt+1;this.queue.set(r,hme(p6({},t),{attempt:o})),this.logger.warn({},`Publisher: queue->publishing: ${t.request.id}, tag: ${(n=t.request.params)==null?void 0:n.tag}, attempt: ${o}`),await this.rpcPublish(t.request,t.opts),this.logger.warn({},`Publisher: queue->published: ${t.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Bs.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(hn.connection_stalled);return}this.checkQueue()}),this.relayer.on(hn.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}},Cze=Object.defineProperty,Sze=(e,t,r)=>t in e?Cze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f6=(e,t,r)=>Sze(e,typeof t!="symbol"?t+"":t,r),tF=class{constructor(){f6(this,"map",new Map),f6(this,"set",(t,r)=>{let n=this.get(t);this.exists(t,r)||this.map.set(t,[...n,r])}),f6(this,"get",t=>this.map.get(t)||[]),f6(this,"exists",(t,r)=>this.get(t).includes(r)),f6(this,"delete",(t,r)=>{if(typeof r>"u"){this.map.delete(t);return}if(!this.map.has(t))return;let n=this.get(t);if(!this.exists(t,r))return;let o=n.filter(s=>s!==r);if(!o.length){this.map.delete(t);return}this.map.set(t,o)}),f6(this,"clear",()=>{this.map.clear()})}get topics(){return Array.from(this.map.keys())}},Ize=Object.defineProperty,Tze=Object.defineProperties,_ze=Object.getOwnPropertyDescriptors,mme=Object.getOwnPropertySymbols,Pze=Object.prototype.hasOwnProperty,Nze=Object.prototype.propertyIsEnumerable,rF=(e,t,r)=>t in e?Ize(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,M3=(e,t)=>{for(var r in t||(t={}))Pze.call(t,r)&&rF(e,r,t[r]);if(mme)for(var r of mme(t))Nze.call(t,r)&&rF(e,r,t[r]);return e},M$=(e,t)=>Tze(e,_ze(t)),Tr=(e,t,r)=>rF(e,typeof t!="symbol"?t+"":t,r),nF=class extends ET{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,Tr(this,"subscriptions",new Map),Tr(this,"topicMap",new tF),Tr(this,"events",new sf.EventEmitter),Tr(this,"name",IFe),Tr(this,"version",TFe),Tr(this,"pending",new Map),Tr(this,"cached",[]),Tr(this,"initialized",!1),Tr(this,"storagePrefix",pu),Tr(this,"subscribeTimeout",(0,Ke.toMiliseconds)(Ke.ONE_MINUTE)),Tr(this,"initialSubscribeTimeout",(0,Ke.toMiliseconds)(Ke.ONE_SECOND*15)),Tr(this,"clientId"),Tr(this,"batchSubscribeTopicsLimit",500),Tr(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),Tr(this,"subscribe",async(n,o)=>{var s;this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{let i=k3(o),a={topic:n,relay:i,transportType:o?.transportType};(s=o?.internal)!=null&&s.skipSubscribe||this.pending.set(n,a);let c=await this.rpcSubscribe(n,i,o);return typeof c=="string"&&(this.onSubscribe(c,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}})),c}catch(i){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(i),i}}),Tr(this,"unsubscribe",async(n,o)=>{this.isInitialized(),typeof o?.id<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)}),Tr(this,"isSubscribed",n=>new Promise(o=>{o(this.topicMap.topics.includes(n))})),Tr(this,"isKnownTopic",n=>new Promise(o=>{o(this.topicMap.topics.includes(n)||this.pending.has(n)||this.cached.some(s=>s.topic===n))})),Tr(this,"on",(n,o)=>{this.events.on(n,o)}),Tr(this,"once",(n,o)=>{this.events.once(n,o)}),Tr(this,"off",(n,o)=>{this.events.off(n,o)}),Tr(this,"removeListener",(n,o)=>{this.events.removeListener(n,o)}),Tr(this,"start",async()=>{await this.onConnect()}),Tr(this,"stop",async()=>{await this.onDisconnect()}),Tr(this,"restart",async()=>{await this.restore(),await this.onRestart()}),Tr(this,"checkPending",async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let n=[];this.pending.forEach(o=>{n.push(o)}),await this.batchSubscribe(n)}),Tr(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(Bs.pulse,async()=>{await this.checkPending()}),this.events.on(Ea.created,async n=>{let o=Ea.created;this.logger.info(`Emitting ${o}`),this.logger.debug({type:"event",event:o,data:n}),await this.persist()}),this.events.on(Ea.deleted,async n=>{let o=Ea.deleted;this.logger.info(`Emitting ${o}`),this.logger.debug({type:"event",event:o,data:n}),await this.persist()})}),this.relayer=t,this.logger=br(r,this.name),this.clientId=""}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(t,r){let n=!1;try{n=this.getSubscription(t).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,r){let n=this.topicMap.get(t);await Promise.all(n.map(async o=>await this.unsubscribeById(t,o,r)))}async unsubscribeById(t,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}});try{let o=k3(n);await this.restartToComplete({topic:t,id:r,relay:o}),await this.rpcUnsubscribe(t,r,o);let s=Ir("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(t,r,n){var o,s;let i=await this.getSubscriptionId(t);if((o=n?.internal)!=null&&o.skipSubscribe)return i;(!n||n?.transportType===Lr.relay)&&await this.restartToComplete({topic:t,id:t,relay:r});let a={method:Mg(r.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});let c=(s=n?.internal)==null?void 0:s.throwOnFailedPublish;try{if(n?.transportType===Lr.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(d=>this.logger.warn(d))},(0,Ke.toMiliseconds)(Ke.ONE_SECOND)),i;let l=new Promise(async d=>{let p=f=>{f.topic===t&&(this.events.removeListener(Ea.created,p),d(f.id))};this.events.on(Ea.created,p);try{let f=await nl(new Promise((m,g)=>{this.relayer.request(a).catch(y=>{this.logger.warn(y,y?.message),g(y)}).then(m)}),this.initialSubscribeTimeout,`Subscribing to ${t} failed, please try again`);this.events.removeListener(Ea.created,p),d(f)}catch{}}),u=await nl(l,this.subscribeTimeout,`Subscribing to ${t} failed, please try again`);if(!u&&c)throw new Error(`Subscribing to ${t} failed, please try again`);return u?i:null}catch(l){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(hn.connection_stalled),c)throw l}return null}async rpcBatchSubscribe(t){if(!t.length)return!0;let r=t[0].relay,n={method:Mg(r.protocol).batchSubscribe,params:{topics:t.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await nl(new Promise((o,s)=>{this.relayer.request(n).then(o).catch(i=>{this.logger.warn(i),s(i)})}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again"),!0}catch{return this.relayer.events.emit(hn.connection_stalled),!1}}async rpcBatchFetchMessages(t){if(!t.length)return;let r=t[0].relay,n={method:Mg(r.protocol).batchFetchMessages,params:{topics:t.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let o;try{o=await await nl(new Promise((s,i)=>{this.relayer.request(n).catch(a=>{this.logger.warn(a),i(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(hn.connection_stalled)}return o}rpcUnsubscribe(t,r,n){let o={method:Mg(n.protocol).unsubscribe,params:{topic:t,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(t,r){this.setSubscription(t,M$(M3({},r),{id:t})),this.pending.delete(r.topic)}onBatchSubscribe(t){t.length&&t.forEach(r=>{this.setSubscription(r.id,M3({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(t,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,t)&&this.deleteSubscription(r,n),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:r}),this.addSubscription(t,r)}addSubscription(t,r){this.subscriptions.set(t,M3({},r)),this.topicMap.set(r.topic,t),this.events.emit(Ea.created,r)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});let r=this.subscriptions.get(t);if(!r){let{message:n}=Ae("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}deleteSubscription(t,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:r});let n=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(n.topic,t),this.events.emit(Ea.deleted,M$(M3({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Ea.sync)}async onRestart(){if(this.cached.length){let t=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<r;n++){let o=t.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(o)}}this.events.emit(Ea.resubscribed)}async restore(){try{let t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size&&!t.every(r=>{var n;return r.topic===((n=this.subscriptions.get(r.id))==null?void 0:n.topic)})){let{message:r}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(t.length){if(!await this.rpcBatchSubscribe(t)){this.logger.warn(`Batch subscribe failed for ${t.length} topics, adding to pending for retry`),t.forEach(r=>{this.pending.set(r.topic,r)});return}this.onBatchSubscribe(await Promise.all(t.map(async r=>M$(M3({}
78,r),{id:await this.getSubscriptionId(r.topic)}))))}}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);let r=await this.rpcBatchFetchMessages(t);r&&r.messages&&(await Phe((0,Ke.toMiliseconds)(Ke.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(t){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(t),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(t){return Oi(t+await this.getClientId())}},Rze=Object.defineProperty,gme=Object.getOwnPropertySymbols,Oze=Object.prototype.hasOwnProperty,Bze=Object.prototype.propertyIsEnumerable,oF=(e,t,r)=>t in e?Rze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yme=(e,t)=>{for(var r in t||(t={}))Oze.call(t,r)&&oF(e,r,t[r]);if(gme)for(var r of gme(t))Bze.call(t,r)&&oF(e,r,t[r]);return e},Bt=(e,t,r)=>oF(e,typeof t!="symbol"?t+"":t,r),sF=class extends xT{constructor(t){var r;super(t),Bt(this,"protocol","wc"),Bt(this,"version",2),Bt(this,"core"),Bt(this,"logger"),Bt(this,"events",new sf.EventEmitter),Bt(this,"provider"),Bt(this,"messages"),Bt(this,"subscriber"),Bt(this,"publisher"),Bt(this,"name",vFe),Bt(this,"transportExplicitlyClosed",!1),Bt(this,"initialized",!1),Bt(this,"connectionAttemptInProgress",!1),Bt(this,"relayUrl"),Bt(this,"projectId"),Bt(this,"packageName"),Bt(this,"bundleId"),Bt(this,"hasExperiencedNetworkDisruption",!1),Bt(this,"pingTimeout"),Bt(this,"heartBeatTimeout",(0,Ke.toMiliseconds)(Ke.THIRTY_SECONDS+Ke.FIVE_SECONDS)),Bt(this,"reconnectTimeout"),Bt(this,"connectPromise"),Bt(this,"reconnectInProgress",!1),Bt(this,"requestsInFlight",[]),Bt(this,"connectTimeout",(0,Ke.toMiliseconds)(Ke.ONE_SECOND*15)),Bt(this,"stalledRestartInProgress",!1),Bt(this,"stalledRestartTimeout"),Bt(this,"stalledRestartBackoff",0),Bt(this,"stalledRestartBaseInterval",(0,Ke.toMiliseconds)(Ke.ONE_SECOND*2)),Bt(this,"stalledRestartMaxInterval",(0,Ke.toMiliseconds)(Ke.THIRTY_SECONDS)),Bt(this,"request",async n=>{var o,s;this.logger.debug("Publishing Request Payload");let i=n.id||bn().toString();await this.toEstablishConnection();try{this.logger.trace({id:i,method:n.method,topic:(o=n.params)==null?void 0:o.topic},"relayer.request - publishing...");let a=`${i}:${((s=n.params)==null?void 0:s.tag)||""}`;this.requestsInFlight.push(a);let c=await this.provider.request(n);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==a),c}catch(a){throw this.logger.debug(`Failed to Publish Request: ${i}`),a}}),Bt(this,"resetPingTimeout",()=>{I3()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var n,o,s,i;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(i=(s=(o=(n=this.provider)==null?void 0:n.connection)==null?void 0:o.socket)==null?void 0:s.terminate)==null||i.call(s)}catch(a){this.logger.warn(a,a?.message)}},this.heartBeatTimeout))}),Bt(this,"onPayloadHandler",n=>{this.onProviderPayload(n),this.resetPingTimeout()}),Bt(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \u{1F6DC}"),this.startPingTimeout(),this.events.emit(hn.connect)}),Bt(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \u{1F6D1}"),this.requestsInFlight=[],this.onProviderDisconnect()}),Bt(this,"onProviderErrorHandler",n=>{this.logger.fatal(`Fatal socket error: ${n.message}`),this.events.emit(hn.error,n),this.logger.fatal("Fatal socket error received, closing transport"),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(o=>this.logger.warn(o))}),Bt(this,"registerProviderListeners",()=>{this.provider.on(ac.payload,this.onPayloadHandler),this.provider.on(ac.connect,this.onConnectHandler),this.provider.on(ac.disconnect,this.onDisconnectHandler),this.provider.on(ac.error,this.onProviderErrorHandler)}
vendor: 10,253 bytes, line 78
78),this.core=t.core,this.logger=d6({logger:(r=t.logger)!=null?r:xFe,name:this.name}),this.messages=new Q$(this.logger,t.core),this.subscriber=new nF(this,this.logger),this.publisher=new eF(this,this.logger),this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||Rme,bhe()?this.packageName=i$():xhe()&&(this.bundleId=i$()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(t=>this.logger.warn(t,t?.message))}get context(){return rr(this.logger)}get connected(){var t,r,n;return((n=(r=(t=this.provider)==null?void 0:t.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1||!1}get connecting(){var t,r,n;return((n=(r=(t=this.provider)==null?void 0:t.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0||this.connectPromise!==void 0||!1}async publish(t,r,n){this.isInitialized(),await this.publisher.publish(t,r,n),await this.recordMessageEvent({topic:t,message:r,publishedAt:Date.now(),transportType:Lr.relay},k_.outbound)}async publishCustom(t){this.isInitialized(),await this.publisher.publishCustom(t)}async subscribe(t,r){var n,o,s;this.isInitialized(),(!(r!=null&&r.transportType)||r?.transportType==="relay")&&await this.toEstablishConnection();let i=typeof((n=r?.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(o=r?.internal)==null?void 0:o.throwOnFailedPublish,a=((s=this.subscriber.topicMap.get(t))==null?void 0:s[0])||"",c,l=u=>{u.topic===t&&(this.subscriber.off(Ea.created,l),c())};return await Promise.all([new Promise(u=>{c=u,this.subscriber.on(Ea.created,l)}),new Promise(async(u,d)=>{a=await this.subscriber.subscribe(t,yme({internal:{throwOnFailedPublish:i}},r)).catch(p=>{i&&d(p)})||a,u()})]),a}async unsubscribe(t,r){this.isInitialized(),await this.subscriber.unsubscribe(t,r)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await nl(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(t){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(t).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(t){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await U$())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(t?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let r=t.sort((n,o)=>n.publishedAt-o.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(let n of r)try{await this.onMessageEvent(n)}catch(o){this.logger.warn(o,"Error while processing batch message event: "+o?.message)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(t,r){let{topic:n}=t;if(!r.sessionExists){let o=sn(Ke.FIVE_MINUTES),s={topic:n,expiry:o,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(hn.message,t),await this.recordMessageEvent(t,k_.inbound)}async connect(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,o)=>{let s=()=>{o(new Error("Connection interrupted while trying to connect"))};this.provider.once(ac.disconnect,s),await nl(new Promise((i,a)=>{this.provider.connect().then(i).catch(a)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(i=>{o(i)}).finally(()=>{this.provider.off(ac.disconnect,s),clearTimeout(this.reconnectTimeout)}),await new Promise(async(i,a)=>{let c=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(ac.disconnect,c),await this.subscriber.start().then(i).catch(a).finally(()=>{this.provider.off(ac.disconnect,c)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();let o=n;this.logger.warn({},o.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,(0,Ke.toMiliseconds)(r*1))),r++}}startPingTimeout(){var t,r,n,o,s;if(I3())try{(r=(t=this.provider)==null?void 0:t.connection)!=null&&r.socket&&((s=(o=(n=this.provider)==null?void 0:n.connection)==null?void 0:o.socket)==null||s.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(i){this.logger.warn(i,i?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ji(new dy(Ehe({sdkVersion:$$,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(t,r){let{topic:n,message:o}=t;await this.messages.set(n,o,r)}async shouldIgnoreMessageEvent(t){let{topic:r,message:n}=t;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(r))return this.logger.warn(`Ignoring message for unknown topic ${r}`),!0;let o=this.messages.has(r,n);return o&&this.logger.warn(`Ignoring duplicate message: ${n}`),o}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),Cc(t)){if(!t.method.endsWith(EFe))return;let r=t.params,{topic:n,message:o,publishedAt:s,attestation:i}=r.data,a={topic:n,message:o,publishedAt:s,transportType:Lr.relay,attestation:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(yme({type:"event",event:r.id},a)),this.events.emit(r.id,a),await this.acknowledgePayload(t),await this.onMessageEvent(a)}else Gi(t)&&this.events.emit(hn.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(await this.recordMessageEvent(t,k_.inbound),this.events.emit(hn.message,t))}async acknowledgePayload(t){let r=oo(t.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(ac.payload,this.onPayloadHandler),this.provider.off(ac.connect,this.onConnectHandler),this.provider.off(ac.disconnect,this.onDisconnectHandler),this.provider.off(ac.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await U$();tme(async r=>{t!==r&&(t=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Bs.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&rme())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(r){this.logger.warn(r,r?.message)}}),this.events.on(hn.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let r=this.stalledRestartBackoff===0?0:Math.min(Math.pow(2,this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${r?` in ${r}ms`:""}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(n){this.logger.error(n,n?.message)}finally{this.stalledRestartInProgress=!1}},r)})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(hn.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t,t?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,Ke.toMiliseconds)(AFe)))))}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}};Dze="[object RegExp]",Uze="[object String]",Lze="[object Number]",Mze="[object Boolean]",xme="[object Arguments]",Hze="[object Symbol]",$ze="[object Date]",Fze="[object Map]",Vze="[object Set]",zze="[object Array]",jze="[object Function]",qze="[object ArrayBuffer]",H$="[object Object]",Wze="[object Error]",Kze="[object DataView]",Zze="[object Uint8Array]",Gze="[object Uint8ClampedArray]",Yze="[object Uint16Array]",Jze="[object Uint32Array]",Qze="[object BigUint64Array
78]",Xze="[object Int8Array]",eje="[object Int16Array]",tje="[object Int32Array]",rje="[object BigInt64Array]",nje="[object Float32Array]",oje="[object Float64Array]";cje=Object.defineProperty,Eme=Object.getOwnPropertySymbols,lje=Object.prototype.hasOwnProperty,uje=Object.prototype.propertyIsEnumerable,iF=(e,t,r)=>t in e?cje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ame=(e,t)=>{for(var r in t||(t={}))lje.call(t,r)&&iF(e,r,t[r]);if(Eme)for(var r of Eme(t))uje.call(t,r)&&iF(e,r,t[r]);return e},Bi=(e,t,r)=>iF(e,typeof t!="symbol"?t+"":t,r),fu=class extends vT{constructor(t,r,n,o=pu,s=void 0){super(t,r,n,o),this.core=t,this.logger=r,this.name=n,Bi(this,"map",new Map),Bi(this,"version",CFe),Bi(this,"cached",[]),Bi(this,"initialized",!1),Bi(this,"getKey"),Bi(this,"storagePrefix",pu),Bi(this,"recentlyDeleted",[]),Bi(this,"recentlyDeletedLimit",200),Bi(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>{this.getKey&&i!==null&&!_n(i)?this.map.set(this.getKey(i),i):F0e(i)?this.map.set(i.id,i):V0e(i)&&this.map.set(i.topic,i)}),this.cached=[],this.initialized=!0)}),Bi(this,"set",async(i,a)=>{this.isInitialized(),this.map.has(i)?await this.update(i,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:i,value:a}),this.map.set(i,a),await this.persist())}),Bi(this,"get",i=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:i}
vendor: 11,657 bytes, line 78
78),this.getData(i))),Bi(this,"getAll",i=>(this.isInitialized(),i?this.values.filter(a=>Object.keys(i).every(c=>aje(a[c],i[c]))):this.values)),Bi(this,"update",async(i,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:i,update:a});let c=Ame(Ame({},this.getData(i)),a);this.map.set(i,c),await this.persist()}),Bi(this,"delete",async(i,a)=>{this.isInitialized(),this.map.has(i)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:i,reason:a}),this.map.delete(i),this.addToRecentlyDeleted(i),await this.persist())}),this.logger=br(r,this.name),this.storagePrefix=o,this.getKey=s}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){let r=this.map.get(t);if(!r){if(this.recentlyDeleted.includes(t)){let{message:o}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(o),new Error(o)}let{message:n}=Ae("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{let t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){let{message:r}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},dje=Object.defineProperty,pje=(e,t,r)=>t in e?dje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ft=(e,t,r)=>pje(e,typeof t!="symbol"?t+"":t,r),aF=class{constructor(t,r){this.core=t,this.logger=r,Ft(this,"name",_Fe),Ft(this,"version",PFe),Ft(this,"events",new sf.default),Ft(this,"pairings"),Ft(this,"initialized",!1),Ft(this,"storagePrefix",pu),Ft(this,"ignoredPayloadTypes",[ol]),Ft(this,"registeredMethods",[]),Ft(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),Ft(this,"register",({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]}),Ft(this,"create",async n=>{this.isInitialized();let o=R_(),s=await this.core.crypto.setSymKey(o),i=sn(Ke.FIVE_MINUTES),a={protocol:gF},c={topic:s,expiry:i,relay:a,active:!1,methods:n?.methods},l=P$({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:o,relay:a,expiryTimestamp:i,methods:n?.methods});return this.events.emit(am.create,c),this.core.expirer.set(s,i),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n?.transportType,internal:n?.internal}),{topic:s,uri:l}}),Ft(this,"pair",async n=>{this.isInitialized();let o=this.core.eventClient.createEvent({properties:{topic:n?.uri,trace:[al.pairing_started]}});this.isValidPair(n,o);let{topic:s,symKey:i,relay:a,expiryTimestamp:c,methods:l}=_$(n.uri);o.props.properties.topic=s,o.addTrace(al.pairing_uri_validation_success),o.addTrace(al.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),o.addTrace(al.existing_pairing),u.active)throw o.setError(du.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);o.addTrace(al.pairing_not_expired)}let d=c||sn(Ke.FIVE_MINUTES),p={topic:s,relay:a,expiry:d,active:!1,methods:l};this.core.expirer.set(s,d),await this.pairings.set(s,p),o.addTrace(al.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(am.create,p),o.addTrace(al.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(i,s),o.addTrace(al.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{o.setError(du.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(f){throw o.setError(du.subscribe_pairing_topic_failure),f}return o.addTrace(al.subscribe_pairing_topic_success),p}),Ft(this,"activate",async({topic:n})=>{this.isInitialized();let o=sn(Ke.FIVE_MINUTES);this.core.expirer.set(n,o),await this.pairings.update(n,{active:!0,expiry:o})}),Ft(this,"ping",async n=>{this.isInitialized(),await this.isValidPing(n),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:o}=n;if(this.pairings.keys.includes(o)){let s=await this.sendRequest(o,"wc_pairingPing",{}),{done:i,resolve:a,reject:c}=nf();this.events.once(sr("pairing_ping",s),({error:l})=>{l?c(l):a()}),await i()}}),Ft(this,"updateExpiry",async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})}),Ft(this,"updateMetadata",async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})}),Ft(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),Ft(this,"disconnect",async n=>{this.isInitialized(),await this.isValidDisconnect(n);let{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",Ir("USER_DISCONNECTED")),await this.deletePairing(o))}),Ft(this,"formatUriFromPairing",n=>{this.isInitialized();let{topic:o,relay:s,expiry:i,methods:a}=n,c=this.core.crypto.keychain.get(o);return P$({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:c,relay:s,expiryTimestamp:i,methods:a})}),Ft(this,"sendRequest",async(n,o,s)=>{let i=lr(o,s),a=await this.core.crypto.encode(n,i),c=L3[o].req;return this.core.history.set(n,i),this.core.relayer.publish(n,a,c),i.id}),Ft(this,"sendResult",async(n,o,s)=>{let i=oo(n,s),a=await this.core.crypto.encode(o,i),c=(await this.core.history.get(o,n)).request.method,l=L3[c].res;await this.core.relayer.publish(o,a,l),await this.core.history.resolve(i)}),Ft(this,"sendError",async(n,o,s)=>{let i=Zi(n,s),a=await this.core.crypto.encode(o,i),c=(await this.core.history.get(o,n)).request.method,l=L3[c]?L3[c].res:L3.unregistered_method.res;await this.core.relayer.publish(o,a,l),await this.core.history.resolve(i)}),Ft(this,"deletePairing",async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,Ir("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])}),Ft(this,"cleanup",async()=>{let n=this.pairings.getAll().filter(o=>xa(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))}),Ft(this,"onRelayEventRequest",async n=>{let{topic:o,payload:s}=n;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(o,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(o,s);default:return await this.onUnknownRpcMethodRequest(o,s)}}),Ft(this,"onRelayEventResponse",async n=>{let{topic:o,payload:s}=n,i=(await this.core.history.get(o,s.id)).request.method;return i==="wc_pairingPing"?this.onPairingPingResponse(o,s):this.onUnknownRpcMethodResponse(i)}),Ft(this,"onPairingPingRequest",async(n,o)=>{let{id:s}=o;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(am.ping,{id:s,topic:n})}catch(i){await this.sendError(s,n,i),this.logger.error(i)}}),Ft(this,"onPairingPingResponse",(n,o)=>{let{id:s}=o;setTimeout(()=>{Vr(o)?this.events.emit(sr("pairing_ping",s),{}):xr(o)&&this.events.emit(sr("pairing_ping",s),{error:o.error})},500)}),Ft(this,"onPairingDeleteRequest",async(n,o)=>{let{id:s}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(am.delete,{id:s,topic:n})}catch(i){await this.sendError(s,n,i),this.logger.error(i)}}),Ft(this,"onUnknownRpcMethodRequest",async(n,o)=>{let{id:s,method:i}=o;try{if(this.registeredMethods.includes(i))return;let a=Ir("WC_METHOD_UNSUPPORTED",i);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}}),Ft(this,"onUnknownRpcMethodResponse",n=>{this.registeredMethods.includes(n)||this.logger.error(Ir("WC_METHOD_UNSUPPORTED",n))}),Ft(this,"isValidPair",(n,o)=>{var s;if(!ys(n)){let{message:a}=Ae("MISSING_OR_INVALID",`pair() params: ${n}`);throw o.setError(du.malformed_pairing_uri),new Error(a)}if(!$0e(n.uri)){let{message:a}=Ae("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw o.setError(du.malformed_pairing_uri),new Error(a)}let i=_$(n?.uri);if(!((s=i?.relay)!=null&&s.protocol)){let{message:a}=Ae("MISSING_OR_INVALID","pair() uri#relay-protocol");throw o.setError(du.malformed_pairing_uri),new Error(a)}if(!(i!=null&&i.symKey)){let{message:a}=Ae("MISSING_OR_INVALID","pair() uri#symKey");throw o.setError(du.malformed_pairing_uri),new Error(a)}if(i!=null&&i.expiryTimestamp&&(0,Ke.toMiliseconds)(i?.expiryTimestamp)<Date.now()){o.setError(du.pairing_expired);let{message:a}=Ae("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(a)}}),Ft(this,"isValidPing",async n=>{if(!ys(n)){let{message:s}=Ae("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}let{topic:o}=n;await this.isValidPairingTopic(o)}),Ft(this,"isValidDisconnect",async n=>{if(!ys(n)){let{message:s}=Ae("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}let{topic:o}=n;await this.isValidPairingTopic(o)}),Ft(this,"isValidPairingTopic",async n=>{if(!fn(n,!1)){let{message:o}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){let{message:o}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(xa(this.pairings.get(n).expiry)){await this.deletePairing(n);let{message:o}=Ae("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}}),this.core=t,this.logger=br(r,this.name),this.pairings=new fu(this.core,this.logger,this.name,this.storagePrefix)}get context(){return rr(this.logger)}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(hn.message,async t=>{let{topic:r,message:n,transportType:o}=t;if(this.pairings.keys.includes(r)&&o!==Lr.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let s=await this.core.crypto.decode(r,n);Cc(s)?(this.core.history.set(r,s),await this.onRelayEventRequest({topic:r,payload:s})):Gi(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id)),await this.core.relayer.messages.ack(r,n)}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Aa.expired,async t=>{let{topic:r}=v_(t.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(am.expire,{topic:r}))})}},fje=Object.defineProperty,hje=(e,t,r)=>t in e?fje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oo=(e,t,r)=>hje(e,typeof t!="symbol"?t+"":t,r),cF=class extends yT{constructor(t,r){super(t,r),this.core=t,this.logger=r,Oo(this,"records",new Map),Oo(this,"events",new sf.EventEmitter),Oo(this,"name",NFe),Oo(this,"version",RFe),Oo(this,"cac
78hed",[]),Oo(this,"initialized",!1),Oo(this,"storagePrefix",pu),Oo(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),Oo(this,"set",(n,o,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:s}),this.records.has(o.id))return;let i={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:s,expiry:sn(Ke.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(il.created,i)}),Oo(this,"resolve",async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;let o=await this.getRecord(n.id);typeof o.response>"u"&&(o.response=xr(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.persist(),this.events.emit(il.updated,o))}),Oo(this,"get",async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o))),Oo(this,"delete",(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}),this.values.forEach(s=>{if(s.topic===n){if(typeof o<"u"&&s.id!==o)return;this.records.delete(s.id),this.events.emit(il.deleted,s)}}),this.persist()}),Oo(this,"exists",async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1)),Oo(this,"on",(n,o)=>{this.events.on(n,o)}),Oo(this,"once",(n,o)=>{this.events.once(n,o)}),Oo(this,"off",(n,o)=>{this.events.off(n,o)}),Oo(this,"removeListener",(n,o)=>{this.events.removeListener(n,o)}),this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let t=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;let n={topic:r.topic,request:lr(r.request.method,r.request.params,r.id),chainId:r.chainId};return t.push(n)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();let r=this.records.get(t);if(!r){let{message:n}=Ae("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(il.sync)}async restore(){try{let t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){let{message:r}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(il.created,t=>{let r=il.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(il.updated,t=>{let r=il.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(il.deleted,t=>{let r=il.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.core.heartbeat.on(Bs.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(r=>{(0,Ke.toMiliseconds)(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(il.deleted,r,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},mje=Object.defineProperty,gje=(e,t,r)=>t in e?mje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ws=(e,t,r)=>gje(e,typeof t!="symbol"?t+"":t,r),lF=class extends AT{constructor(t,r){super(t,r),this.core=t,this.logger=r,ws(this,"expirations",new Map),ws(this,"events",new sf.EventEmitter),ws(this,"name",OFe),ws(this,"version",BFe),ws(this,"cac
78hed",[]),ws(this,"initialized",!1),ws(this,"storagePrefix",pu),ws(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),ws(this,"has",n=>{try{let o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}}),ws(this,"set",(n,o)=>{this.isInitialized();let s=this.formatTarget(n),i={target:s,expiry:o};this.expirations.set(s,i),this.checkExpiry(s,i),this.events.emit(Aa.created,{target:s,expiration:i})}),ws(this,"get",n=>{this.isInitialized();let o=this.formatTarget(n);return this.getExpiration(o)}),ws(this,"del",n=>{if(this.isInitialized(),this.has(n)){let o=this.formatTarget(n),s=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Aa.deleted,{target:o,expiration:s})}}),ws(this,"on",(n,o)=>{this.events.on(n,o)}),ws(this,"once",(n,o)=>{this.events.once(n,o)}),ws(this,"off",(n,o)=>{this.events.off(n,o)}),ws(this,"removeListener",(n,o)=>{this.events.removeListener(n,o)}),this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if(typeof t=="string")return Che(t);if(typeof t=="number")return She(t);let{message:r}=Ae("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(r)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Aa.sync)}async restore(){try{let t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){let{message:r}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){let r=this.expirations.get(t);if(!r){let{message:n}=Ae("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(t,r){let{expiry:n}=r;(0,Ke.toMiliseconds)(n)-Date.now()<=0&&this.expire(t,r)}expire(t,r){this.expirations.delete(t),this.events.emit(Aa.expired,{target:t,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,r)=>this.checkExpiry(r,t))}registerEventListeners(){this.core.heartbeat.on(Bs.pulse,()=>this.checkExpirations()),this.events.on(Aa.created,t=>{let r=Aa.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on(Aa.expired,t=>{let r=Aa.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on(Aa.deleted,t=>{let r=Aa.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()})}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}},yje=Object.defineProperty,wje=(e,t,r)=>t in e?yje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ln=(e,t,r)=>wje(e,typeof t!="symbol"?t+"":t,r),uF=class extends CT{constructor(t,r,n){super(t,r,n),this.core=t,this.logger=r,this.store=n,Ln(this,"name",kFe),Ln(this,"abortController"),Ln(this,"isDevEnv"),Ln(this,"verifyUrlV3",UFe),Ln(this,"storagePrefix",pu),Ln(this,"version",Nme),Ln(this,"publicKey"),Ln(this,"fetchPromise"),Ln(this,"init",async()=>{var o;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,Ke.toMiliseconds)((o=this.publicKey)==null?void 0:o.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),Ln(this,"register",async o=>{if(!Ug()||this.isDevEnv)return;let s=window.location.origin,{id:i,decryptedId:a}=o,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${i}&decryptedId=${a}`;try{let l=(0,_me.getDocument)(),u=this.startAbortTimer(Ke.ONE_SECOND*5),d=await new Promise((p,f)=>{let m=()=>{window.removeEventListener("message",y),l.body.removeChild(g),f("attestation aborted")};this.abortController.signal.addEventListener("abort",m);let g=l.createElement("iframe");g.src=c,g.style.display="none",g.addEventListener("error",m,{signal:this.abortController.signal});let y=b=>
vendor: 11,432 bytes, line 78
78{if(b.data&&typeof b.data=="string")try{let C=JSON.parse(b.data);if(C.type==="verify_attestation"){if(Al(C.attestation).payload.id!==i)return;clearInterval(u),l.body.removeChild(g),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",y),p(C.attestation===null?"":C.attestation)}}catch(C){this.logger.warn(C)}};l.body.appendChild(g),window.addEventListener("message",y,{signal:this.abortController.signal})});return this.logger.debug(d,"jwt attestation"),d}catch(l){this.logger.warn(l)}return""}),Ln(this,"resolve",async o=>{if(this.isDevEnv)return"";let{attestationId:s,hash:i,encryptedId:a}=o;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(Al(s).payload.id!==a)return;let l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!i)return;let c=this.getVerifyUrl(o?.verifyUrl);return this.fetchAttestation(i,c)}),Ln(this,"fetchAttestation",async(o,s)=>{this.logger.debug(`resolving attestation: ${o} from url: ${s}`);let i=this.startAbortTimer(Ke.ONE_SECOND*5),a=await fetch(`${s}/attestation/${o}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(i),a.status===200?await a.json():void 0}),Ln(this,"getVerifyUrl",o=>{let s=o||h6;return LFe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${h6}`),s=h6),s}),Ln(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let o=this.startAbortTimer(Ke.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(o),await s.json()}catch(o){this.logger.warn(o)}}),Ln(this,"persistPublicKey",async o=>{this.logger.debug(o,"persisting public key to local storage"),await this.store.setItem(this.storeKey,o),this.publicKey=o}),Ln(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),Ln(this,"isValidJwtAttestation",async o=>{let s=await this.getPublicKey();try{if(s)return this.validateAttestation(o,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}let i=await this.fetchAndPersistPublicKey();try{if(i)return this.validateAttestation(o,i)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}}),Ln(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),Ln(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{let i=await this.fetchPublicKey();i&&(await this.persistPublicKey(i),s(i))});let o=await this.fetchPromise;return this.fetchPromise=void 0,o}),Ln(this,"validateAttestation",(o,s)=>{let i=D0e(o,s.publicKey),a={hasExpired:(0,Ke.toMiliseconds)(i.exp)<Date.now(),payload:i};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}}),this.logger=br(r,this.name),this.abortController=new AbortController,this.isDevEnv=_3(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return rr(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,Ke.toMiliseconds)(t))}},bje=Object.defineProperty,xje=(e,t,r)=>t in e?bje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cme=(e,t,r)=>xje(e,typeof t!="symbol"?t+"":t,r),dF=class extends ST{constructor(t,r){super(t,r),this.projectId=t,this.logger=r,Cme(this,"context",MFe),Cme(this,"registerDeviceToken",async n=>{let{clientId:o,token:s,notificationType:i,enableEncrypted:a=!1}=n,c=`${HFe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:o,type:i,token:s,always_raw:a})})}),this.logger=br(r,this.context)}},vje=Object.defineProperty,Sme=Object.getOwnPropertySymbols,Eje=Object.prototype.hasOwnProperty,Aje=Object.prototype.propertyIsEnumerable,pF=(e,t,r)=>t in e?vje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H3=(e,t)=>{for(var r in t||(t={}))Eje.call(t,r)&&pF(e,r,t[r]);if(Sme)for(var r of Sme(t))Aje.call(t,r)&&pF(e,r,t[r]);return e},yo=(e,t,r)=>pF(e,typeof t!="symbol"?t+"":t,r),fF=class extends IT{constructor(t,r,n=!0){super(t,r,n),this.core=t,this.logger=r,yo(this,"context",FFe),yo(this,"storagePrefix",pu),yo(this,"storageVersion",$Fe),yo(this,"events",new Map),yo(this,"shouldPersist",!1),yo(this,"init",async()=>{if(!_3())try{let o={eventId:u$(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:c$(this.core.relayer.protocol,this.core.relayer.version,$$)}}};await this.sendEvent([o])}catch(o){this.logger.warn(o)}}),yo(this,"createEvent",o=>{let{event:s="ERROR",type:i="",properties:{topic:a,trace:c}}=o,l=u$(),u=this.core.projectId||"",d=Date.now(),p=H3({eventId:l,timestamp:d,props:{event:s,type:i,properties:{topic:a,trace:c}},bundleId:u,domain:this.getAppDomain()},this.setMethods(l));return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p}),yo(this,"getEvent",o=>{let{eventId:s,topic:i}=o;if(s)return this.events.get(s);let a=Array.from(this.events.values()).find(c=>c.props.properties.topic===i);if(a)return H3(H3({},a),this.setMethods(a.eventId))}),yo(this,"deleteEvent",o=>{let{eventId:s}=o;this.events.delete(s),this.shouldPersist=!0}),yo(this,"setEventListeners",()=>{this.core.heartbeat.on(Bs.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(o=>{(0,Ke.fromMiliseconds)(Date.now())-(0,Ke.fromMiliseconds)(o.timestamp)>VFe&&(this.events.delete(o.eventId),this.shouldPersist=!0)})})}),yo(this,"setMethods",o=>({addTrace:s=>this.addTrace(o,s),setError:s=>this.setError(o,s)})),yo(this,"addTrace",(o,s)=>{let i=this.events.get(o);i&&(i.props.properties.trace.push(s),this.events.set(o,i),this.shouldPersist=!0)}),yo(this,"setError",(o,s)=>{let i=this.events.get(o);i&&(i.props.type=s,i.timestamp=Date.now(),this.events.set(o,i),this.shouldPersist=!0)}),yo(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),yo(this,"restore",async()=>{try{let o=await this.core.storage.getItem(this.storageKey)||[];if(!o.length)return;o.forEach(s=>{this.events.set(s.eventId,H3(H3({},s),this.setMethods(s.eventId)))})}catch(o){this.logger.warn(o)}}),yo(this,"submit",async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let o=[];for(let[s,i]of this.events)i.props.type&&o.push(i);if(o.length!==0)try{if((await this.sendEvent(o)).ok)for(let s of o)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}}),yo(this,"sendEvent",async o=>{let s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${zFe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${$$}${s}`,{method:"POST",body:JSON.stringify(o)})}),yo(this,"getAppDomain",()=>a$().url),this.logger=br(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}},Cje=Object.defineProperty,Ime=Object.getOwnPropertySymbols,Sje=Object.prototype.hasOwnProperty,Ije=Object.prototype.propertyIsEnumerable,hF=(e,t,r)=>t in e?Cje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tme=(e,t)=>{for(var r in t||(t={}))Sje.call(t,r)&&hF(e,r,t[r]);if(Ime)for(var r of Ime(t))Ije.call(t,r)&&hF(e,r,t[r]);return e},Ur=(e,t,r)=>hF(e,typeof t!="symbol"?t+"":t,r),mF=class e extends gT{constructor(t){var r;super(t),Ur(this,"protocol",Pme),Ur(this,"version",Nme),Ur(this,"name",D_),Ur(this,"relayUrl"),Ur(this,"projectId"),Ur(this,"customStoragePrefix"),Ur(this,"events",new sf.EventEmitter),Ur(this,"logger"),Ur(this,"heartbeat"),Ur(this,"relayer"),Ur(this,"crypto"),Ur(this,"storage"),Ur(this,"history"),Ur(this,"expirer"),Ur(this,"pairing"),Ur(this,"verify"),Ur(this,"echoClient"),Ur(this,"linkModeSupportedApps"),Ur(this,"eventClient"),Ur(this,"initialized",!1),Ur(this,"logChunkController"),Ur(this,"on",(a,c)=>this.events.on(a,c)),Ur(this,"once",(a,c)=>this.events.once(a,c)),Ur(this,"off",(a,c)=>this.events.off(a,c)),Ur(this,"removeListener",(a,c)=>this.events.removeListener(a,c)),Ur(this,"dispatchEnvelope",({topic:a,message:c,sessionExists:l})=>{if(!a||!c)return;let u={topic:a,message:c,publishedAt:Date.now(),transportType:Lr.link_mode};this.relayer.onLinkMessageEvent(u,{sessionExists:l})});let n=this.getGlobalCore(t?.customStoragePrefix);if(n)try{return this.customStoragePrefix=n.customStoragePrefix,this.logger=n.logger,this.heartbeat=n.heartbeat,this.crypto=n.crypto,this.history=n.history,this.expirer=n.expirer,this.storage=n.storage,this.relayer=n.relayer,this.pairing=n.pairing,this.verify=n.verify,this.echoClient=n.echoClient,this.linkModeSupportedApps=n.linkModeSupportedApps,this.eventClient=n.eventClient,this.initialized=n.initialized,this.logChunkController=n.logChunkController,n}catch(a){console.warn("Failed to copy global core",a)}this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||Rme,this.customStoragePrefix=t!=null&&t.customStoragePrefix?`:${t.customStoragePrefix}`:"";let o=ry({level:typeof t?.logger=="string"&&t.logger?t.logger:uFe.logger,name:D_}),{logger:s,chunkLoggerController:i}=Sl({opts:o,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=i,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,c;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((c=this.logChunkController)==null||c.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=br(s,this.name),this.heartbeat=new cy,this.crypto=new Y$(this,this.logger,t?.keychain),this.history=new cF(this,this.logger),this.expirer=new lF(this,this.logger),this.storage=t!=null&&t.storage?t.storage:new ly(Tme(Tme({},dFe),t?.storageOptions)),this.relayer=new sF({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new aF(this,this.logger),this.verify=new uF(this,this.logger,this.storage),this.echoClient=new dF(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new fF(this,this.logger,t?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let r=new e(t);await r.initialize();let n=await r.crypto.getClientId();return await r.storage.setItem(SFe,n),r}get context(){return rr(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var t;return(t=this.logChunkController)==null?void 0:t.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(sme,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
78),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(sme)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(t,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(t.message),t}}getGlobalCore(t=""){try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${t}`,n=`${r}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[n]} times.`),globalThis[r]}catch(r){console.warn("Failed to get global WalletConnect core",r);return}}setGlobalCore(t){var r;try{if(this.isGlobalCoreDisabled())return;let n=`_walletConnectCore_${((r=t.opts)==null?void 0:r.customStoragePrefix)||""}`;globalThis[n]=t}catch(n){console.warn("Failed to set global WalletConnect core",n)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&process.env.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}},jme=mF});var M_,It,Gme,Yme,Jme,NF,yF,Wme,Tje,Kme,_je,g6,Pje,ko,wF,hu,Nje,Rje,Oje,Bje,kje,Dje,Uje,Lje,H_,L_,Mje,Hje,$je,Zme,Fje,Vje,xF,ir,Do,be,vF,EF,AF,CF,SF,IF,TF,zje,jje,bF,_F,qje,Wje,Vt,PF,Qme,Xme=h(()=>{M_=Lt(Cs(),1);qme();eM();B_();jf();It=Lt(Sd(),1);Sc();Gme="wc",Yme=2,Jme="client",NF=`${Gme}@${Yme}:${Jme}:`,yF={name:Jme,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},Wme="WALLETCONNECT_DEEPLINK_CHOICE",Tje="proposal",Kme="Proposal expired",_je="session",g6=It.SEVEN_DAYS,Pje="engine",ko={wc_sessionPropose:{req:{ttl:It.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:It.ONE_DAY,prompt:!1,tag:1104},res:{ttl:It.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:It.ONE_DAY,prompt:!1,tag:1106},res:{ttl:It.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:It.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:It.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:It.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:It.ONE_DAY,prompt:!1,tag:1112},res:{ttl:It.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:It.ONE_DAY,prompt:!1,tag:1114},res:{ttl:It.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:It.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:It.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:It.FIVE_MINUTES,prompt:!1,tag:1119}}},wF={min:It.FIVE_MINUTES,max:It.SEVEN_DAYS},hu={idle:"IDLE",active:"ACTIVE"},Nje={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},Rje="request",Oje=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],Bje="wc",kje="auth",Dje="authKeys",Uje="pairingTopics",Lje="requests",H_=`${Bje}@${1.5}:${kje}:`,L_=`${H_}:PUB_KEY`,Mje=Object.defineProperty,Hje=Object.defineProperties,$je=Object.getOwnPropertyDescriptors,Zme=Object.getOwnPropertySymbols,Fje=Object.prototype.hasOwnProperty,Vje=Object.prototype.propertyIsEnumerable,xF=(e,t,r)=>t in e?Mje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ir=(e,t)=>{for(var r in t||(t={}))Fje.call(t,r)&&xF(e,r,t[r]);if(Zme)for(var r of Zme(t))Vje.call(t,r)&&xF(e,r,t[r]);return e},Do=(e,t)=>
vendor: 28,717 bytes, line 78
78Hje(e,$je(t)),be=(e,t,r)=>xF(e,typeof t!="symbol"?t+"":t,r),vF=class extends _T{constructor(t){super(t),be(this,"name",Pje),be(this,"events",new M_.default),be(this,"initialized",!1),be(this,"requestQueue",{state:hu.idle,queue:[]}),be(this,"sessionRequestQueue",{state:hu.idle,queue:[]}),be(this,"emittedSessionRequests",new d_({limit:500})),be(this,"requestQueueDelay",It.ONE_SECOND),be(this,"expectedPairingMethodMap",new Map),be(this,"recentlyDeletedMap",new Map),be(this,"recentlyDeletedLimit",200),be(this,"relayMessageCache",[]),be(this,"pendingSessions",new Map),be(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(ko)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,It.toMiliseconds)(this.requestQueueDelay)))}),be(this,"connect",async r=>{var n;this.isInitialized(),await this.confirmOnlineStateOrThrow();let o=Do(ir({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(o),o.optionalNamespaces=M0e(o.requiredNamespaces,o.optionalNamespaces),o.requiredNamespaces={};let{pairingTopic:s,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:c,scopedProperties:l,relays:u,authentication:d,walletPay:p}=o,f=((n=d?.[0])==null?void 0:n.ttl)||ko.wc_sessionPropose.req.ttl||It.FIVE_MINUTES;this.validateRequestExpiry(f);let m=s,g,y=!1;try{if(m){let N=this.client.core.pairing.pairings.get(m);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),y=N.active}}catch(N){throw this.client.logger.error(`connect() -> pairing.get(${m}) failed`),N}if(!m||!y){let{topic:N,uri:L}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});m=N,g=L}if(!m){let{message:N}=Ae("NO_MATCHING_KEY",`connect() pairing topic: ${m}`);throw new Error(N)}let b=await this.client.core.crypto.generateKeyPair(),C=sn(f),w=ir(Do(ir(ir({requiredNamespaces:i,optionalNamespaces:a,relays:u??[{protocol:gF}],proposer:{publicKey:b,metadata:this.client.metadata},expiryTimestamp:C,pairingTopic:m},c&&{sessionProperties:c}),l&&{scopedProperties:l}),{id:wn()}),(d||p)&&{requests:{authentication:d?.map(N=>{let{domain:L,chains:I,nonce:R,uri:A,exp:T,nbf:v,type:E,statement:O,requestId:B,resources:_,signatureTypes:M}=N;return{domain:L,chains:I,nonce:R,type:E??"caip122",aud:A,version:"1",iat:new Date().toISOString(),exp:T,nbf:v,statement:O,requestId:B,resources:_,signatureTypes:M}}),walletPay:p}}),x=sr("session_connect",w.id),{reject:S,resolve:P,done:D}=nf(f,Kme),U=({id:N})=>{N===w.id&&(this.client.events.off("proposal_expire",U),this.pendingSessions.delete(w.id),this.events.emit(x,{error:{message:Kme,code:0}}))};return this.client.events.on("proposal_expire",U),this.events.once(x,({error:N,session:L})=>{this.client.events.off("proposal_expire",U),N?S(N):L&&P(L)}),await this.setProposal(w.id,w),await this.sendProposeSession({proposal:w,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:w.id}}}).catch(N=>{throw this.deleteProposal(w.id),N}),{uri:g,approval:D}}),be(this,"pair",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}}),be(this,"approve",async r=>{var n,o,s;let i=this.client.core.eventClient.createEvent({properties:{topic:(n=r?.id)==null?void 0:n.toString(),trace:[lc.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(L){throw i.setError(cm.no_internet_connection),L}try{await this.isValidProposalId(r?.id)}catch(L){throw this.client.logger.error(`approve() -> proposal.get(${r?.id}) failed`),i.setError(cm.proposal_not_found),L}try{await this.isValidApprove(r)}catch(L){throw this.client.logger.error("approve() -> isValidApprove() failed"),i.setError(cm.session_approve_namespace_validation_failure),L}let{id:a,relayProtocol:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:p,proposalRequestsResponses:f}=r,m=this.client.proposal.get(a);this.client.core.eventClient.deleteEvent({eventId:i.eventId});let{pairingTopic:g,proposer:y,requiredNamespaces:b,optionalNamespaces:C}=m,w=(o=this.client.core.eventClient)==null?void 0:o.getEvent({topic:g});w||(w=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:lc.session_approve_started,properties:{topic:g,trace:[lc.session_approve_started,lc.session_namespaces_validation_success]}}));let x=await this.client.core.crypto.generateKeyPair(),S=y.publicKey,P=await this.client.core.crypto.generateSharedKey(x,S),D=Do(ir(ir(ir({relay:{protocol:c??"irn"},namespaces:l,controller:{publicKey:x,metadata:this.client.metadata},expiry:sn(g6)},u&&{sessionProperties:u}),d&&{scopedProperties:d}),p&&{sessionConfig:p}),{proposalRequestsResponses:f}),U=Lr.relay;w.addTrace(lc.subscribing_session_topic);try{await this.client.core.relayer.subscribe(P,{transportType:U,internal:{skipSubscribe:!0}})}catch(L){throw w.setError(cm.subscribe_session_topic_failure),L}w.addTrace(lc.subscribe_session_topic_success);let N=Do(ir({},D),{topic:P,requiredNamespaces:b,optionalNamespaces:C,pairingTopic:g,acknowledged:!1,self:D.controller,peer:{publicKey:y.publicKey,metadata:y.metadata},controller:x,transportType:Lr.relay,authentication:f?.authentication,walletPayResult:f?.walletPay});await this.client.session.set(P,N),w.addTrace(lc.store_session);try{await this.sendApproveSession({sessionTopic:P,proposal:m,pairingProposalResponse:{relay:{protocol:c??"irn"},responderPublicKey:x},sessionSettleRequest:D,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:ir({correlationId:a},this.getTVFApproveParams(N))}}),w.addTrace(lc.session_approve_publish_success)}catch(L){throw this.client.logger.error(L),this.client.session.delete(P,Ir("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(P),L}return this.client.core.eventClient.deleteEvent({eventId:w.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:y.metadata}),await this.deleteProposal(a),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(P,sn(g6)),{topic:P,acknowledged:()=>Promise.resolve(this.client.session.get(P))}}),be(this,"reject",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(i){throw this.client.logger.error("reject() -> isValidReject() failed"),i}let{id:n,reason:o}=r,s;try{s=this.client.proposal.get(n).pairingTopic}catch(i){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),i}s&&await this.sendError({id:n,topic:s,error:o,rpcOpts:ko.wc_sessionPropose.reject}),await this.deleteProposal(n)}),be(this,"update",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(d){throw this.client.logger.error("update() -> isValidUpdate() failed"),d}let{topic:n,namespaces:o}=r,{done:s,resolve:i,reject:a}=nf(It.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),c=wn(),l=bn().toString(),u=this.client.session.get(n).namespaces;return this.events.once(sr("session_update",c),({error:d})=>{d?a(d):i()}),await this.client.session.update(n,{namespaces:o}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:o},throwOnFailedPublish:!0,clientRpcId:c,relayRpcId:l}).catch(d=>{this.client.logger.error(d),this.client.session.update(n,{namespaces:u}),a(d)}),{acknowledged:s}}),be(this,"extend",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}let{topic:n}=r,o=wn(),{done:s,resolve:i,reject:a}=nf(It.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(sr("session_extend",o),({error:c})=>{c?a(c):i()}),await this.setExpiry(n,sn(g6)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:o,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}}),be(this,"request",async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}let{chainId:n,request:o,topic:s,expiry:i=ko.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);a?.transportType===Lr.relay&&await this.confirmOnlineStateOrThrow();let c=wn(),l=bn().toString(),{done:u,resolve:d,reject:p}=nf(i,"Request expired. Please try again.");this.events.once(sr("session_request",c),({error:y,result:b})=>{y?p(y):d(b)});let f="wc_sessionRequest",m=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(m)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:{request:Do(ir({},o),{expiryTimestamp:sn(i)}),chainId:n},expiry:i,throwOnFailedPublish:!0,appLink:m}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:o,chainId:n,id:c}),await u();let g={request:Do(ir({},o),{expiryTimestamp:sn(i)}),chainId:n};return await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:g,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,g)}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:o,chainId:n,id:c}),y()}),new Promise(async y=>{var b;if(!((b=a.sessionConfig)!=null&&b.disableDeepLink)){let C=await The(this.client.core.storage,Wme);await Ihe({id:c,topic:s,wcDeepLink:C})}y()}),u()]).then(y=>y[2])}),be(this,"respond",async r=>{var n,o;this.isInitialized();let s=this.client.core.eventClient.createEvent({properties:{topic:r?.topic||((o=(n=r?.response)==null?void 0:n.id)==null?void 0:o.toString()),trace:[lc.session_request_response_started]}});try{await this.isValidRespond(r)}catch(d){throw s.addTrace(d?.message),s.setError(cm.session_request_response_validation_failure),d}s.addTrace(lc.session_request_response_validation_success);let{topic:i,response:a}=r,{id:c}=a,l=this.client.session.get(i);l.transportType===Lr.relay&&await this.confirmOnlineStateOrThrow();let u=this.getAppLinkIfEnabled(l.peer.metadata,l.transportType);try{s.addTrace(lc.session_request_response_publish_started),Vr(a)?await this.sendResult({id:c,topic:i,result:a.result,throwOnFailedPublish:!0,appLink:u}):xr(a)&&await this.sendError({id:c,topic:i,error:a.error,appLink:u}),this.cleanupAfterResponse(r)}catch(d){throw s.addTrace(d?.message),s.setError(cm.session_request_response_publish_failure),d}}),be(this,"ping",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(o){throw this.client.logger.error("ping() -> isValidPing() failed"),o}let{topic:n}=r;if(this.client.session.keys.includes(n)){let o=wn(),s=bn().toString(),{done:i,resolve:a,reject:c}=nf(It.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(sr("session_ping",o),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}),i()])}else this.client.core.pairing.pairings.keys.includes(n)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:n}))}),be(this,"emit",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);let{topic:n,event:o,chainId:s}=r,i=bn().toString(),a=wn();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:o,chainId:s},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})}),be(this,"disconnect",async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);let{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:Ir("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{let{message:o}=Ae("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(o)}}),be(this,"find",r=>(this.isInitialized(),this.client.session.getAll().filter(n=>H0e(n,r)))),be(this,"getPendingSessionRequests",()=>this.client.pendingRequest.getAll()),be(this,"authenticate",async(r,n)=>{var o;this.isInitialized(),this.isValidAuthenticate(r);let s=n&&this.client.core.linkModeSupportedApps.includes(n)&&((o=this.client.metadata.redirect)==null?void 0:o.linkMode),i=s?Lr.link_mode:Lr.relay;i===Lr.relay&&await this.confirmOnlineStateOrThrow();let{chains:a,statement:c="",uri:l,domain:u,nonce:d,type:p,exp:f,nbf:m,methods:g=[],expiry:y}=r,b=[...r.resources||[]],{topic:C,uri:w}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:i});this.client.logger.info({message:"Generated new pairing",pairing:{topic:C,uri:w}});let x=await this.client.core.crypto.generateKeyPair(),S=c6(x);if(await Promise.all([this.client.auth.authKeys.set(L_,{responseTopic:S,publicKey:x}),this.client.auth.pairingTopics.set(S,{topic:S,pairingTopic:C})]),await this.client.core.relayer.subscribe(S,{transportType:i}),this.client.logger.info(`sending request to new pairing topic: ${C}`),g.length>0){let{namespace:_}=rl(a[0]),M=Zhe(_,"request",g);R3(b)&&(M=Ghe(M,b.pop())),b.push(M)}let P=y&&y>ko.wc_sessionAuthenticate.req.ttl?y:ko.wc_sessionAuthenticate.req.ttl,D={authPayload:{type:p??"caip122",chains:a,statement:c,aud:l,domain:u,version:"1",nonce:d,iat:new Date().toISOString(),exp:f,nbf:m,resources:b},requester:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:sn(P)},U={eip155:{chains:a,methods:[...new Set(["personal_sign",...g])],events:["chainChanged","accountsChanged"]}},N={requiredNamespaces:{},optionalNamespaces:U,relays:[{protocol:"irn"}],pairingTopic:C,proposer:{publicKey:x,metadata:this.client.metadata},expiryTimestamp:sn(ko.wc_sessionPropose.req.ttl),id:wn()},{done:L,resolve:I,reject:R}=nf(P,"Request expired"),A=wn(),T=sr("session_connect",N.id),v=sr("session_request",A),E=async({error:_,session:M})=>{this.events.off(v,O),_?R(_):M&&I({session:M})},O=async _=>{var M,F,q;if(await this.deletePendingAuthRequest(A,{message:"fulfilled",code:0}),_.error){let me=Ir("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return _.error.code===me.code?void 0:(this.events.off(T,E),R(_.error.message))}await this.deleteProposal(N.id),this.events.off(T,E);let{cacaos:oe,responder:Q}=_.result,Y=[],pe=[];for(let me of oe){await g$({cacao:me,projectId:this.client.core.projectId})||(this.client.logger.error(me,"Signature verification failed"),R(Ir("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:_e}=me,wt=R3(_e.resources),Nt=[I_(_e.iss)],bt=N3(_e.iss);if(wt){let ar=w$(wt),Ar=b$(wt);Y.push(...ar),Nt.push(...Ar)}for(let ar of Nt)pe.push(`${ar}:${bt}`)}let he=await this.client.core.crypto.generateSharedKey(x,Q.publicKey),Te;Y.length>0&&(Te={topic:he,acknowledged:!0,self:{publicKey:x,metadata:this.client.metadata},peer:Q,controller:Q.publicKey,expiry:sn(g6),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:C,namespaces:R$([...new Set(Y)],[...new Set(pe)]),transportType:i},await this.client.core.relayer.subscribe(he,{transportType:i}),await this.client.session.set(he,Te),C&&await this.client.core.pairing.updateMetadata({topic:C,metadata:Q.metadata}),Te=this.client.session.get(he)),(M=this.client.metadata.redirect)!=null&&M.linkMode&&(F=Q.metadata.redirect)!=null&&F.linkMode&&(q=Q.metadata.redirect)!=null&&q.universal&&n&&(this.client.core.addLinkModeSupportedApp(Q.metadata.redirect.universal),this.client.session.update(he,{transportType:Lr.link_mode})),I({auths:oe,session:Te})};this.events.once(T,E),this.events.once(v,O);let B;try{if(s){let _=lr("wc_sessionAuthenticate",D,A);this.client.core.history.set(C,_);let M=await this.client.core.crypto.encode("",_,{type:a6,encoding:of});B=D3(n,C,M)}else await Promise.all([this.sendRequest({topic:C,method:"wc_sessionAuthenticate",params:D,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:A}),this.sendRequest({topic:C,method:"wc_sessionPropose",params:N,expiry:ko.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:N.id})])}catch(_){throw this.events.off(T,E),this.events.off(v,O),_}return await this.setProposal(N.id,N),await this.setAuthRequest(A,{request:Do(ir({},D),{verifyContext:{}}),pairingTopic:C,transportType:i}),{uri:B??w,response:L}}),be(this,"approveSessionAuthenticate",async r=>{let{id:n,auths:o}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[lm.authenticated_session_approve_started]}});try{this.isInitialized()}catch(y){throw s.setError(m6.no_internet_connection),y}let i=this.getPendingAuthRequest(n);if(!i)throw s.setError(m6.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);let a=i.transportType||Lr.relay;a===Lr.relay&&await this.confirmOnlineStateOrThrow();let c=i.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=c6(c),d={type:ol,receiverPublicKey:c,senderPublicKey:l},p=[],f=[];for(let y of o){if(!await g$({cacao:y,projectId:this.client.core.projectId})){s.setError(m6.invalid_cacao);let S=Ir("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:S,encodeOpts:d}),new Error(S.message)}s.addTrace(lm.cacaos_verified);let{p:b}=y,C=R3(b.resources),w=[I_(b.iss)],x=N3(b.iss);if(C){let S=w$(C),P=b$(C);p.push(...S),w.push(...P)}for(let S of w)f.push(`${S}:${x}`)}let m=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(lm.create_authenticated_session_topic);let g;if(p?.length>0){g={topic:m,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:i.requester.metadata},controller:c,expiry:sn(g6),authentication:o,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:i.pairingTopic,namespaces:R$([...new Set(p)],[...new Set(f)]),transportType:a},s.addTrace(lm.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:a})}catch(y){throw s.setError(m6.subscribe_authenticated_session_topic_failure),y}s.addTrace(lm.subscribe_authenticated_session_topic_success),await this.client.session.set(m,g),s.addTrace(lm.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}s.addTrace(lm.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:o,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(y){throw s.setError(m6.authenticated_session_approve_publish_failure),y}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:g}}),be(this,"rejectSessionAuthenticate",async r=>{this.isInitialized();let{id:n,reason:o}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===Lr.relay&&await this.confirmOnlineStateOrThrow();let i=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=c6(i),l={type:ol,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:n,topic:c,error:o,encodeOpts:l,rpcOpts:ko.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.deleteProposal(n)}),be(this,"formatAuthMessage",r=>{this.isInitialized();let{request:n,iss:o}=r;return y$(n,o)}),be(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)}),be(this,"cleanupDuplicatePairings",async r=>{if(r.pairingTopic)try{let n=this.client.core.pairing.pairings.get(r.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(s=>{var i,a;return((i=s.peerMetadata)==null?void 0:i.url)&&((a=s.peerMetadata)==null?void 0:a.url)===r.peer.metadata.url&&s.topic&&s.topic!==n.topic});if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}}),be(this,"deleteSession",async r=>{var n;let{topic:o,expirerHasDeleted:s=!1,emitEvent:i=!0,id:a=0}=r,{self:c}=this.client.session.get(o);await this.client.core.relayer.unsubscribe(o),await this.client.session.delete(o,Ir("USER_DISCONNECTED")),this.addToRecentlyDeleted(o,"session"),this.client.core.crypto.keychain.has(c.publicKey)&&await this.client.core.crypto.deleteKeyPair(c.publicKey),this.client.core.crypto.keychain.has(o)&&await this.client.core.crypto.deleteSymKey(o),s||this.client.core.expirer.del(o),this.client.core.storage.removeItem(Wme).catch(l=>this.client.logger.warn(l)),o===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=hu.idle),await Promise.all(this.getPendingSessionRequests().filter(l=>l.topic===o).map(l=>this.deletePendingSessionRequest(l.id,Ir("USER_DISCONNECTED")))),i&&this.client.events.emit("session_delete",{id:a,topic:o})}),be(this,"deleteProposal",async(r,n)=>{if(n)try{let o=this.client.proposal.get(r);this.client.core.eventClient.getEvent({topic:o.pairingTopic})?.setError(cm.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,Ir("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")}),be(this,"deletePendingSessionRequest",async(r,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),o&&(this.sessionRequestQueue.state=hu.idle,this.client.events.emit("session_request_expire",{id:r}))}),be(this,"deletePendingAuthRequest",async(r,n,o=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)])}),be(this,"setExpiry",async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))}),be(this,"setProposal",async(r,n)=>{this.client.core.expirer.set(r,sn(ko.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)}),be(this,"setAuthRequest",async(r,n)=>{let{request:o,pairingTopic:s,transportType:i=Lr.relay}=n;this.client.core.expirer.set(r,o.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:o.authPayload,requester:o.requester,expiryTimestamp:o.expiryTimestamp,id:r,pairingTopic:s,verifyContext:o.verifyContext,transportType:i})}),be(this,"setPendingSessionRequest",async r=>{let{id:n,topic:o,params:s,verifyContext:i}=r,a=s.request.expiryTimestamp||sn(ko.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:o,params:s,verifyContext:i})}),be(this,"sendRequest",async r=>{let{topic:n,method:o,params:s,expiry:i,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d,publishOpts:p={}}=r,f=lr(o,s,c),m,g=!!u;try{let C=g?of:gs;m=await this.client.core.crypto.encode(n,f,{encoding:C})}catch(C){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),C}let y;if(Oje.includes(o)){let C=Oi(JSON.stringify(f)),w=Oi(m);y=await this.client.core.verify.register({id:w,decryptedId:C})}let b=ir(ir({},ko[o].req),p);if(b.attestation=y,i&&(b.ttl=i),a&&(b.id=a),this.client.core.history.set(n,f),g){let C=D3(u,n,m);await global.Linking.openURL(C,this.client.name)}else b.tvf=Do(ir({},d),{correlationId:f.id}),l?(b.internal=Do(ir({},b.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,m,b)):this.client.core.relayer.publish(n,m,b).catch(C=>this.client.logger.error(C));return f.id}),be(this,"sendProposeSession",async r=>{let{proposal:n,publishOpts:o}=r,s=lr("wc_sessionPropose",n,n.id);this.client.core.history.set(n.pairingTopic,s);let i=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:gs}),a=Oi(JSON.stringify(s)),c=Oi(i),l=await this.client.core.verify.register({id:c,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:n.pairingTopic,sessionProposal:i},opts:Do(ir({},o),{publishMethod:"wc_proposeSession",attestation:l})})}),be(this,"sendApproveSession",async r=>{let{sessionTopic:n,pairingProposalResponse:o,proposal:s,sessionSettleRequest:i,publishOpts:a}=r,c=oo(s.id,o),l=await this.client.core.crypto.encode(s.pairingTopic,c,{encoding:gs}),u=lr("wc_sessionSettle",i,a?.id),d=await this.client.core.crypto.encode(n,u,{encoding:gs});this.client.core.history.set(n,u),await this.client.core.relayer.publishCustom({payload:{sessionTopic:n,pairingTopic:s.pairingTopic,sessionProposalResponse:l,sessionSettlementRequest:d},opts:Do(ir({},a),{publishMethod:"wc_approveSession"})})}),be(this,"sendResult",async r=>{let{id:n,topic:o,result:s,throwOnFailedPublish:i,encodeOpts:a,appLink:c}=r,l=oo(n,s),u,d=c&&typeof(global==null?void 0:global.Linking)<"u";try{let m=d?of:gs;u=await this.client.core.crypto.encode(o,l,Do(ir({},a||{}),{encoding:m}))}catch(m){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${o} failed`),m}let p,f;try{p=await this.client.core.history.get(o,n);let m=p.request;try{f=this.getTVFParams(n,m.params,s)}catch(g){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${g?.message}`)}}catch(m){throw this.client.logger.error(`sendResult() -> history.get(${o}, ${n}) failed`),m}if(d){let m=D3(c,o,u);await global.Linking.openURL(m,this.client.name)}else{let m=p.request.method,g=ko[m].res;g.tvf=Do(ir({},f),{correlationId:n}),i?(g.internal=Do(ir({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(o,u,g)):this.client.core.relayer.publish(o,u,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)}),be(this,"sendError",async r=>{let{id:n,topic:o,error:s,encodeOpts:i,rpcOpts:a,appLink:c}=r,l=Zi(n,s),u,d=c&&typeof(global==null?void 0:global.Linking)<"u";try{let f=d?of:gs;u=await this.client.core.crypto.encode(o,l,Do(ir({},i||{}),{encoding:f}))}catch(f){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${o} failed`),f}let p;try{p=await this.client.core.history.get(o,n)}catch(f){throw this.client.logger.error(`sendError() -> history.get(${o}, ${n}) failed`),f}if(d){let f=D3(c,o,u);await global.Linking.openURL(f,this.client.name)}else{let f=p.request.method,m=a||ko[f].res;this.client.core.relayer.publish(o,u,m)}await this.client.core.history.resolve(l)}),be(this,"cleanup",async()=>{let r=[],n=[];this.client.session.getAll().forEach(o=>{let s=!1;xa(o.expiry)&&(s=!0),this.client.core.crypto.keychain.has(o.topic)||(s=!0),s&&r.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{xa(o.expiryTimestamp)&&n.push(o.id)}),await Promise.all([...r.map(o=>this.deleteSession({topic:o})),...n.map(o=>this.deleteProposal(o))])}),be(this,"onProviderMessageEvent",async r=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(r):await this.onRelayMessage(r)}),be(this,"onRelayEventRequest",async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()}),be(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===hu.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=hu.active;let r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=hu.idle}),be(this,"processRequest",async r=>{let{topic:n,payload:o,attestation:s,transportType:i,encryptedId:a}=r,c=o.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest
78({topic:n,payload:o,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,o);case"wc_sessionPing":return await this.onSessionPingRequest(n,o);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:o,attestation:s,encryptedId:a,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(n,o);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:o,attestation:s,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${c}`)}}),be(this,"onRelayEventResponse",async r=>{let{topic:n,payload:o,transportType:s}=r,i=(await this.client.core.history.get(n,o.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${i}`)}}),be(this,"onRelayEventUnknownPayload",r=>{let{topic:n}=r,{message:o}=Ae("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)}),be(this,"shouldIgnorePairingRequest",r=>{let{topic:n,requestMethod:o}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(o)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),be(this,"onSessionProposeRequest",async r=>{let{topic:n,payload:o,attestation:s,encryptedId:i}=r,{params:a,id:c}=o;try{let l=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l?.setError(du.proposal_listener_not_found)),this.isValidConnect(ir({},o.params));let u=a.expiryTimestamp||sn(ko.wc_sessionPropose.req.ttl),d=ir({id:c,pairingTopic:n,expiryTimestamp:u,attestation:s,encryptedId:i},a);await this.setProposal(c,d);let p=await this.getVerifyContext({attestationId:s,hash:Oi(JSON.stringify(o)),encryptedId:i,metadata:d.proposer.metadata});l?.addTrace(al.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:ko.wc_sessionPropose.autoReject}),this.client.logger.error(l)}}),be(this,"onSessionProposeResponse",async(r,n,o)=>{let{id:s}=n;if(Vr(n)){let{result:i}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});let c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});let l=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});let u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(s,{sessionTopic:u,pairingTopic:r,proposalId:s,publicKey:c});let d=await this.client.core.relayer.subscribe(u,{transportType:o});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:r})}else if(xr(n)){await this.deleteProposal(s);let i=sr("session_connect",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners, 954`);this.events.emit(i,{error:n.error})}}),be(this,"onSessionSettleRequest",async(r,n)=>{let{id:o,params:s}=n;try{this.isValidSessionSettleRequest(s);let{relay:i,controller:a,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:p,proposalRequestsResponses:f}=n.params,m=[...this.pendingSessions.values()].find(b=>b.sessionTopic===r);if(!m)return this.client.logger.error(`Pending session not found for topic ${r}`);let g=this.client.proposal.get(m.proposalId),y=Do(ir(ir(ir({topic:r,relay:i,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:m.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,controller:a.publicKey,self:{publicKey:m.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata}},u&&{sessionProperties:u}),d&&{scopedProperties:d}),p&&{sessionConfig:p}),{transportType:Lr.relay,authentication:f?.authentication,walletPayResult:f?.walletPay});await this.client.session.set(y.topic,y),await this.setExpiry(y.topic,y.expiry),await this.client.core.pairing.updateMetadata({topic:m.pairingTopic,metadata:y.peer.metadata}),this.pendingSessions.delete(m.proposalId),this.deleteProposal(m.proposalId,!1),this.cleanupDupl
vendor: 7,486 bytes, line 78
78icatePairings(y),await this.sendResult({id:n.id,topic:r,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:y}),this.events.emit(sr("session_connect",m.proposalId),{session:y})}catch(i){await this.sendError({id:o,topic:r,error:i}),this.client.logger.error(i)}}),be(this,"onSessionSettleResponse",async(r,n)=>{let{id:o}=n;Vr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(sr("session_approve",o),{})):xr(n)&&(await this.client.session.delete(r,Ir("USER_DISCONNECTED")),this.events.emit(sr("session_approve",o),{error:n.error}))}),be(this,"onSessionUpdateRequest",async(r,n)=>{let{params:o,id:s}=n;try{let i=`${r}_session_update`,a=sm.get(i);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:Ir("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(ir({topic:r},o));try{sm.set(i,s),await this.client.session.update(r,{namespaces:o.namespaces}),await this.sendResult({id:s,topic:r,result:!0})}catch(c){throw sm.delete(i),c}this.client.events.emit("session_update",{id:s,topic:r,params:o})}catch(i){await this.sendError({id:s,topic:r,error:i}),this.client.logger.error(i)}}),be(this,"isRequestOutOfSync",(r,n)=>n.toString().slice(0,-3)<r.toString().slice(0,-3)),be(this,"onSessionUpdateResponse",(r,n)=>{let{id:o}=n,s=sr("session_update",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(sr("session_update",o),{}):xr(n)&&this.events.emit(sr("session_update",o),{error:n.error})}),be(this,"onSessionExtendRequest",async(r,n)=>{let{id:o}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,sn(g6)),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_extend",{id:o,topic:r})}catch(s){await this.sendError({id:o,topic:r,error:s}),this.client.logger.error(s)}}),be(this,"onSessionExtendResponse",(r,n)=>{let{id:o}=n,s=sr("session_extend",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(sr("session_extend",o),{}):xr(n)&&this.events.emit(sr("session_extend",o),{error:n.error})}),be(this,"onSessionPingRequest",async(r,n)=>{let{id:o}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:o,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:o,topic:r})}catch(s){await this.sendError({id:o,topic:r,error:s}),this.client.logger.error(s)}}),be(this,"onSessionPingResponse",(r,n)=>{let{id:o}=n,s=sr("session_ping",o);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);Vr(n)?this.events.emit(sr("session_ping",o),{}):xr(n)&&this.events.emit(sr("session_ping",o),{error:n.error})},500)}),be(this,"onSessionDeleteRequest",async(r,n)=>{let{id:o}=n;try{await this.isValidDisconnect({topic:r,reason:n.params}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Ir("USER_DISCONNECTED")}),await this.deleteSession({topic:r,id:o})}catch(s){this.client.logger.error(s)}}),be(this,"onSessionRequest",async r=>{var n,o,s;let{topic:i,payload:a,attestation:c,encryptedId:l,transportType:u}=r,{id:d,params:p}=a;try{await this.isValidRequest(ir({topic:i},p));let f=this.client.session.get(i),m=await this.getVerifyContext({attestationId:c,hash:Oi(JSON.stringify(lr("wc_sessionRequest",p,d))),encryptedId:l,metadata:f.peer.metadata,transportType:u}),g={id:d,topic:i,params:p,verifyContext:m};await this.setPendingSessionRequest(g),u===Lr.link_mode&&(n=f.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((o=f.peer.metadata.redirect)==null?void 0:o.universal),(s=this.client.signConfig)!=null&&s.disableRequestQueue?this.emitSessionRequest(g):(this.addSessionRequestToSessionRequestQueue(g),this.processSessionRequestQueue())}catch(f){await this.sendError({id:d,topic:i,error:f}),this.client.logger.error(f)}}),be(this,"onSessionRequestResponse",(r,n)=>{let{id:o}=n,s=sr("session_request",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(sr("session_request",o),{result:n.result}):xr(n)&&this.events.emit(sr("session_request",o),{error:n.error})}),be(this,"onSessionEventRequest",async(r,n)=>{let{id:o,params:s}=n;try{let i=`${r}_session_event_${s.event.name}`,a=sm.get(i);if(a&&this.isRequestOutOfSync(a,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit(ir({topic:r},s)),this.client.events.emit("session_event",{id:o,topic:r,params:s}),sm.set(i,o)}catch(i){await this.sendError({id:o,topic:r,error:i}),this.client.logger.error(i)}}),be(this,"onSessionAuthenticateResponse",(r,n)=>{let{id:o}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Vr(n)?this.events.emit(sr("session_request",o),{result:n.result}):xr(n)&&this.events.emit(sr("session_request",o),{error:n.error})}),be(this,"onSessionAuthenticateRequest",async r=>{var n;let{topic:o,payload:s,attestation:i,encryptedId:a,transportType:c}=r;try{let{requester:l,authPayload:u,expiryTimestamp:d}=s.params,p=await this.getVerifyContext({attestationId:i,hash:Oi(JSON.stringify(s)),encryptedId:a,metadata:l.metadata,transportType:c}),f={requester:l,pairingTopic:o,id:s.id,authPayload:u,verifyContext:p,expiryTimestamp:d};await this.setAuthRequest(s.id,{request:f,pairingTopic:o,transportType:c}),c===Lr.link_mode&&(n=l.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:o,params:s.params,id:s.id,verifyContext:p})}catch(l){this.client.logger.error(l);let u=s.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),p=this.getAppLinkIfEnabled(s.params.requester.metadata,c),f={type:ol,receiverPublicKey:u,senderPublicKey:d};await this.sendError({id:s.id,topic:o,error:l,encodeOpts:f,rpcOpts:ko.wc_sessionAuthenticate.autoReject,appLink:p})}}),be(this,"addSessionRequestToSessionRequestQueue",r=>{this.sessionRequestQueue.queue.push(r)}),be(this,"cleanupAfterResponse",r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=hu.idle,this.processSessionRequestQueue()},(0,It.toMiliseconds)(this.requestQueueDelay))}),be(this,"cleanupPendingSentRequestsForTopic",({topic:r,error:n})=>{let o=this.client.core.history.pending;o.length>0&&o.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{this.events.emit(sr("session_request",s.request.id),{error:n})})}),be(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===hu.active){this.client.logger.info("session request queue is already active.");return}let r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}}),be(this,"emitSessionRequest",r=>{if(this.emittedSessionRequests.has(r.id)){this.client.logger.warn({id:r.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${r.id}`);return}this.sessionRequestQueue.state=hu.active,this.emittedSessionRequests.add(r.id),this.client.events.emit("session_request",r)}),be(this,"onPairingCreated",r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;let n=this.client.proposal.getAll().find(o=>o.pairingTopic===r.topic);
78n&&this.onSessionProposeRequest({topic:r.topic,payload:lr("wc_sessionPropose",Do(ir({},n),{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties,scopedProperties:n.scopedProperties}),n.id),attestation:n.attestation,encryptedId:n.encryptedId})}),be(this,"isValidConnect",async r=>{if(!ys(r)){let{message:l}=Ae("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}let{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:s,sessionProperties:i,scopedProperties:a,relays:c}=r;if(_n(n)||await this.isValidPairingTopic(n),!W0e(c,!0)){let{message:l}=Ae("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(o&&!_n(o)&&ic(o)!==0){let l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(o,"requiredNamespaces")}if(s&&!_n(s)&&ic(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),i&&!_n(i)&&this.validateSessionProps(i,"sessionProperties"),a&&!_n(a)){this.validateSessionProps(a,"scopedProperties");let l=Object.keys(o||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(l)}`)}}),be(this,"validateNamespaces",(r,n)=>{let o=q0e(r,"connect()",n);if(o)throw new Error(o.message)}),be(this,"isValidApprove",async r=>{if(!ys(r))throw new Error(Ae("MISSING_OR_INVALID",`approve() params: ${r}`).message);let{id:n,namespaces:o,relayProtocol:s,sessionProperties:i,scopedProperties:a}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);let c=this.client.proposal.get(n),l=O_(o,"approve()");if(l)throw new Error(l.message);let u=D$(c.requiredNamespaces,o,"approve()");if(u)throw new Error(u.message);if(!fn(s,!0)){let{message:d}=Ae("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}if(i&&!_n(i)&&this.validateSessionProps(i,"sessionProperties"),a&&!_n(a)){this.validateSessionProps(a,"scopedProperties");let d=new Set(Object.keys(o));if(!Object.keys(a).every(p=>d.has(p.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(d).join(", ")}`)}}),be(this,"isValidReject",async r=>{if(!ys(r)){let{message:s}=Ae("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}let{id:n,reason:o}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!Z0e(o)){let{message:s}=Ae("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(s)}}),be(this,"isValidSessionSettleRequest",r=>{if(!ys(r)){let{message:l}=Ae("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}let{relay:n,controller:o,namespaces:s,expiry:i}=r;if(!B$(n)){let{message:l}=Ae("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}let a=z0e(o,"onSessionSettleRequest()");if(a)throw new Error(a.message);let c=O_(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(xa(i)){let{message:l}=Ae("EXPIRED","onSessionSettleRequest()");throw new Error(l)}}),be(this,"isValidUpdate",async r=>{if(!ys(r)){let{message:c}=Ae("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}let{topic:n,namespaces:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);
78let s=this.client.session.get(n),i=O_(o,"update()");if(i)throw new Error(i.message);let a=D$(s.requiredNamespaces,o,"update()");if(a)throw new Error(a.message)}),be(this,"isValidExtend",async r=>{if(!ys(r)){let{message:o}=Ae("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(o)}let{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)}),be(this,"isValidRequest",async r=>{if(!ys(r)){let{message:c}=Ae("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}let{topic:n,request:o,chainId:s,expiry:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);let{namespaces:a}=this.client.session.get(n);if(!k$(a,s)){let{message:c}=Ae("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!G0e(o)){let{message:c}=Ae("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(c)}if(!Q0e(a,s,o.method)){let{message:c}=Ae("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(c)}this.validateRequestExpiry(i)}),be(this,"isValidRespond",async r=>{var n;if(!ys(r)){let{message:a}=Ae("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}let{topic:o,response:s}=r;try{await this.isValidSessionTopic(o)}catch(a){throw(n=r?.response)!=null&&n.id&&this.cleanupAfterResponse(r),a}if(!Y0e(s)){let{message:a}=Ae("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}let i=this.client.pendingRequest.get(s.id);if(i.topic!==o){let{message:a}=Ae("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${s.id}, expected topic: ${i.topic}, received topic: ${o}`);throw new Error(a)}}),be(this,"isValidPing",async r=>{if(!ys(r)){let{message:o}=Ae("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(o)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),be(this,"isValidEmit",async r=>{if(!ys(r)){let{message:a}=Ae("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}let{topic:n,event:o,chainId:s}=r;await this.isValidSessionTopic(n);let{namespaces:i}=this.client.session.get(n);if(!k$(i,s)){let{message:a}=Ae("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!J0e(o)){let{message:a}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(a)}if(!X0e(i,s,o.name)){let{message:a}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(a)}}),be(this,"isValidDisconnect",async r=>{if(!ys(r)){let{message:o}=Ae("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(o)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)}),be(this,"isValidAuthenticate",r=>{let{chains:n,uri:o,domain:s,nonce:i}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!fn(o,!1))throw new Error("uri is required parameter");if(!fn(s,!1))throw new Error("domain is required parameter");if(!fn(i,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>rl(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:a}=rl(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),be(this,"getVerifyContext",async r=>{let{attestationId:n,hash:o,encryptedId:s,metadata:i,transportType:a}=r,c={verified:{verifyUrl:i.verifyUrl||h6,validation:"UNKNOWN",origin:i.url||""}};try{if(a===Lr.link_mode){let u=this.getAppLinkIfEnabled(i,a);return c.verified.validation=u&&new URL(u).origin===new URL(i.url).origin?"VALID":"INVALID",c}let l=await this.client.core.verify.resolve({attestationId:n,hash:o,encryptedId:s,verifyUrl:i.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c}),be(this,"validateSessionProps",(r,n)=>{Object.values(r).forEach((o,s)=>{if(o==null){let{message:i}=Ae("MISSING_OR_INVALID",`${n} must contain an existing value for each key. Received: ${o} for key ${Object.keys(r)[s]}`);throw new Error(i)}})}),be(this,"getPendingAuthRequest",r=>{let n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0}),be(this,"addToRecentlyDeleted",(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let o=0,s=this.recentlyDeletedLimit/2;
78for(let i of this.recentlyDeletedMap.keys()){if(o++>=s)break;this.recentlyDeletedMap.delete(i)}}}),be(this,"checkRecentlyDeleted",r=>{let n=this.recentlyDeletedMap.get(r);if(n){let{message:o}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(o)}}),be(this,"isLinkModeEnabled",(r,n)=>{var o,s,i,a,c,l,u,d,p;return!r||n!==Lr.link_mode?!1:((s=(o=this.client.metadata)==null?void 0:o.redirect)==null?void 0:s.linkMode)===!0&&((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.universal)!==void 0&&((l=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:l.universal)!==""&&((u=r?.redirect)==null?void 0:u.universal)!==void 0&&((d=r?.redirect)==null?void 0:d.universal)!==""&&((p=r?.redirect)==null?void 0:p.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"}),be(this,"getAppLinkIfEnabled",(r,n)=>{var o;return this.isLinkModeEnabled(r,n)?(o=r?.redirect)==null?void 0:o.universal:void 0}),be(this,"handleLinkModeMessage",({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;let n=l$(r,"topic")||"",o=decodeURIComponent(l$(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:Lr.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:o,sessionExists:s})}),be(this,"registerLinkModeListeners",async()=>{var r;if(_3()||rf()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){let n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);let o=await n.getInitialURL();o&&setTimeout(()=>{this.handleLinkModeMessage({url:o})},50)}}}),be(this,"getTVFApproveParams",r=>{try{let n=N$(r.namespaces),o=U0e(r.namespaces),s=L0e(r.namespaces),i=r.sessionProperties,a=r.scopedProperties;return{approvedChains:n,approvedMethods:o,approvedEvents:s,sessionProperties:i,scopedProperties:a}}catch(n){return this.client.logger.warn(n,"Error getting TVF approve params"),{}}}),be(this,"getTVFParams",(r,n,o)=>{var s,i,a;if(!((s=n.request)!=null&&s.method))return{};let c={correlationId:r,rpcMethods:[n.request.method],chainId:n.chainId};try{let l=this.extractTxHashesFromResult(n.request,o);c.txHashes=l,c.contractAddresses=this.isValidContractData(n.request.params)?[(a=(i=n.request.params)==null?void 0:i[0])==null?void 0:a.to]:[]}catch(l){this.client.logger.warn(l,"Error getting TVF params")}return c}),be(this,"isValidContractData",r=>{var n;if(!r)return!1;try{let o=r?.data||((n=r?.[0])==null?void 0:n.data);if(!o.startsWith("0x"))return!1;let s=o.slice(2);return/^[0-9a-fA-F]*$/.test(s)?s.length%2===0:!1}catch{}return!1}),be(this,"extractTxHashesFromResult",(r,n)=>{var o;try{if(!n)return[];let s=r.method,i=Nje[s];if(s==="sui_signTransaction")return[zhe(n.transactionBytes)];if(s==="near_signTransaction")return[h$(n)];if(s==="near_signTransactions")return n.map(c=>h$(c));if(s==="xrpl_signTransactionFor"||s==="xrpl_signTransaction")return[(o=n.tx_json)==null?void 0:o.hash];if(s==="polkadot_signTransaction")return[nme({transaction:r.params.transactionPayload,signature:n.signature})];if(s==="algo_signTxn")return sl(n)?n.map(c=>m$(c)):[m$(n)];if(s==="cosmos_signDirect")return[jhe(n)];if(s==="wallet_sendCalls")return qhe(n);if(typeof n=="string")return[n];let a=n[i.key];if(sl(a))return s==="solana_signAllTransactions"?a.map(c=>Vhe(c)):a;if(typeof a=="string")return[a]}catch(s){this.client.logger.warn(s,"Error extracting tx hashes from result")}return[]})}async processPendingMessageEvents(){try{let t=this.client.session.keys,r=this.client.core.relayer.messages.getWithoutAck(t);for(let[n,o]of Object.entries(r))for(let s of o)try{await this.onProviderMessageEvent({topic:n,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${n}, message: ${s}`)}}catch(t){this.client.logger.warn(t,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){let{message:t}=Ae("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(hn.message,t=>{this.onProviderMessageEvent(t)})}async onRelayMessage(t){let{topic:r,message:n,attestation:o,transportType:s}=t,{publicKey:i}=this.client.auth.authKeys.keys.includes(L_)?this.client.auth.authKeys.get(L_):{responseTopic:void 0,publicKey:void 0};try{let a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:i,encoding:s===Lr.link_mode?of:gs});Cc(a)?(this.client.core.history.set(r,a),await this.onRelayEventRequest({topic:r,payload:a,attestation:o,transportType:s,encryptedId:Oi(n)})):Gi(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(a)}`),await this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})),await this.client.core.relayer.messages.ack(r,n)}catch(a){this.client.logger.error(`onRelayMessage() ->
78 failed to process an inbound message: ${n}`),this.client.logger.error(a)}}registerExpirerEvents(){this.client.core.expirer.on(Aa.expired,async t=>{let{topic:r,id:n}=v_(t.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Ae("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Ae("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(am.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(am.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!fn(t,!1)){let{message:r}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(t)){let{message:r}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(r)}if(xa(this.client.core.pairing.pairings.get(t).expiry)){let{message:r}=Ae("EXPIRED",`pairing topic: ${t}`);throw new Error(r)}}async isValidSessionTopic(t){if(!fn(t,!1)){let{message:r}=Ae("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(r)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){let{message:r}=Ae("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(r)}if(xa(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});let{message:r}=Ae("EXPIRED",`session topic: ${t}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(t)){let{message:r}=Ae("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(r)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(fn(t,!1)){let{message:r}=Ae("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(r)}else{let{message:r}=Ae("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(r)}}async isValidProposalId(t){if(!K0e(t)){let{message:r}=Ae("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(r)}if(!this.client.proposal.keys.includes(t)){let{message:r}=Ae("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(r)}if(xa(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);let{message:r}=Ae("EXPIRED",`proposal id: ${t}`);throw new Error(r)}}validateRequestExpiry(t){if(t&&!eme(t,wF)){let{message:r}=Ae("MISSING_OR_INVALID",`request() expiry: ${t}. Expiry must be a number (in seconds) between ${wF.min} and ${wF.max}`);throw new Error(r)}}},EF=class extends fu{constructor(t,r){super(t,r,Tje,NF),this.core=t,this.logger=r}},AF=class extends fu{constructor(t,r){super(t,r,_je,NF),this.core=t,this.logger=r}},CF=class extends fu{constructor(t,r){super(t,r,Rje,NF,n=>n.id),this.core=t,this.logger=r}},SF=class extends fu{constructor(t,r){super(t,r,Dje,H_,()=>L_),this.core=t,this.logger=r}},IF=class extends fu{constructor(t,r){super(t,r,Uje,H_),this.core=t,this.logger=r}},TF=class extends fu{constructor(t,r){super(t,r,Lje,H_,n=>n.id),this.core=t,this.logger=r}},zje=Object.defineProperty,jje=(e,t,r)=>t in e?zje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bF=(e,t,r)=>jje(e,typeof t!="symbol"?t+"":t,r),_F=class{constructor(t,r){this.core=t,this.logger=r,bF(this,"authKeys"),bF(this,"pairingTopics"),bF(this,"requests"),this.authKeys=new SF(this.core,this.logger),this.pairingTopics=new IF(this.core,this.logger),this.requests=new TF(this.core,this.logger)}
vendor: 4,193 bytes, line 78
78async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},qje=Object.defineProperty,Wje=(e,t,r)=>t in e?qje(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vt=(e,t,r)=>Wje(e,typeof t!="symbol"?t+"":t,r),PF=class e extends TT{constructor(t){super(t),Vt(this,"protocol",Gme),Vt(this,"version",Yme),Vt(this,"name",yF.name),Vt(this,"metadata"),Vt(this,"core"),Vt(this,"logger"),Vt(this,"events",new M_.EventEmitter),Vt(this,"engine"),Vt(this,"session"),Vt(this,"proposal"),Vt(this,"pendingRequest"),Vt(this,"auth"),Vt(this,"signConfig"),Vt(this,"on",(n,o)=>this.events.on(n,o)),Vt(this,"once",(n,o)=>this.events.once(n,o)),Vt(this,"off",(n,o)=>this.events.off(n,o)),Vt(this,"removeListener",(n,o)=>this.events.removeListener(n,o)),Vt(this,"removeAllListeners",n=>this.events.removeAllListeners(n)),Vt(this,"connect",async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"pair",async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"approve",async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"reject",async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"update",async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"extend",async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"request",async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"respond",async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"ping",async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"emit",async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"disconnect",async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"find",n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}}),Vt(this,"authenticate",async(n,o)=>{try{return await this.engine.authenticate(n,o)}catch(s){throw this.logger.error(s.message),s}}),Vt(this,"formatAuthMessage",n=>{try{return this.engine.formatAuthMessage(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"approveSessionAuthenticate",async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(o){throw this.logger.error(o.message),o}}),Vt(this,"rejectSessionAuthenticate",async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(o){throw this.logger.error(o.message),o}}),this.name=t?.name||yF.name,this.metadata=vhe(t?.metadata),this.signConfig=t?.signConfig;let r=d6({logger:t?.logger||yF.logger,name:this.name});this.logger=r,this.core=t?.core||new jme(t),this.session=new AF(this.core,this.logger),this.proposal=new EF(this.core,this.logger),this.pendingRequest=new CF(this.core,this.logger),this.engine=new vF(this),this.auth=new _F(this.core,this.logger)}static async init(t){let r=new e(t);return await r.initialize(),r}get context(){return rr(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}},Qme=PF});function Kje(e){return Number.isSafeInteger(e)&&e>=0}function Zje(e){return e!=null&&typeof e!="function"&&Kje(e.length)}function Gje(e){return e==="__proto__"}function WF(e){return e==null||typeof e!="object"&&typeof e!="function"}function b1e(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}
78function KF(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}function ZF(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function fqe(e,t){return w6(e,void 0,e,new Map,t)}function w6(e,t,r,n=new Map,o=void 0){let s=o?.(e,t,r,n);if(s!==void 0)return s;if(WF(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let i=new Array(e.length);n.set(e,i);for(let a=0;a<e.length;a++)i[a]=w6(e[a],a,r,n,o);return Object.hasOwn(e,"index")&&(i.index=e.index),Object.hasOwn(e,"input")&&(i.input=e.input),i}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let i=new RegExp(e.source,e.flags);return i.lastIndex=e.lastIndex,i}if(e instanceof Map){let i=new Map;n.set(e,i);for(let[a,c]of e)i.set(a,w6(c,a,r,n,o));return i}if(e instanceof Set){let i=new Set;n.set(e,i);for(let a of e)i.add(w6(a,void 0,r,n,o));return i}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(ZF(e)){let i=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,i);for(let a=0;a<e.length;a++)i[a]=w6(e[a],a,r,n,o);return i}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let i=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,i),cl(i,e,r,n,o),i}if(typeof File<"u"&&e instanceof File){let i=new File([e],e.name,{type:e.type});return n.set(e,i),cl(i,e,r,n,o),i}if(typeof Blob<"u"&&e instanceof Blob){let i=new Blob([e],{type:e.type});return n.set(e,i),cl(i,e,r,n,o),i}if(e instanceof Error){let i=new e.constructor;return n.set(e,i),i.message=e.message,i.name=e.name,i.stack=e.stack,i.cause=e.cause,cl(i,e,r,n,o),i}if(e instanceof Boolean){let i=new Boolean(e.valueOf());return n.set(e,i),cl(i,e,r,n,o),i}if(e instanceof Number){let i=new Number(e.valueOf());return n.set(e,i),cl(i,e,r,n,o),i}if(e instanceof String){let i=new String(e.valueOf());return n.set(e,i),cl(i,e,r,n,o),i}if(typeof e=="object"&&hqe(e)){let i=Object.create(Object.getPrototypeOf(e));return n.set(e,i),cl(i,e,r,n,o),i}return e}function cl(e,t,r=e,n,o){let s=[...Object.keys(t),...b1e(t)];for(let i=0;i<s.length;i++){let a=s[i],c=Object.getOwnPropertyDescriptor(e,a);(c==null||c.writable)&&(e[a]=w6(t[a],a,r,n,o))}}function hqe(e){switch(KF(e)){case A1e:case tqe:case rqe:case nqe:case E1e:case Qje:case dqe:case pqe:case cqe:case lqe:case uqe:case Xje:case v1e:case C1e:case Yje:case eqe:case x1e:case Jje:case oqe:case sqe:case iqe:case aqe:return!0;default:return!1}}function mqe(e,t){return fqe(e,(r,n,o,s)=>{let i=t?.(r,n,o,s);if(i!==void 0)return i;if(typeof e=="object"){if(KF(e)===C1e&&typeof e.constructor!="function"){let a={};return s.set(e,a),cl(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case v1e:case x1e:case E1e:{let a=new e.constructor(e?.valueOf());return cl(a,e),a}case A1e:{let a={};return cl(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function e1e(e){return mqe(e)}function t1e(e){return e!==null&&typeof e=="object"&&KF(e)==="[object Arguments]"}function HF(e){return typeof e=="object"&&e!==null}function gqe(e){return HF(e)&&Zje(e)}function yqe(){}function RF(e){return ZF(e)}function OF(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){let r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function wqe(e){if(WF(e))return e;if(Array.isArray(e)||ZF(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){let n=new r(e);return n.lastIndex=e.lastIndex,n}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let n;return e instanceof AggregateError?n=new r(e.errors,e.message,{cause:e.cause}):n=new r(e.message,{cause:e.cause}),n.stack=e.stack,Object.assign(n,e),n}if(typeof File<"u"&&e instanceof File)return new r([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e=="object"){let n=Object.create(t);return Object.assign(n,e)}return e}function bqe(e,...t){let r=t.slice(0,-1),n=t[t.length-1],o=e;for(let s=0;s<r.length;s++){let i=r[s];o=$F(o,i,n,new Map)}return o}function $F(e,t,r,n){if(WF(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(n.has(t))return wqe(n.get(t));if(n.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}let o=[...Object.keys(t),...b1e(t)];for(let s=0;s<o.length;s++){let i=o[s];if(Gje(i))continue;let a=t[i],c=e[i];if(t1e(a)&&(a={...a}),t1e(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=e1e(a)),Array.isArray(a))if(Array.isArray(c)){let u=[],d=Reflect.ownKeys(c);for(let p=0;p<d.length;p++){let f=d[p];u[f]=c[f]}c=u}else if(gqe(c)){let u=[];for(let d=0;d<c.length;d++)u[d]=c[d];c=u}else c=[];let l=r(c,a,i,e,t,n);l!==void 0?e[i]=l:Array.isArray(a)||HF(c)&&HF(a)&&(OF(c)||OF(a)||RF(c)||RF(a))?e[i]=$F(c,a,r,n):c==null&&OF(a)?e[i]=$F({},a,r,n):c==null&&RF(a)?e[i]=e1e(a):(c===void 0||a!==void 0)&&(e[i]=a)}return e}function xqe(e,...t){return bqe(e,...t,yqe)}function _1e(e,t,r){var n;let o=rl(e);return((n=t.rpcMap)==null?void 0:n[o.reference])||`${I1e}?chainId=${o.namespace}:${o.reference}&projectId=${r}`}function Rqe(e){return e.includes(":")?e.split(":")[1]:e}function P1e(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function Oqe(e,t){let r=Object.keys(t.namespaces).filter(o=>o.includes(e));if(!r.length)return[];let n=[];return r.forEach(o=>{let s=t.namespaces[o].accounts;n.push(...s)}),n}function s1e(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>{var n,o;return((n=r?.chains)==null?void 0:n.length)&&((o=r?.chains)==null?void 0:o.length)>0}))}function V_(e={},t={}){let r=s1e(i1e(e)),n=s1e(i1e(t));return xqe(r,n)}function i1e(e){var t,r,n,o,s;let i={};if(!ic(e))return i;for(let[a,c]of Object.entries(e)){let l=U3(a)?[a]:c.chains,u=c.methods||[],d=c.events||[],p=c.rpcMap||{},f=Hg(a);i[f]=Nqe(F_(F_({},i[f]),c),{chains:Qc(l,(t=i[f])==null?void 0:t.chains),methods:Qc(u,(r=i[f])==null?void 0:r.methods),events:Qc(d,(n=i[f])==null?void 0:n.events)}),(ic(p)||ic(((o=i[f])==null?void 0:o.rpcMap)||{}))&&(i[f].rpcMap=F_(F_({},p),(s=i[f])==null?void 0:s.rpcMap))}return i}function a1e(e){return e.includes(":")?e.split(":")[2]:e}function c1e(e){let t={};for(let[r,n]of Object.entries(e)){let o=n.methods||[],s=n.events||[],i=n.accounts||[],a=U3(r)?[r]:n.chains?n.chains:P1e(n.accounts);t[r]={chains:a,methods:o,events:s,accounts:i}}return t}function BF(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}function Bqe(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)}catch{return!1}}async function Jqe(e,t){let r=rl(e.result.capabilities.caip345.caip2),n=e.result.capabilities.caip345.transactionHashes,o=await Promise.allSettled(n.map(d=>Qqe(r.reference,d,t))),s=o.filter(d=>d.status==="fulfilled").map(d=>d.value).filter(d=>d);o.filter(d=>d.status==="rejected").forEach(d=>console.warn("Failed to fetch transaction receipt:",d.reason));let i=!s.length||s.some(d=>!d),a=s.every(d=>d?.status==="0x1"),c=s.every(d=>d?.status==="0x0"),l=s.some(d=>d?.status==="0x0"),u;return i?u=100:a?u=200:c?u=500:l&&(u=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:s,status:u}}async function Qqe(e,t,r){return await r(parseInt(e)).request(lr("eth_getTransactionReceipt",[t]))}async function Xqe({sendCalls:e,storage:t}){let r=await t.getItem(b6);await t.setItem(b6,Yqe(Gqe({},r),{[e.result.id]:{request:e.request,result:e.result,expiry:sn(Cqe)}}))}async function eWe({resultId:e,storage:t}){let r=await t.getItem(b6);if(r){delete r[e],await t.setItem(b6,r);for(let n in r)xa(r[n].expiry)&&delete r[n];await t.setItem(b6,r)}}async function tWe({resultId:e,storage:t}){let r=await t.getItem(b6),n=r?.[e];
78if(n&&!xa(n.expiry))return n;await eWe({resultId:e,storage:t})}var w1e,Yje,x1e,v1e,E1e,A1e,Jje,Qje,Xje,eqe,tqe,rqe,C1e,nqe,oqe,sqe,iqe,aqe,cqe,lqe,uqe,dqe,pqe,r1e,vqe,Eqe,S1e,$_,I1e,T1e,Aqe,b6,Cqe,GF,Sqe,Iqe,Tqe,n1e,_qe,Pqe,o1e,F_,Nqe,N1e,x6,kF,kqe,l1e,Dqe,Uqe,u1e,d1e,p1e,Lqe,Mqe,DF,f1e,Hqe,$qe,Fqe,Vqe,zqe,UF,FF,jqe,qqe,Wqe,h1e,Kqe,Zqe,m1e,Gqe,Yqe,rWe,nWe,oWe,g1e,sWe,iWe,VF,LF,MF,$g,zF,aWe,cWe,y6,jF,lWe,uWe,dWe,y1e,pWe,fWe,qF,z3,z_,Ca,j_,R1e=h(()=>{Xme();B_();Sc();uy();ZC();w1e=Lt(Cs(),1);Yje="[object RegExp]",x1e="[object String]",v1e="[object Number]",E1e="[object Boolean]",A1e="[object Arguments]",Jje="[object Symbol]",Qje="[object Date]",Xje="[object Map]",eqe="[object Set]",tqe="[object Array]",rqe="[object ArrayBuffer]",C1e="[object Object]",nqe="[object DataView]",oqe="[object Uint8Array]",sqe="[object Uint8ClampedArray]",iqe="[object Uint16Array]",aqe="[object Uint32Array]",cqe="[object Int8Array]",lqe="[object Int16Array]",uqe="[object Int32Array]",dqe="[object Float32Array]",pqe="[object Float64Array]";r1e="error",vqe="wss://relay.walletconnect.org",Eqe="wc",S1e="universal_provider",$_=`${Eqe}@2:${S1e}:`,I1e="https://rpc.walletconnect.org/v1/",T1e="generic",Aqe=`${I1e}bundler`,b6="call_status",Cqe=86400,GF={DEFAULT_CHAIN_CHANGED:"default_chain_changed"},Sqe=Object.defineProperty,Iqe=Object.defineProperties,Tqe=Object.getOwnPropertyDescriptors,n1e=Object.getOwnPropertySymbols,_qe=Object.prototype.hasOwnProperty,Pqe=Object.prototype.propertyIsEnumerable,o1e=(e,t,r)=>t in e?Sqe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F_=(e,t)=>{for(var r in t||(t={}))_qe.call(t,r)&&o1e(e,r,t[r]);if(n1e)for(var r of n1e(t))Pqe.call(t,r)&&o1e(e,r,t[r]);return e},Nqe=(e,t)=>Iqe(e,Tqe(t));N1e={},x6=e=>N1e[e],kF=(e,t)=>{N1e[e]=t},kqe=Object.defineProperty,l1e=Object.getOwnPropertySymbols,Dqe=Object.prototype.hasOwnProperty,Uqe=Object.prototype.propertyIsEnumerable,u1e=(e,t,r)=>t in e?kqe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,d1e=(e,t)=>{for(var r in t||(t={}))Dqe.call(t,r)&&u1e(e,r,t[r]);if(l1e)for(var r of l1e(t))Uqe.call(t,r)&&u1e(e,r,t[r]);return e},p1e="eip155",Lqe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],Mqe=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,DF=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,f1e=e=>Object.keys(e).filter(t=>Lqe.includes(t)).reduce((t,r)=>(t[r]=Hqe(e[r]),t),{}),Hqe=e=>typeof e=="string"&&Bqe(e)?JSON.parse(e):e,$qe=(e,t,r)=>{let{sessionProperties:n={},scopedProperties:o={}}=e,s={};if(!ic(o)&&!ic(n))return;let i=f1e(n);for(let a of r){let c=Mqe(a);if(!c)continue;s[DF(c)]=i;let l=o?.[`${p1e}:${c}`];if(l){let u=l?.[`${p1e}:${c}:${t}`];s[DF(c)]=d1e(d1e({},s[DF(c)]),f1e(u||l))}}for(let[a,c]of Object.entries(s))Object.keys(c).length===0&&delete s[a];return Object.keys(s).length>0?s:void 0},Fqe=Object.defineProperty,Vqe=(e,t,r)=>t in e?Fqe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zqe=(e,t,r)=>Vqe(e,typeof t!="symbol"?t+"":t,r),FF=class e{constructor(t){zqe(this,"storage"),this.storage=t}async getItem(t){return await this.storage.getItem(t)}async setItem(t,r){return await this.storage.setItem(t,r)}async removeItem(t){return await this.storage.removeItem(t)}static getStorage(t){return UF||(UF=new e(t)),UF}},jqe=Object.defineProperty,qqe=Object.defineProperties,Wqe=Object.getOwnPropertyDescriptors,h1e=Object.getOwnPropertySymbols,Kqe=Object.prototype.hasOwnProperty,Zqe=Object.prototype.propertyIsEnumerable,m1e=(e,t,r)=>t in e?jqe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gqe=(e,t)=>{for(var r in t||(t={}))Kqe.call(t,r)&&m1e(e,r,t[r]);if(h1e)for(var r of h1e(t))Zqe.call(t,r)&&m1e(e,r,t[r]);return e},Yqe=(e,t)=>qqe(e,Wqe(t));rWe=Object.defineProperty,nWe=Object.defineProperties,oWe=Object.getOwnPropertyDescriptors,g1e=Object.getOwnPropertySymbols,sWe=Object.prototype.hasOwnProperty,iWe=Object.prototype.propertyIsEnumerable,VF=(e,t,r)=>t in e?rWe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LF=(e,t)=>{for(var r in t||(t={}))sWe.call(t,r)&&VF(e,r,t[r]);if(g1e)for(var r of g1e(t))iWe.call(t,r)&&VF(e,r,t[r]);return e},MF=(e,t)=>nWe(e,oWe(t)),$g=(e,t,r)=>VF(e,typeof t!="symbol"?t+"":t,r),zF=class{constructor(t){$g(this,"name","eip155"),$g(this,"client"),$g(this,"chainId"),$g(this,"namespace"),$g(this,"httpProviders"),$g(this,"events"),$g(this,"storage"),this.namespace=t.namespace,this.events=x6("events"),this.client=x6("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=FF.getStorage(this.client.core.storage)}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(t);case"wallet_getCallsStatus":return await this.getCallStatus(t);case"wallet_sendCalls":return await this.sendCalls(t)}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r);let n=this.chainId;this.chainId=parseInt(t),this.events.emit(GF.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${t}`,previousCaipChainId:`${this.name}:${n}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){let n=r||_1e(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ji(new Ha(n,x6("disableProviderPing")))}setHttpProvider(t,r){let n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProviders(){let t={};return this.namespace.chains.forEach(r=>{var n;let o=parseInt(Rqe(r));t[o]=this.createHttpProvider(o,(n=this.namespace.rpcMap)==null?void 0:n[r])}),t}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(t){let r=t||this.chainId;return this.httpProviders[r]||(this.httpProviders=MF(LF({},this.httpProviders),{[r]:this.createHttpProvider(r)}),this.httpProviders[r])}async handleSwitchChain(t){var r,n;let o=t.request.params?(r=t.request.params[0])==null?void 0:r.chainId:"0x0";o=o.startsWith("0x")?o:`0x${o}`;let s=parseInt(o,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.to
vendor: 11,685 bytes, line 78
78pic,request:{method:t.request.method,params:[{chainId:o}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}async getCapabilities(t){var r,n,o,s,i;let a=(n=(r=t.request)==null?void 0:r.params)==null?void 0:n[0],c=((s=(o=t.request)==null?void 0:o.params)==null?void 0:s[1])||[];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");let l=this.client.session.get(t.topic),u=((i=l?.sessionProperties)==null?void 0:i.capabilities)||{},d=c.length>0?c.join(","):`0x${this.chainId.toString(16)}`,p=`${a}${d}`,f=u?.[p];if(f)return f;let m;try{m=$qe(l,a,c)}catch(y){console.warn("Failed to extract capabilities from session",y)}if(m)return m;let g=await this.client.request(t);try{await this.client.session.update(t.topic,{sessionProperties:MF(LF({},l.sessionProperties||{}),{capabilities:MF(LF({},u||{}),{[p]:g})})})}catch(y){console.warn("Failed to update session with capabilities",y)}return g}async getCallStatus(t){var r,n,o;let s=this.client.session.get(t.topic),i=(r=s.sessionProperties)==null?void 0:r.bundler_name;if(i){let l=this.getBundlerUrl(t.chainId,i);try{return await this.getUserOperationReceipt(l,t)}catch(u){console.warn("Failed to fetch call status from bundler",u,l)}}let a=(n=s.sessionProperties)==null?void 0:n.bundler_url;if(a)try{return await this.getUserOperationReceipt(a,t)}catch(l){console.warn("Failed to fetch call status from custom bundler",l,a)}let c=await tWe({resultId:(o=t.request.params)==null?void 0:o[0],storage:this.storage});if(c)try{return await Jqe(c,this.getHttpProvider.bind(this))}catch(l){console.warn("Failed to fetch call status from stored send calls",l,c)}if(this.namespace.methods.includes(t.request.method))return await this.client.request(t);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(t,r){var n;let o=new URL(t),s=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(lr("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!s.ok)throw new Error(`Failed to fetch user operation receipt - ${s.status}`);return await s.json()}getBundlerUrl(t,r){return`${Aqe}?projectId=${this.client.core.projectId}&chainId=${t}&bundler=${r}`}async sendCalls(t){var r,n,o;let s=await this.client.request(t),i=(r=t.request.params)==null?void 0:r[0],a=s?.id,c=s?.capabilities||{},l=(n=c?.caip345)==null?void 0:n.caip2,u=(o=c?.caip345)==null?void 0:o.transactionHashes;return!a||!l||!(u!=null&&u.length)||await Xqe({sendCalls:{request:i,result:s},storage:this.storage}),s}},aWe=Object.defineProperty,cWe=(e,t,r)=>t in e?aWe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,y6=(e,t,r)=>cWe(e,typeof t!="symbol"?t+"":t,r),jF=class{constructor(t){y6(this,"name",T1e),y6(this,"client"),y6(this,"httpProviders"),y6(this,"events"),y6(this,"namespace"),y6(this,"chainId"),this.namespace=t.namespace,this.events=x6("events"),this.client=x6("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(t.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(t.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(t.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(t.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider(t.chainId).request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r);let n=this.chainId;this.chainId=t,this.events.emit(GF.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${t}`,previousCaipChainId:`${this.name}:${n}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getNamespaceName(){let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return rl(t).namespace}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var t,r;let n={};return(r=(t=this.namespace)==null?void 0:t.accounts)==null||r.forEach(o=>{var s,i;let a=rl(o),c=(i=(s=this.namespace)==null?void 0:s.rpcMap)==null?void 0:i[`${a.namespace}:${a.reference}`];n[a.reference]=this.createHttpProvider(o,c)}),n}getHttpProvider(t){let r=rl(t).reference,n=this.httpProviders[r];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,r){let n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){let n=r||_1e(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ji(new Ha(n,x6("disableProviderPing")))}},lWe=Object.defineProperty,uWe=Object.defineProperties,dWe=Object.getOwnPropertyDescriptors,y1e=Object.getOwnPropertySymbols,pWe=Object.prototype.hasOwnProperty,fWe=Object.prototype.propertyIsEnumerable,qF=(e,t,r)=>t in e?lWe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z3=(e,t)=>{for(var r in t||(t={}))pWe.call(t,r)&&qF(e,r,t[r]);if(y1e)for(var r of y1e(t))fWe.call(t,r)&&qF(e,r,t[r]);return e},z_=(e,t)=>uWe(e,dWe(t)),Ca=(e,t,r)=>qF(e,typeof t!="symbol"?t+"":t,r),j_=class e{constructor(t){Ca(this,"client"),Ca(this,"namespaces"),Ca(this,"optionalNamespaces"),Ca(this,"sessionProperties"),Ca(this,"scopedProperties"),Ca(this,"events",new w1e.default),Ca(this,"rpcProviders",{}),Ca(this,"session"),Ca(this,"providerOpts"),Ca(this,"logger"),Ca(this,"uri"),Ca(this,"disableProviderPing",!1),Ca(this,"connectParams");var r,n;this.providerOpts=t,this.logger=d6({logger:(r=t.logger)!=null?r:r1e,name:(n=this.providerOpts.name)!=null?n:S1e}),this.disableProviderPing=t?.disableProviderPing||!1}static async init(t){let r=new e(t);return await r.initialize(),r}async request(t,r,n){let[o,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:z3({},t),chainId:`${o}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(t,r,n,o){let s=new Date().getTime();this.request(t,n,o).then(i=>r(null,oo(s,i))).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){var t;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(t=this.session)==null?void 0:t.topic,reason:Ir("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.connectParams=t,this.setNamespaces(t),this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();let{uri:n,response:o}=await this.client.authenticate(t,r);n&&(this.uri=n,this.events.emit("display_uri",n));let s=await o();if(this.session=s.session,this.session){let i=c1e(this.session.namespaces);this.namespaces=V_(this.namespaces,i),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){var r,n;let{uri:o,approval:s}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:(r=this.connectParams)==null?void 0:r.authentication,walletPay:(n=this.connectParams)==null?void 0:n.walletPay});o&&(this.uri=o,this.events.emit("display_uri",o));let i=await s();this.session=i;let a=c1e(i.namespaces);return this.namespaces=V_(this.namespaces,a),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;let[n,o]=this.validateChain(t),s=this.getProvider(n);s?s.setDefaultChain(o,r):this.session&&this.logger.warn(`Provider for namespace '${n}' not found in setDefaultChain`)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(t={}){try{this.logger.info("Cleaning up inactive pairings...");let r=this.client.pairing.getAll();if(!sl(r))return;for(let n of r)t.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}catch(r){this.logger.warn(r,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){var t,r;if(this.client=this.providerOpts.client||await Qme.init({core:this.providerOpts.core,logger:this.providerOpts.logger||r1e,relayUrl:this.providerOpts.relayUrl||vqe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(n){throw this.logger.error(n,"Failed to get session"),new Error(`The provided session: ${(r=(t=this.providerOpts)==null?void 0:t.session)==null?void 0:r.topic} doesn't exist in the Sign client`)}else{let n=this.client.session.getAll();this.session=n[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");let t=[...new Set(Object.keys(this.session.namespaces).map(r=>Hg(r)))];kF("client",this.client),kF("events",this.events),kF("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;let n=Oqe(r,this.session);if(n?.length===0)return;let o=P1e(n),s=V_(this.namespaces,this.optionalNamespaces),i=z_(z3({},s[r]),{accounts:n,chains:o});r==="eip155"?this.rpcProviders[r]=new zF({namespace:i}):this.rpcProviders[r]=new jF({namespace:i})})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{var r;let{topic:n}=t;n===((r=this.session)==null?void 0:r.topic)&&this.events.emit("session_ping",t)}
78),this.client.on("session_event",t=>{var r;let{params:n,topic:o}=t;if(o!==((r=this.session)==null?void 0:r.topic))return;let{event:s}=n;if(s.name==="accountsChanged"){let i=s.data;i&&sl(i)&&this.events.emit("accountsChanged",i.map(a1e))}else if(s.name==="chainChanged"){let i=n.chainId,a=n.event.data,c=Hg(i),l=BF(i)!==BF(a)?`${c}:${BF(a)}`:i;this.onChainChanged({currentCaipChainId:l})}else this.events.emit(s.name,s.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{var n,o;if(t!==((n=this.session)==null?void 0:n.topic))return;let{namespaces:s}=r,i=(o=this.client)==null?void 0:o.session.get(t);this.session=z_(z3({},i),{namespaces:s}),this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{var r;t.topic===((r=this.session)==null?void 0:r.topic)&&(await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",z_(z3({},Ir("USER_DISCONNECTED")),{data:t.topic})))}),this.on(GF.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged(z_(z3({},t),{internal:!0}))})}getProvider(t){return this.rpcProviders[t]||this.rpcProviders[T1e]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{var r;this.getProvider(t).updateNamespace((r=this.session)==null?void 0:r.namespaces[t])})}setNamespaces(t){let{namespaces:r={},optionalNamespaces:n={},sessionProperties:o,scopedProperties:s}=t;this.optionalNamespaces=V_(r,n),this.sessionProperties=o,this.scopedProperties=s}validateChain(t){let[r,n]=t?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(i=>Hg(i)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];let o=Hg(Object.keys(this.namespaces)[0]),s=this.rpcProviders[o].getDefaultChain();return[o,s]}async requestAccounts(){let[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}async onChainChanged({currentCaipChainId:t,previousCaipChainId:r,internal:n=!1}){if(!this.namespaces)return;let[o,s]=this.validateChain(t);if(s){if(this.updateNamespaceChain(o,s),n)this.events.emit("chainChanged",s),this.emitAccountsChangedOnChainChange({namespace:o,currentCaipChainId:t,previousCaipChainId:r});else{let i=this.getProvider(o);i?i.setDefaultChain(s):this.session&&this.logger.warn(`Provider for namespace '${o}' not found during chain change`)}await this.persist("namespaces",this.namespaces)}}emitAccountsChangedOnChainChange({namespace:t,currentCaipChainId:r,previousCaipChainId:n}){var o,s;try{if(n===r)return;let i=(s=(o=this.session)==null?void 0:o.namespaces[t])==null?void 0:s.accounts;if(!i)return;let a=i.filter(c=>c.includes(`${r}:`)).map(a1e);if(!sl(a))return;this.events.emit("accountsChanged",a)}catch(i){this.logger.warn(i,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(t,r){if(!this.namespaces)return;let n=this.namespaces[t]?t:`${t}:${r}`,o={chains:[],methods:[],events:[],defaultChain:r};this.namespaces[n]?this.namespaces[n]&&(this.namespaces[n].defaultChain=r):this.namespaces[n]=o}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.connectParams=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(t,r){var n;let o=((n=this.session)==null?void 0:n.topic)||"";await this.client.core.storage.setItem(`${$_}/${t}${o}`,r)}async getFromStore(t){var r;let n=((r=this.session)==null?void 0:r.topic)||"";return await this.client.core.storage.getItem(`${$_}/${t}${n}`)}async deleteFromStore(t){var r;let n=((r=this.session)==null?void 0:r.topic)||"";await this.client.core.storage.removeItem(`${$_}/${t}${n}`)}async cleanupStorage(){var t;try{if(((t=this.client)==null?void 0:t.session.length)>0)return;let r=await this.client.core.storage.getKeys();for(let n of r)n.startsWith($_)&&await this.client.core.storage.removeItem(n)}catch(r){this.logger.warn(r,"Failed to cleanup storage")}}}});var q_,O1e=h(()=>{q_={interpolate(e,t,r){if(e.length!==2||t.length!==2)throw new Error("inputRange and outputRange must be an array of length 2");let n=e[0]||0,o=e[1]||0,s=t[0]||0,i=t[1]||0;return r<n?s:r>o?i:(i-s)/(o-n)*(r-n)+s}}});var W_,K_,YF,B1e,j3,ki,yr,k1e,JF,QF=h(()=>{W_=globalThis,K_=W_.ShadowRoot&&(W_.ShadyCSS===void 0||W_.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,YF=Symbol(),B1e=new WeakMap,j3=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==YF)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(K_&&t===void 0){let n=r!==void 0&&r.length===1;
vendor: 5,016 bytes, line 78
78n&&(t=B1e.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&B1e.set(r,t))}return t}toString(){return this.cssText}},ki=e=>new j3(typeof e=="string"?e:e+"",void 0,YF),yr=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((n,o,s)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new j3(r,e,YF)},k1e=(e,t)=>{if(K_)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),o=W_.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=r.cssText,e.appendChild(n)}},JF=K_?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return ki(r)})(e):e});var hWe,mWe,gWe,yWe,wWe,bWe,Z_,D1e,xWe,vWe,q3,W3,G_,U1e,af,K3=h(()=>{QF();QF();({is:hWe,defineProperty:mWe,getOwnPropertyDescriptor:gWe,getOwnPropertyNames:yWe,getOwnPropertySymbols:wWe,getPrototypeOf:bWe}=Object),Z_=globalThis,D1e=Z_.trustedTypes,xWe=D1e?D1e.emptyScript:"",vWe=Z_.reactiveElementPolyfillSupport,q3=(e,t)=>e,W3={toAttribute(e,t){switch(t){case Boolean:e=e?xWe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},G_=(e,t)=>!hWe(e,t),U1e={attribute:!0,type:String,converter:W3,reflect:!1,useDefault:!1,hasChanged:G_};Symbol.metadata??=Symbol("metadata"),Z_.litPropertyMetadata??=new WeakMap;af=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=U1e){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),o=this.getPropertyDescriptor(t,n,r);o!==void 0&&mWe(this.prototype,t,o)}}static getPropertyDescriptor(t,r,n){let{get:o,set:s}=gWe(this.prototype,t)??{get(){return this[r]},set(i){this[r]=i}};return{get:o,set(i){let a=o?.call(this);s?.call(this,i),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??U1e}static _$Ei(){if(this.hasOwnProperty(q3("elementProperties")))return;let t=bWe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(q3("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(q3("properties"))){let r=this.properties,n=[...yWe(r),...wWe(r)];for(let o of n)this.createProperty(o,r[o])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,o]of r)this.elementProperties.set(n,o)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let o=this._$Eu(r,n);o!==void 0&&this._$Eh.set(o,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let o of n)r.unshift(JF(o))}else t!==void 0&&r.push(JF(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return k1e(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$ET(t,r){let n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(o!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:W3).toAttribute(r,n.type);this._$Em=t,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$Em=null}}_$AK(t,r){let n=this.constructor,o=n._$Eh.get(t);if(o!==void 0&&this._$Em!==o){let s=n.getPropertyOptions(o),i=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:W3;this._$Em=o;let a=i.fromAttribute(r,s.type);this[o]=a??this._$Ej?.get(o)??a,this._$Em=null}}
vendor: 4,790 bytes, lines 78-80
78requestUpdate(t,r,n,o=!1,s){if(t!==void 0){let i=this.constructor;if(o===!1&&(s=this[t]),n??=i.getPropertyOptions(t),!((n.hasChanged??G_)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,n))))return;this.C(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,r,{useDefault:n,reflect:o,wrapped:s},i){n&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,i??r??this[t]),s!==!0||i!==void 0)||(this._$AL.has(t)||(this.hasUpdated||n||(r=void 0),this._$AL.set(t,r)),o===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[o,s]of this._$Ep)this[o]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[o,s]of n){let{wrapped:i}=s,a=this[o];i!==!0||this._$AL.has(o)||a===void 0||this.C(o,void 0,s,a)}}let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),this._$EO?.forEach(n=>n.hostUpdate?.()),this.update(r)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(r)}willUpdate(t){}_$AE(t){this._$EO?.forEach(r=>r.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(r=>this._$ET(r,this[r])),this._$EM()}updated(t){}firstUpdated(t){}};af.elementStyles=[],af.shadowRootOptions={mode:"open"},af[q3("elementProperties")]=new Map,af[q3("finalized")]=new Map,vWe?.({ReactiveElement:af}),(Z_.reactiveElementVersions??=[]).push("2.1.2")});function K1e(e,t){if(!nV(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return M1e!==void 0?M1e.createHTML(t):t}function jg(e,t,r=e,n){if(t===lf)return t;let o=n!==void 0?r._$Co?.[n]:r._$Cl,s=Y3(t)?void 0:t._$litDirective$;return o?.constructor!==s&&(o?._$AO?.(!1),s===void 0?o=void 0:(o=new s(e),o._$AT(e,r,n)),n!==void 0?(r._$Co??=[])[n]=o:r._$Cl=o),o!==void 0&&(t=jg(e,o._$AS(e,t.values),o,n)),t}var eV,L1e,Y_,M1e,tV,cf,rV,EWe,zg,G3,Y3,nV,j1e,XF,Z3,H1e,$1e,Fg,F1e,V1e,q1e,oV,$,De,W1e,lf,an,z1e,Vg,Z1e,J3,J_,v6,qg,Q_,X_,e7,t7,G1e,AWe,Y1e,uf=h(()=>{eV=globalThis,L1e=e=>e,Y_=eV.trustedTypes,M1e=Y_?Y_.createPolicy("lit-html",{createHTML:e=>e}):void 0,tV="$lit$",cf=`lit$${Math.random().toFixed(9).slice(2)}$`,rV="?"+cf,EWe=`<${rV}>`,zg=document,G3=()=>zg.createComment(""),Y3=e=>e===null||typeof e!="object"&&typeof e!="function",nV=Array.isArray,j1e=e=>nV(e)||typeof e?.[Symbol.iterator]=="function",XF=`[ 	
79\f\r]`,Z3=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H1e=/-->/g,$1e=/>/g,Fg=RegExp(`>|${XF}(?:([^\\s"'>=/]+)(${XF}*=${XF}*(?:[^ 	
80\f\r"'\`<>=]|("|')|))|$)`,"g"),F1e=/'/g,V1e=/"/g,q1e=/^(?:script|style|textarea|title)$/i,oV=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),$=oV(1),De=oV(2),W1e=oV(3),lf=Symbol.for("lit-noChange"),an=Symbol.for("lit-nothing"),z1e=new WeakMap,Vg=zg.createTreeWalker(zg,129);Z1e=(e,t)=>{let r=e.length-1,n=[],o,s=t===2?"<svg>":t===3?"<math>":"",i=Z3;for(let a=0;a<r;a++){let c=e[a],l,u,d=-1,p=0;for(;p<c.length&&(i.lastIndex=p,u=i.exec(c),u!==null);)p=i.lastIndex,i===Z3?u[1]==="!--"?i=H1e:u[1]!==void 0?i=$1e:u[2]!==void 0?(q1e.test(u[2])&&(o=RegExp("</"+u[2],"g")),i=Fg):u[3]!==void 0&&(i=Fg):i===Fg?u[0]===">"?(i=o??Z3,d=-1):u[1]===void 0?d=-2:(d=i.lastIndex-u[2].length,l=u[1],i=u[3]===void 0?Fg:u[3]==='"'?V1e:F1e):i===V1e||i===F1e?i=Fg:i===H1e||i===$1e?i=Z3:(i=Fg,o=void 0);let f=i===Fg&&e[a+1].startsWith("/>")?" ":"";s+=i===Z3?c+EWe:d>=0?(n.push(l),c.slice(0,d)+tV+c.slice(d)+cf+f):c+cf+(d===-2?a:f)}return[K1e(e,s+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]},J3=class e{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let s=0,i=0,a=t.length-1,c=this.parts,[l,u]=Z1e(t,r);if(this.el=e.createElement(l,n),Vg.currentNode=this.el.content,r===2||r===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Vg.nextNode())!==null&&c.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let d of o.getAttributeNames())if(d.endsWith(tV)){let p=u[i++],f=o.getAttribute(d).split(cf),m=/([.?@])?(.*)/.exec(p);c.push({type:1,index:s,name:m[2],strings:f,ctor:m[1]==="."?Q_:m[1]==="?"?X_:m[1]==="@"?e7:qg}),o.removeAttribute(d)}else d.startsWith(cf)&&(c.push({type:6,index:s}),o.removeAttribute(d));if(q1e.test(o.tagName)){let d=o.textContent.split(cf),p=d.length-1;if(p>0){o.textContent=Y_?Y_.emptyScript:"";for(let f=0;f<p;f++)o.append(d[f],G3()),Vg.nextNode(),c.push({type:2,index:++s}
vendor: 11,961 bytes, line 80
80);o.append(d[p],G3())}}}else if(o.nodeType===8)if(o.data===rV)c.push({type:2,index:s});else{let d=-1;for(;(d=o.data.indexOf(cf,d+1))!==-1;)c.push({type:7,index:s}),d+=cf.length-1}s++}}static createElement(t,r){let n=zg.createElement("template");return n.innerHTML=t,n}};J_=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:r},parts:n}=this._$AD,o=(t?.creationScope??zg).importNode(r,!0);Vg.currentNode=o;let s=Vg.nextNode(),i=0,a=0,c=n[0];for(;c!==void 0;){if(i===c.index){let l;c.type===2?l=new v6(s,s.nextSibling,this,t):c.type===1?l=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(l=new t7(s,this,t)),this._$AV.push(l),c=n[++a]}i!==c?.index&&(s=Vg.nextNode(),i++)}return Vg.currentNode=zg,o}p(t){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}},v6=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,n,o){this.type=2,this._$AH=an,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=jg(this,t,r),Y3(t)?t===an||t==null||t===""?(this._$AH!==an&&this._$AR(),this._$AH=an):t!==this._$AH&&t!==lf&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):j1e(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==an&&Y3(this._$AH)?this._$AA.nextSibling.data=t:this.T(zg.createTextNode(t)),this._$AH=t}$(t){let{values:r,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=J3.createElement(K1e(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(r);else{let s=new J_(o,this),i=s.u(this.options);s.p(r),this.T(i),this._$AH=s}}_$AC(t){let r=z1e.get(t.strings);return r===void 0&&z1e.set(t.strings,r=new J3(t)),r}k(t){nV(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,o=0;for(let s of t)o===r.length?r.push(n=new e(this.O(G3()),this.O(G3()),this,this.options)):n=r[o],n._$AI(s),o++;o<r.length&&(this._$AR(n&&n._$AB.nextSibling,o),r.length=o)}_$AR(t=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);t!==this._$AB;){let n=L1e(t).nextSibling;L1e(t).remove(),t=n}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},qg=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,o,s){this.type=1,this._$AH=an,this._$AN=void 0,this.element=t,this.name=r,this._$AM=o,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=an}_$AI(t,r=this,n,o){let s=this.strings,i=!1;if(s===void 0)t=jg(this,t,r,0),i=!Y3(t)||t!==this._$AH&&t!==lf,i&&(this._$AH=t);else{let a=t,c,l;for(t=s[0],c=0;c<s.length-1;c++)l=jg(this,a[n+c],r,c),l===lf&&(l=this._$AH[c]),i||=!Y3(l)||l!==this._$AH[c],l===an?t=an:t!==an&&(t+=(l??"")+s[c+1]),this._$AH[c]=l}i&&!o&&this.j(t)}j(t){t===an?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},Q_=class extends qg{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===an?void 0:t}},X_=class extends qg{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==an)}},e7=class extends qg{constructor(t,r,n,o,s){super(t,r,n,o,s),this.type=5}_$AI(t,r=this){if((t=jg(this,t,r,0)??an)===lf)return;let n=this._$AH,o=t===an&&n!==an||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==an&&(n===an||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},t7=class{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){jg(this,t)}},G1e={M:tV,P:cf,A:rV,C:1,L:Z1e,R:J_,D:j1e,V:jg,I:v6,H:qg,N:X_,U:e7,B:Q_,F:t7},AWe=eV.litHtmlPolyfillSupport;AWe?.(J3,v6),(eV.litHtmlVersions??=[]).push("3.3.3");Y1e=(e,t,r)=>{let n=r?.renderBefore??t,o=n._$litPart$;if(o===void 0){let s=r?.renderBefore??null;n._$litPart$=o=new v6(t.insertBefore(G3(),s),s,void 0,r??{})}return o._$AI(e),o}});var sV,ne,CWe,J1e=h(()=>{K3();K3();uf();uf();sV=globalThis,ne=class extends af{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Y1e(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return lf}};ne._$litElement$=!0,ne.finalized=!0,sV.litElementHydrateSupport?.({LitElement:ne});CWe=sV.litElementPolyfillSupport;CWe?.({LitElement:ne});(sV.litElementVersions??=[]).push("4.2.2")});var Q1e=h(()=>{});var le=h(()=>{K3();uf();J1e();Q1e()});var X1e,Q3,ege,tge,SWe,IWe,TWe,_We,PWe,NWe,r7,iV=h(()=>{X1e={black:"#202020",white:"#FFFFFF",white010:"rgba(255, 255, 255, 0.1)",accent010:"rgba(9, 136, 240, 0.1)",accent020:"rgba(9, 136, 240, 0.2)",accent030:"rgba(9, 136, 240, 0.3)",accent040:"rgba(9, 136, 240, 0.4)",accent050:"rgba(9, 136, 240, 0.5)",accent060:"rgba(9, 136, 240, 0.6)",accent070:"rgba(9, 136, 240, 0.7)",accent080:"rgba(9, 136, 240, 0.8)",accent090:"rgba(9, 136, 240, 0.9)",accent100:"rgba(9, 136, 240, 1.0)",accentSecondary010:"rgba(199, 185, 148, 0.1)",accentSecondary020:"rgba(199, 185, 148, 0.2)",accentSecondary030:"rgba(199, 185, 148, 0.3)",accentSecondary040:"rgba(199, 185, 148, 0.4)",accentSecondary050:"rgba(199, 185, 148, 0.5)",accentSecondary060:"rgba(199, 185, 148, 0.6)",accentSecondary070:"rgba(199, 185, 148, 0.7)",accentSecondary080:"rgba(199, 185, 148, 0.8)",accentSecondary090:"rgba(199, 185, 148, 0.9)",accentSecondary100:"rgba(199, 185, 148, 1.0)",productWalletKit:"#FFB800",productAppKit:"#FF573B",productCloud:"#0988F0",productDocumentation:"#008847",neutrals050:"#F6F6F6",neutrals100:"#F3F3F3",neutrals200:"#E9E9E9",neutrals300:"#D0D0D0",neutrals400:"#BBB",neutrals500:"#9A9A9A",neutrals600:"#6C6C6C",neutrals700:"#4F4F4F",neutrals800:"#363636",neutrals900:"#2A2A2A",neutrals1000:"#252525",semanticSuccess010:"rgba(48, 164, 107, 0.1)",semanticSuccess020:"rgba(48, 164, 107, 0.2)",semanticSuccess030:"rgba(48, 164, 107, 0.3)",semanticSuccess040:"rgba(48, 164, 107, 0.4)",semanticSuccess050:"rgba(48, 164, 107, 0.5)",semanticSuccess060:"rgba(48, 164, 107, 0.6)",semanticSuccess070:"rgba(48, 164, 107, 0.7)",semanticSuccess080:"rgba(48, 164, 107, 0.8)",semanticSuccess090:"rgba(48, 164, 107, 0.9)",semanticSuccess100:"rgba(48, 164, 107, 1.0)",semanticError010:"rgba(223, 74, 52, 0.1)",semanticError020:"rgba(223, 74, 52, 0.2)",semanticError030:"rgba(223, 74, 52, 0.3)",semanticError040:"rgba(223, 74, 52, 0.4)",semanticError050:"rgba(223, 74, 52, 0.5)",semanticError060:"rgba(223, 74, 52, 0.6)",semanticError070:"rgba(223, 74, 52, 0.7)",semanticError080:"rgba(223, 74, 52, 0.8)",semanticError090:"rgba(223, 74, 52, 0.9)",semanticError100:"rgba(223, 74, 52, 1.0)",semanticWarning010:"rgba(243, 161, 63, 0.1)",semanticWarning020:"rgba(243, 161, 63, 0.2)",semanticWarning030:"rgba(243, 161, 63, 0.3)",semanticWarning040:"rgba(243, 161, 63, 0.4)",semanticWarning050:"rgba(243, 161, 63, 0.5)",semanticWarning060:"rgba(243, 161, 63, 0.6)",semanticWarning070:"rgba(243, 161, 63, 0.7)",semanticWarning080:"rgba(243, 161, 63, 0.8)",semanticWarning090:"rgba(243, 161, 63, 0.9)",semanticWarning100:"rgba(243, 161, 63, 1.0)"},Q3={core:{backgroundAccentPrimary:"#0988F0",backgroundAccentCertified:"#C7B994",backgroundWalletKit:"#FFB800",backgroundAppKit:"#FF573B",backgroundCloud:"#0988F0",backgroundDocumentation:"#008847",backgroundSuccess:"rgba(48, 164, 107, 0.20)",backgroundError:"rgba(223, 74, 52, 0.20)",backgroundWarning:"rgba(243, 161, 63, 0.20)",textAccentPrimary:"#0988F0",textAccentCertified:"#C7B994",textWalletKit:"#FFB800",textAppKit:"#FF573B",textCloud:"#0988F0",textDocumentation:"#008847",textSuccess:"#30A46B",textError:"#DF4A34",textWarning:"#F3A13F",borderAccentPrimary:"#0988F0",borderSecondary:"#C7B994",borderSuccess:"#30A46B",borderError:"#DF4A34",borderWarning:"#F3A13F",foregroundAccent010:"rgba(9, 136, 240, 0.1)",foregroundAccent020:"rgba(9, 136, 240, 0.2)",foregroundAccent040:"rgba(9, 136, 240, 0.4)",foregroundAccent060:"rgba(9, 136, 240, 0.6)",foregroundSecondary020:"rgba(199, 185, 148, 0.2)",foregroundSecondary040:"rgba(199, 185, 148, 0.4)",foregroundSecondary060:"rgba(199, 185, 148, 0.6)",iconAccentPrimary:"#0988F0",iconAccentCertified:"#C7B994",iconSuccess:"#30A46B",iconError:"#DF4A34",iconWarning:"#F3A13F",glass010:"rgba(255, 255, 255, 0.1)",zIndex:"9999"},dark:{overlay:"rgba(0, 0, 0, 0.50)",backgroundPrimary:"#202020",backgroundInvert:"#FFFFFF",textPrimary:"#FFFFFF",textSecondary:"#9A9A9A",textTertiary:"#BBBBBB",textInvert:"#202020",borderPrimary:"#2A2A2A",borderPrimaryDark:"#363636",borderSecondary:"#4F4F4F",foregroundPrimary:"#252525",foregroundSecondary:"#2A2A2A",foregroundTertiary:"#363636",iconDefault:"#9A9A9A",iconInverse:"#FFFFFF"},light:{overlay:"rgba(230 , 230, 230, 0.5)",backgroundPrimary:"#FFFFFF",borderPrimaryDark:"#E9E9E9",backgroundInvert:"#202020",textPrimary:"#202020",textSecondary:"#9A9A9A",textTertiary:"#6C6C6C",textInvert:"#FFFFFF",borderPrimary:"#E9E9E9",borderSecondary:"#D0D0D0",foregroundPrimary:"#F3F3F3",foregroundSecondary:"#E9E9E9",foregroundTertiary:"#D0D0D0",iconDefault:"#9A9A9A",iconInverse:"#202020"}},ege={1:"4px",2:"8px",10:"10px",3:"12px",4:"16px",6:"24px",5:"20px",8:"32px",16:"64px",20:"80px",32:"128px",64:"256px",128:"512px",round:"9999px"},tge={0:"0px","01":"2px",1:"4px",2:"8px",3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",12:"48px",14:"56px",16:"64px",20:"80px",32:"128px",64:"256px"},SWe={regular:"KHTeka",mono:"KHTekaMono"},IWe={regular:"400",medium:"500"},TWe={h1:"50px",h2:"44px",h3:"38px",h4:"32px",h5:"26px",h6:"20px",large:"16px",medium:"14px",small:"12px"},_We={"h1-regular-mono":{lineHeight:"50px",letterSpacing:"-3px"},"h1-regular":{lineHeight:"50px",letterSpacing:"-1px"},"h1-medium":{lineHeight:"50px",letterSpacing:"-0.84px"},"h2-regular-mono":{lineHeight:"44px",letterSpacing:"-2.64px"},"h2-regular":{lineHeight:"44px",letterSpacing:"-0.88px"},"h2-medium":{lineHeight:"44px",letterSpacing:"-0.88px"},"h3-regular-mono":{lineHeight:"38px",letterSpacing:"-2.28px"},"h3-regular":{lineHeight:"38px",letterSpacing:"-0.76px"},"h3-medium":{lineHeight:"38px",letterSpacing:"-0.76px"},"h4-regular-mono":{lineHeight:"32px",letterSpacing:"-1.92px"},"h4-regular":{lineHeight:"32px",letterSpacing:"-0.32px"},"h4-medium":{lineHeight:"32px",letterSpacing:"-0.32px"},"h5-regular-mono":{lineHeight:"26px",letterSpacing:"-1.56px"},"h5-regular":{lineHeight:"26px",letterSpacing:"-0.26px"},"h5-medium":{lineHeight:"26px",letterSpacing:"-0.26px"},"h6-regular-mono":{lineHeight:"20px",letterSpacing:"-1.2px"},"h6-regular":{lineHeight:"20px",letterSpacing:"-0.6px"},"h6-medium":{lineHeight:"20px",letterSpacing:"-0.6px"},"lg-regular-mono":{lineHeight:"16px",letterSpacing:"-0.96px"},"lg-regular":{lineHeight:"18px",letterSpacing:"-0.16px"},"lg-medium":{lineHeight:"18px",letterSpacing:"-0.16px"},"md-regular-mono":{lineHeight:"14px",letterSpacing:"-0.84px"},"md-regular":{lineHeight:"16px",letterSpacing:"-0.14px"},"md-medium":{lineHeight:"16px",letterSpacing:"-0.14px"},"sm-regular-mono":{lineHeight:"12px",letterSpacing:"-0.72px"},"sm-regular":{lineHeight:"14px",letterSpacing:"-0.12px"},"sm-medium":{lineHeight:"14px",letterSpacing:"-0.12px"}}
80,PWe={"ease-out-power-2":"cubic-bezier(0.23, 0.09, 0.08, 1.13)","ease-out-power-1":"cubic-bezier(0.12, 0.04, 0.2, 1.06)","ease-in-power-2":"cubic-bezier(0.92, -0.13, 0.77, 0.91)","ease-in-power-1":"cubic-bezier(0.88, -0.06, 0.8, 0.96)","ease-inout-power-2":"cubic-bezier(0.77, 0.09, 0.23, 1.13)","ease-inout-power-1":"cubic-bezier(0.88, 0.04, 0.12, 1.06)"},NWe={xl:"400ms",lg:"200ms",md:"125ms",sm:"75ms"},r7={colors:X1e,fontFamily:SWe,fontWeight:IWe,textSize:TWe,typography:_We,tokens:{core:Q3.core,theme:Q3.dark},borderRadius:ege,spacing:tge,durations:NWe,easings:PWe}});function n7(e){if(!e)return{};let t={};return t["font-family"]=e["--apkt-font-family"]??e["--w3m-font-family"]??"KHTeka",t.accent=e["--apkt-accent"]??e["--w3m-accent"]??"#0988F0",t["color-mix"]=e["--apkt-color-mix"]??e["--w3m-color-mix"]??"#000",t["color-mix-strength"]=e["--apkt-color-mix-strength"]??e["--w3m-color-mix-strength"]??0,t["font-size-master"]=e["--apkt-font-size-master"]??e["--w3m-font-size-master"]??"10px",t["border-radius-master"]=e["--apkt-border-radius-master"]??e["--w3m-border-radius-master"]??"4px",e["--apkt-z-index"]!==void 0?t["z-index"]=e["--apkt-z-index"]:e["--w3m-z-index"]!==void 0&&(t["z-index"]=e["--w3m-z-index"]),t}function ce(e,...t){return yr(e,...t.map(r=>typeof r=="function"?ki(r(Ut)):ki(r)))}var rge,mu,Ut,Tt=h(()=>{le();iV();rge="--apkt";mu={createCSSVariables(e){let t={},r={};function n(s,i,a=""){for(let[c,l]of Object.entries(s)){let u=a?`${a}-${c}`:c;l&&typeof l=="object"&&Object.keys(l).length?(i[c]={},n(l,i[c],u)):typeof l=="string"&&(i[c]=`${rge}-${u}`)}}function o(s,i){for(let[a,c]of Object.entries(s))c&&typeof c=="object"?(i[a]={},o(c,i[a])):typeof c=="string"&&(i[a]=`var(${c})`)}return n(e,t),o(t,r),{cssVariables:t,cssVariablesVarPrefix:r}},assignCSSVariables(e,t){let r={};function n(o,s,i){for(let[a,c]of Object.entries(o)){let l=i?`${i}-${a}`:a,u=s[a];c&&typeof c=="object"?n(c,u,l):typeof u=="string"&&(r[`${rge}-${l}`]=u)}}return n(e,t),r},createRootStyles(e,t){let r={...r7,tokens:{...r7.tokens,theme:e==="light"?Q3.light:Q3.dark}},{cssVariables:n}=mu.createCSSVariables(r),o=mu.assignCSSVariables(n,r),s=mu.generateW3MVariables(t),i=mu.generateW3MOverrides(t),a=mu.generateScaledVariables(t),c=mu.generateBaseVariables(o),l={...o,...c,...s,...i,...a},u=mu.applyColorMixToVariables(t,l),d={...l,...u};return`:root {${Object.entries(d).map(([f,m])=>`${f}:${m.replace("/[:;{}</>]/g","")};`).join("")}}`},generateW3MVariables(e){if(!e)return{};let t=n7(e),r={};return r["--w3m-font-family"]=t["font-family"],r["--w3m-accent"]=t.accent,r["--w3m-color-mix"]=t["color-mix"],r["--w3m-color-mix-strength"]=`${t["color-mix-strength"]}%`,r["--w3m-font-size-master"]=t["font-size-master"],r["--w3m-border-radius-master"]=t["border-radius-master"],r},generateW3MOverrides(e){if(!e)return{};let t=n7(e),r={};if(e["--apkt-accent"]||e["--w3m-accent"]){let n=t.accent;r["--apkt-tokens-core-iconAccentPrimary"]=n,r["--apkt-tokens-core-borderAccentPrimary"]=n,r["--apkt-tokens-core-textAccentPrimary"]=n,r["--apkt-tokens-core-backgroundAccentPrimary"]=n}return(e["--apkt-font-family"]||e["--w3m-font-family"])&&(r["--apkt-fontFamily-regular"]=t["font-family"]),t["z-index"]!==void 0&&(r["--apkt-tokens-core-zIndex"]=`${t["z-index"]}`),r},generateScaledVariables(e){if(!e)return{};let t=n7(e),r={};if(e["--apkt-font-size-master"]||e["--w3m-font-size-master"]){let n=parseFloat(t["font-size-master"].replace("px",""));r["--apkt-textSize-h1"]=`${Number(n)*5}px`,r["--apkt-textSize-h2"]=`${Number(n)*4.4}px`,r["--apkt-textSize-h3"]=`${Number(n)*3.8}px`,r["--apkt-textSize-h4"]=`${Number(n)*3.2}px`,r["--apkt-textSize-h5"]=`${Number(n)*2.6}px`,r["--apkt-textSize-h6"]=`${Number(n)*2}px`,r["--apkt-textSize-large"]=`${Number(n)*1.6}px`,r["--apkt-textSize-medium"]=`${Number(n)*1.4}px`,r["--apkt-textSize-small"]=`${Number(n)*1.2}px`}if(e["--apkt-border-radius-master"]||e["--w3m-border-radius-master"]){let n=parseFloat(t["border-radius-master"].replace("px",""));r["--apkt-borderRadius-1"]=`${Number(n)}px`,r["--apkt-borderRadius-2"]=`${Number(n)*2}px`,r["--apkt-borderRadius-3"]=`${Number(n)*3}px`,r["--apkt-borderRadius-4"]=`${Number(n)*4}px`,r["--apkt-borderRadius-5"]=`${Number(n)*5}px`,r["--apkt-borderRadius-6"]=`${Number(n)*6}px`,r["--apkt-borderRadius-8"]=`${Number(n)*8}px`,r["--apkt-borderRadius-16"]=`${Number(n)*16}px`,r["--apkt-borderRadius-20"]=`${Number(n)*20}px`,r["--apkt-borderRadius-32"]=`${Number(n)*32}px`,r["--apkt-borderRadius-64"]=`${Number(n)*64}px`,r["--apkt-borderRadius-128"]=`${Number(n)*128}px`}return r},generateColorMixCSS(e,t){if(!e?.["--w3m-color-mix"]||!e["--w3m-color-mix-strength"])return"";let r=e["--w3m-color-mix"],n=e["--w3m-color-mix-strength"];if(!n||n===0)return"";let o=Object.keys(t||{}).filter(i=>{let a=i.includes("-tokens-core-background")||i.includes("-tokens-core-text")||i.includes("-tokens-core-border")||i.includes("-tokens-core-foreground")||i.includes("-tokens-core-icon")||i.includes("-tokens-theme-background")||i.includes("-tokens-theme-text")||i.includes("-tokens-theme-border")||i.includes("-tokens-theme-foreground")||i.includes("-tokens-theme-icon"),c=i.includes("-borderRadius-")||i.includes("-spacing-")||i.includes("-textSize-")||i.includes("-fontFamily-")||i.includes("-fontWeight-")||i.includes("-typography-")||i.includes("-duration-")||i.includes("-ease-")||i.includes("-path-")||i.includes("-width-")||i.includes("-height-")||i.includes("-visual-size-")||i.includes("-modal-width")||i.includes("-cover");return a&&!c});return o.length===0?"":` @supports (background: color-mix(in srgb, white 50%, black)) {
81      :root {
82        ${o.map(i=>{let a=t?.[i]||"";return a.includes("color-mix")||a.startsWith("#")||a.startsWith("rgb")?`${i}: color-mix(in srgb, ${r} ${n}%, ${a});`:`${i}: color-mix(in srgb, ${r} ${n}%, var(${i}-base, ${a}));`}).join("")}
83      }
84    }`},generateBaseVariables(e){let t={},r=e["--apkt-tokens-theme-backgroundPrimary"];r&&(t["--apkt-tokens-theme-backgroundPrimary-base"]=r);let n=e["--apkt-tokens-core-backgroundAccentPrimary"];return n&&(t["--apkt-tokens-core-backgroundAccentPrimary-base"]=n),t},applyColorMixToVariables(e,t){let r={};t?.["--apkt-tokens-theme-backgroundPrimary"]&&(r["--apkt-tokens-theme-backgroundPrimary"]="var(--apkt-tokens-theme-backgroundPrimary-base)"),t?.["--apkt-tokens-core-backgroundAccentPrimary"]&&(r["--apkt-tokens-core-backgroundAccentPrimary"]="var(--apkt-tokens-core-backgroundAccentPrimary-base)");let n=n7(e),o=n["color-mix"],s=n["color-mix-strength"];if(!s||s===0)return r;let i=Object.keys(t||{}).filter(a=>{let c=a.includes("-tokens-core-background")||a.includes("-tokens-core-text")||a.includes("-tokens-core-border")||a.includes("-tokens-core-foreground")||a.includes("-tokens-core-icon")||a.includes("-tokens-theme-background")||a.includes("-tokens-theme-text")||a.includes("-tokens-theme-border")||a.includes("-tokens-theme-foreground")||a.includes("-tokens-theme-icon")||a.includes("-tokens-theme-overlay"),l=a.includes("-borderRadius-")||a.includes("-spacing-")||a.includes("-textSize-")||a.includes("-fontFamily-")||a.includes("-fontWeight-")||a.includes("-typography-")||a.includes("-duration-")||a.includes("-ease-")||a.includes("-path-")||a.includes("-width-")||a.includes("-height-")||a.includes("-visual-size-")||a.includes("-modal-width")||a.includes("-cover");return c&&!l});
84return i.length===0||i.forEach(a=>{let c=t?.[a]||"";a.endsWith("-base")||(a==="--apkt-tokens-theme-backgroundPrimary"||a==="--apkt-tokens-core-backgroundAccentPrimary"?r[a]=`color-mix(in srgb, ${o} ${s}%, var(${a}-base))`:c.includes("color-mix")||c.startsWith("#")||c.startsWith("rgb")?r[a]=`color-mix(in srgb, ${o} ${s}%, ${c})`:r[a]=`color-mix(in srgb, ${o} ${s}%, var(${a}-base, ${c}))`)}),r}},{cssVariablesVarPrefix:Ut}=mu.createCSSVariables(r7)});function s7(e,t="dark"){Wg&&document.head.removeChild(Wg),Wg=document.createElement("style"),Wg.textContent=mu.createRootStyles(t,e),document.head.appendChild(Wg)}function aV(e,t="dark"){if(o7=e,Kg=document.createElement("style"),gu=document.createElement("style"),ll=document.createElement("style"),Kg.textContent=E6(e).core.cssText,gu.textContent=E6(e).dark.cssText,ll.textContent=E6(e).light.cssText,document.head.appendChild(Kg),document.head.appendChild(gu),document.head.appendChild(ll),s7(e,t),X3(t),!(e?.["--apkt-font-family"]||e?.["--w3m-font-family"]))for(let[n,o]of Object.entries(df)){let s=document.createElement("link");s.rel="preload",s.href=o,s.as="font",s.type=n.includes("woff2")?"font/woff2":"font/woff",s.crossOrigin="anonymous",document.head.appendChild(s)}X3(t)}function X3(e="dark"){gu&&ll&&Wg&&(e==="light"?(s7(o7,e),gu.removeAttribute("media"),ll.media="enabled"):(s7(o7,e),ll.removeAttribute("media"),gu.media="enabled"))}function cV(e){if(o7=e,Kg&&gu&&ll){Kg.textContent=E6(e).core.cssText,gu.textContent=E6(e).dark.cssText,ll.textContent=E6(e).light.cssText;let t=e?.["--apkt-font-family"]||e?.["--w3m-font-family"];t&&(Kg.textContent=Kg.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),gu.textContent=gu.textContent?.replace("font-family: KHTeka",`font-family: ${t}`),ll.textContent=ll.textContent?.replace("font-family: KHTeka",`font-family: ${t}`))}if(Wg){let t=ll?.media==="enabled"?"light":"dark";s7(e,t)}}function E6(e){let t=!!(e?.["--apkt-font-family"]||e?.["--w3m-font-family"]);return{core:yr`
85      ${t?yr``:yr`
86            @font-face {
87              font-family: 'KHTeka';
88              src:
89                url(${ki(df["KHTeka-400-woff2"])}) format('woff2'),
90                url(${ki(df["KHTeka-400-woff"])}) format('woff');
91              font-weight: 400;
92              font-style: normal;
93              font-display: swap;
94            }
95
96            @font-face {
97              font-family: 'KHTeka';
98              src:
99                url(${ki(df["KHTeka-300-woff2"])}) format('woff2'),
100                url(${ki(df["KHTeka-300-woff"])}) format('woff');
101              font-weight: 300;
102              font-style: normal;
103            }
104
105            @font-face {
106              font-family: 'KHTekaMono';
107              src:
108                url(${ki(df["KHTekaMono-400-woff2"])}) format('woff2'),
109                url(${ki(df["KHTekaMono-400-woff"])}) format('woff');
110              font-weight: 400;
111              font-style: normal;
112            }
113
114            @font-face {
115              font-family: 'KHTeka';
116              src:
117                url(${ki(df["KHTeka-400-woff2"])}) format('woff2'),
118                url(${ki(df["KHTeka-400-woff"])}) format('woff');
119              font-weight: 400;
120              font-style: normal;
121            }
122          `}
123
124      @keyframes w3m-shake {
125        0% {
126          transform: scale(1) rotate(0deg);
127        }
128        20% {
129          transform: scale(1) rotate(-1deg);
130        }
131        40% {
132          transform: scale(1) rotate(1.5deg);
133        }
134        60% {
135          transform: scale(1) rotate(-1.5deg);
136        }
137        80% {
138          transform: scale(1) rotate(1deg);
139        }
140        100% {
141          transform: scale(1) rotate(0deg);
142        }
143      }
144      @keyframes w3m-iframe-fade-out {
145        0% {
146          opacity: 1;
147        }
148        100% {
149          opacity: 0;
150        }
151      }
152      @keyframes w3m-iframe-zoom-in {
153        0% {
154          transform: translateY(50px);
155          opacity: 0;
156        }
157        100% {
158          transform: translateY(0px);
159          opacity: 1;
160        }
161      }
162      @keyframes w3m-iframe-zoom-in-mobile {
163        0% {
164          transform: scale(0.95);
165          opacity: 0;
166        }
167        100% {
168          transform: scale(1);
169          opacity: 1;
170        }
171      }
172      :root {
173        --apkt-modal-width: 370px;
174
175        --apkt-visual-size-inherit: inherit;
176        --apkt-visual-size-sm: 40px;
177        --apkt-visual-size-md: 55px;
178        --apkt-visual-size-lg: 80px;
179
180        --apkt-path-network-sm: path(
181          'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.
18161 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
182        );
183
184        --apkt-path-network-md: path(
185          'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
186        );
187
188        --apkt-path-network-lg: path(
189          'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
190        );
191
192        --apkt-width-network-sm: 36px;
193        --apkt-width-network-md: 48px;
194        --apkt-width-network-lg: 86px;
195
196        --apkt-duration-dynamic: 0ms;
197        --apkt-height-network-sm: 40px;
198        --apkt-height-network-md: 54px;
199        --apkt-height-network-lg: 96px;
200      }
201    `,dark:yr`
202      :root {
203      }
204    `,light:yr`
205      :root {
206      }
207    `}}var Wg,Kg,gu,ll,o7,df,ke,Zt,kt=h(()=>{le();Tt();df={"KHTeka-500-woff2":"https://fonts.reown.com/KHTeka-Medium.woff2","KHTeka-400-woff2":"https://fonts.reown.com/KHTeka-Regular.woff2","KHTeka-300-woff2":"https://fonts.reown.com/KHTeka-Light.woff2","KHTekaMono-400-woff2":"https://fonts.reown.com/KHTekaMono-Regular.woff2","KHTeka-500-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTeka-400-woff":"https://fonts.reown.com/KHTeka-Regular.woff","KHTeka-300-woff":"https://fonts.reown.com/KHTeka-Light.woff","KHTekaMono-400-woff":"https://fonts.reown.com/KHTekaMono-Regular.woff"};ke=yr`
208  div,
209  span,
210  iframe,
211  a,
212  img,
213  form,
214  button,
215  label,
216  *::after,
217  *::before {
218    margin: 0;
219    padding: 0;
220    box-sizing: border-box;
221    font-style: normal;
222    text-rendering: optimizeSpeed;
223    -webkit-font-smoothing: antialiased;
224    -moz-osx-font-smoothing: grayscale;
225    -webkit-tap-highlight-color: transparent;
226    backface-visibility: hidden;
227  }
228
229  :host {
230    font-family: var(--apkt-fontFamily-regular);
231  }
232`,Zt=yr`
233  button,
234  a {
235    cursor: pointer;
236    display: flex;
237    justify-content: center;
238    align-items: center;
239    position: relative;
240
241    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
242    outline: none;
243    border: none;
244    text-decoration: none;
245    transition:
246      background-color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
247      color var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
248      border var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
249      box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
250      width var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
251      height var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
252      transform var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
253      opacity var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
254      scale var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2),
255      border-radius var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
256    will-change:
257      background-color, color, border, box-shadow, width, height, transform, opacity, scale,
258      border-radius;
259  }
260
261  a:active:not([disabled]),
262  button:active:not([disabled]) {
263    scale: 0.975;
264    transform-origin: center;
265  }
266
267  button:disabled {
268    cursor: default;
269  }
270
271  input {
272    border: none;
273    outline: none;
274    appearance: none;
275  }
276`});var pr,A6=h(()=>{pr={getSpacingStyles(e,t){if(Array.isArray(e))return e[t]?`var(--apkt-spacing-${e[t]})`:void 0;if(typeof e=="string")return`var(--apkt-spacing-${e})`},getFormattedDate(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(e)},formatCurrency(e=0,t={}){let r=Number(e);return isNaN(r)?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2,...t}).format(r)},getHostName(e){try{return new URL(e).hostname}catch{return""}},getTruncateString({string:e,charsStart:t,charsEnd:r,truncate:n}){return e.length<=t+r?e:n==="end"?`${e.substring(0,t)}...`:n==="start"?`...${e.substring(e.length-r)}`:`${e.substring(0,Math.floor(t))}...${e.substring(e.length-Math.floor(r))}`},generateAvatarColors(e){let r=e.toLowerCase().replace(/^0x/iu,"").replace(/[^a-f0-9]/gu,"").substring(0,6).padEnd(6,"0"),n=this.hexToRgb(r),o=getComputedStyle(document.documentElement).getPropertyValue("--w3m-border-radius-master"),i=100-3*Number(o?.replace("px","")),a=`${i}% ${i}% at 65% 40%`,c=[];for(let l=0;l<5;l+=1){let u=this.tintColor(n,.15*l);c.push(`rgb(${u[0]}, ${u[1]}, ${u[2]})`)}return`
277    --local-color-1: ${c[0]};
278    --local-color-2: ${c[1]};
279    --local-color-3: ${c[2]};
280    --local-color-4: ${c[3]};
281    --local-color-5: ${c[4]};
282    --local-radial-circle: ${a}
283   `},hexToRgb(e){let t=parseInt(e,16),r=t>>16&255,n=t>>8&255,o=t&255;return[r,n,o]},tintColor(e,t){let[r,n,o]=e,s=Math.round(r+(255-r)*t),i=Math.round(n+(255-n)*t),a=Math.round(o+(255-o)*t);return[s,i,a]},isNumber(e){return{number:/^[0-9]+$/u}.number.test(e)},getColorTheme(e){return e||(typeof window<"u"&&window.matchMedia&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-color-scheme: dark)")?.matches?"dark":"light":"dark")},splitBalance(e){let t=e.split(".");return t.length===2?[t[0],t[1]]:["0","00"]},roundNumber(e,t,r){return e.toString().length>=t?Number(e).toFixed(r):e},cssDurationToNumber(e){return e.endsWith("s")?Number(e.replace("s",""))*1e3:e.endsWith("ms")?Number(e.replace("ms","")):0},maskInput({value:e,decimals:t,integers:r}){if(e=e.replace(",","."),e===".")return"0.";let[n="",o]=e.split(".").map(u=>u.replace(/[^0-9]/gu,"")),s=r?n.substring(0,r):n,i=s.length===2?String(Number(s)):s,a=typeof t=="number"?o?.substring(0,t):o,c=typeof t!="number"||t>0;return(typeof a=="string"&&c?[i,a].join("."):i)??""},capitalize(e){return e?e.charAt(0).toUpperCase()+e.slice(1):""}}});var nge=h(()=>{A6()});function RWe(e,t){let{kind:r,elements:n}=t;return{kind:r,elements:n,finisher(o){customElements.get(e)||customElements.define(e,o)}}}function OWe(e,t){return customElements.get(e)||customElements.define(e,t),t}function te(e){return function(r){return typeof r=="function"?OWe(e,r):RWe(e,r)}}var Pt=h(()=>{});var He=h(()=>{O1e();kt();A6();nge();Pt();iV();Tt()});var _r,i7=h(()=>{it();_r={METMASK_CONNECTOR_NAME:"MetaMask",TRUST_CONNECTOR_NAME:"Trust Wallet",SOLFLARE_CONNECTOR_NAME:"Solflare",PHANTOM_CONNECTOR_NAME:"Phantom",COIN98_CONNECTOR_NAME:"Coin98",MAGIC_EDEN_CONNECTOR_NAME:"Magic Eden",BACKPACK_CONNECTOR_NAME:"Backpack",BITGET_CONNECTOR_NAME:"Bitget Wallet",FRONTIER_CONNECTOR_NAME:"Frontier",XVERSE_CONNECTOR_NAME:"Xverse Wallet",LEATHER_CONNECTOR_NAME:"Leather",OKX_CONNECTOR_NAME:"OKX Wallet",BINANCE_CONNECTOR_NAME:"Binance Wallet",EIP155:j.CHAIN.EVM,ADD_CHAIN_METHOD:"wallet_addEthereumChain",EIP6963_ANNOUNCE_EVENT:"eip6963:announceProvider",EIP6963_REQUEST_EVENT:"eip6963:requestProvider",CONNECTOR_RDNS_MAP:{coinbaseWallet:"com.coinbase.wallet",coinbaseWalletSDK:"com.coinbase.wallet"},CONNECTOR_TYPE_EXTERNAL:"EXTERNAL",CONNECTOR_TYPE_WALLET_CONNECT:"WALLET_CONNECT",CONNECTOR_TYPE_INJECTED:"INJECTED",CONNECTOR_TYPE_ANNOUNCED:"ANNOUNCED",CONNECTOR_TYPE_AUTH:"AUTH",CONNECTOR_TYPE_MULTI_CHAIN:"MULTI_CHAIN",CONNECTOR_TYPE_W3M_AUTH:"AUTH",getSDKVersionWarningMessage(e,t){return`
284     @@@@@@@           @@@@@@@@@@@@@@@@@@      
285   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
286  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
287 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
288 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@   @@@@@@@@@@@ 
289 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@   @@@@@@@@@@@@ 
290 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@  @@@@@@@@@@@@@
291 @@@@@@@@@@@@@@@  @@@@@@@@@@@@   @@@@@@@@@@@@@    
292 @@@@@@   @@@@@@  @@@@@@@@@@@   @@@@@@@@@@@@@@    
293 @@@@@@   @@@@@@  @@@@@@@@@@@  @@@@@@@@@@@@@@@ 
294 @@@@@@@@@@@@@@@  @@@@@@@@@@   @@@@@@@@@@@@@@@ 
295 @@@@@@@@@@@@@@@  @@@@@@@@@@@@@@@@@@@@@@@@@@@  
296  @@@@@@@@@@@@@    @@@@@@@@@@@@@@@@@@@@@@@@@@  
297   @@@@@@@@@@@      @@@@@@@@@@@@@@@@@@@@@@@@   
298      @@@@@            @@@@@@@@@@@@@@@@@@  
299      
300AppKit SDK version ${e} is outdated. Latest version is ${t}. Please update to the latest version for bug fixes and new features.
301            
302Changelog: https://github.com/reown-com/appkit/releases
303NPM Registry: https://www.npmjs.com/package/@reown/appkit`}}});var oge,sge=h(()=>{it();i7();oge={ConnectorExplorerIds:{[j.CONNECTOR_ID.COINBASE]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.COINBASE_SDK]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.BASE_ACCOUNT]:"fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",[j.CONNECTOR_ID.SAFE]:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",[j.CONNECTOR_ID.LEDGER]:"19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927",[j.CONNECTOR_ID.OKX]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496
303a09c0faed0709",[_r.METMASK_CONNECTOR_NAME]:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",[_r.TRUST_CONNECTOR_NAME]:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",[_r.SOLFLARE_CONNECTOR_NAME]:"1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79",[_r.PHANTOM_CONNECTOR_NAME]:"a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393",[_r.COIN98_CONNECTOR_NAME]:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",[_r.MAGIC_EDEN_CONNECTOR_NAME]:"8b830a2b724a9c3fbab63af6f55ed29c9dfa8a55e732dc88c80a196a2ba136c6",[_r.BACKPACK_CONNECTOR_NAME]:"2bd8c14e035c2d48f184aaa168559e86b0e3433228d3c4075900a221785019b0",[_r.BITGET_CONNECTOR_NAME]:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",[_r.FRONTIER_CONNECTOR_NAME]:"85db431492aa2e8672e93f4ea7acf10c88b97b867b0d373107af63dc4880f041",[_r.XVERSE_CONNECTOR_NAME]:"2a87d74ae02e10bdd1f51f7ce6c4e1cc53cd5f2c0b6b5ad0d7b3007d2b13de7b",[_r.LEATHER_CONNECTOR_NAME]:"483afe1df1df63daf313109971ff3ef8356ddf1cc4e45877d205eee0b7893a13",[_r.OKX_CONNECTOR_NAME]:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",[_r.BINANCE_CONNECTOR_NAME]:"2fafea35bb471d22889ccb49c08d99dd0a18a37982602c33f696a5723934ba25"},NetworkImageIds:{1:"ba0ba0cd-17c6-4806-ad93-f9d174f17900",42161:"3bff954d-5cb0-47a0-9a23-d20192e74600",43114:"30c46e53-e989-45fb-4549-be3bd4eb3b00",56:"93564157-2e8e-4ce7-81df-b264dbee9b00",250:"06b26297-fe0c-4733-5d6b-ffa5498aac00",10:"ab9c186a-c52f-464b-2906-ca59d760a400",137:"41d04d42-da3b-4453-8506-668cc0727900",5e3:"e86fae9b-b770-4eea-e520-150e12c81100",295:"6a97d510-cac8-4e58-c7ce-e8681b044c00",11155111:"e909ea0a-f92a-4512-c8fc-748044ea6800",84532:"a18a7ecd-e307-4360-4746-283182228e00",1301:"4eeea7ef-0014-4649-5d1d-07271a80f600",130:"2257980a-3463-48c6-cbac-a42d2a956e00",10143:"0a728e83-bacb-46db-7844-948f05434900",100:"02b53f6a-e3d4-479e-1cb4-21178987d100",9001:"f926ff41-260d-4028-635e-91913fc28e00",324:"b310f07f-4ef7-49f3-7073-2a0a39685800",314:"5a73b3dd-af74-424e-cae0-0de859ee9400",4689:"34e68754-e536-40da-c153-6ef2e7188a00",1088:"3897a66d-40b9-4833-162f-a2c90531c900",1284:"161038da-44ae-4ec7-1208-0ea569454b00",1285:"f1d73bb6-5450-4e18-38f7-fb6484264a00",7777777:"845c60df-d429-4991-e687-91ae45791600",42220:"ab781bbc-ccc6-418d-d32d-789b15da1f00",8453:"7289c336-3981-4081-c5f4-efc26ac64a00",1313161554:"3ff73439-a619-4894-9262-4470c773a100",2020:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",2021:"b8101fc0-9c19-4b6f-ec65-f6dfff106e00",80094:"e329c2c9-59b0-4a02-83e4-212ff3779900",2741:"fc2427d1-5af9-4a9c-8da5-6f94627cd900","5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":"a1b58899-f671-4276-6a5e-56ca5bd59700","4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":"a1b58899-f671-4276-6a5e-56ca5bd59700",EtWTRABZaYq6iMfeYKouRu166VU2xqa1:"a1b58899-f671-4276-6a5e-56ca5bd59700","000000000019d6689c085ae165831e93":"0b4838db-0161-4ffe-022d-532bf03dba00","000000000933ea01ad0ee984209779ba":"39354064-d79b-420b-065d-f980c4b78200","00000008819873e925422c1ff0f99f7c":"b3406e4a-bbfc-44fb-e3a6-89673c78b700","-239":"20f673c0-095e-49b2-07cf-eb5049dcf600","-3":"20f673c0-095e-49b2-07cf-eb5049dcf600","0x2b6653dc":"3502bb86-cc4e-420f-a387-59ea63a28b00","0x94a9059e":"3502bb86-cc4e-420f-a387-59ea63a28b00","0xcd8690dc":"3502bb86-cc4e-420f-a387-59ea63a28b00"},ConnectorImageIds:{[j.CONNECTOR_ID.COINBASE]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[j.CONNECTOR_ID.COINBASE_SDK]:"0c2840c3-5b04-4c44-9661-fbd4b49e1800",[j.CONNECTOR_ID.BASE_ACCOUNT]:"bba2c8be-7fd1-463e-42b1-796ecb0ad200",[j.CONNECTOR_ID.SAFE]:"461db637-8616-43ce-035a-d89b8a1d5800",[j.CONNECTOR_ID.LEDGER]:"54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",[j.CONNECTOR_ID.WALLET_CONNECT]:"ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",[j.CONNECTOR_ID.INJECTED]:"07ba87ed-43aa-4adf-4540-9e6a2b9cae00"},ConnectorNamesMap:{[j.CONNECTOR_ID.INJECTED]:"Browser Wallet",[j.CONNECTOR_ID.WALLET_CONNECT]:"WalletConnect",[j.CONNECTOR_ID.COINBASE]:"Coinbase",[j.CONNECTOR_ID.COINBASE_SDK]:"Coinbase",[j.CONNECTOR_ID.BASE_ACCOUNT]:"Base Account",[j.CONNECTOR_ID.LEDGER]:"Ledger",[j.CONNECTOR_ID.SAFE]:"Safe"},ConnectorTypesMap:{[j.CONNECTOR_ID.INJECTED]:"INJECTED",[j.CONNECTOR_ID.WALLET_CONNECT]:"WALLET_CONNECT",[j.CONNECTOR_ID.EIP6963]:"ANNOUNCED",[j.CONNECTOR_ID.AUTH]:"AUTH",[_r.CONNECTOR_TYPE_AUTH]:"AUTH"},WalletConnectRpcChainIds:[1,5,11155111,10,420,42161,421613,137,80001,42220,1313161554,1313161555,56,97,43114,43113,100,8453,84531,7777777,999,324,280]}});var Qr,ige=h(()=>{it();st();i7();Qr={getCaipTokens(e){if(!e)return;let t={};return Object.entries(e).forEach(([r,n])=>{t[`${_r.EIP155}:${r}`]=n}),t},isLowerCaseMatch(e,t){return e?.toLowerCase()===t?.toLowerCase()},getActiveNamespaceConnectedToAuth(){let e=k.state.activeChain;return j.AUTH_CONNECTOR_SUPPORTED_CHAINS.find(t=>X.getConnectorId(t)===j.CONNECTOR_ID.AUTH&&t===e)},withRetry({conditionFn:e,intervalMs:t,maxRetries:r}){let n=0;return new Promise(o=>{async function s(){return n+=1,await e()?o(!0):n>=r?o(!1):(setTimeout(s,t),null)}s()})},userChainIdToChainNamespace(e){if(typeof e=="number")return j.CHAIN.EVM;let[t]=e.split(":");return t},getOtherAuthNamespaces(e){return e?j.AUTH_CONNECTOR_SUPPORTED_CHAINS.filter(n=>n!==e):[]},getConnectorStorageInfo(e,t){let n=ae.getConnections()[t]??[];return{hasDisconnected:ae.isConnectorDisconnected(e,t),hasConnected:n.some(o=>
303Qr.isLowerCaseMatch(o.connectorId,e))}}}});var BWe,ri,age=h(()=>{it();st();BWe=new AbortController,ri={EmbeddedWalletAbortController:BWe,UniversalProviderErrors:{UNAUTHORIZED_DOMAIN_NOT_ALLOWED:{message:"Unauthorized: origin not allowed",alertErrorKey:"ORIGIN_NOT_ALLOWED"},JWT_VALIDATION_ERROR:{message:"JWT validation error: JWT Token is not yet valid",alertErrorKey:"JWT_TOKEN_NOT_VALID"},INVALID_KEY:{message:"Unauthorized: invalid key",alertErrorKey:"INVALID_PROJECT_ID"}},ALERT_ERRORS:{SWITCH_NETWORK_NOT_FOUND:{code:"APKT001",displayMessage:"Network Not Found",debugMessage:"The specified network is not recognized. Please ensure it is included in the `networks` array of your `createAppKit` configuration."},ORIGIN_NOT_ALLOWED:{code:"APKT002",displayMessage:"Invalid App Configuration",debugMessage:()=>`The origin ${u1()?window.origin:"unknown"} is not in your allow list. Please update your allowed domains at https://dashboard.reown.com. [PID: ${W.state.projectId}]`},IFRAME_LOAD_FAILED:{code:"APKT003",displayMessage:"Network Error: Wallet Load Failed",debugMessage:()=>"Failed to load the embedded wallet. This may be due to network issues or server downtime. Please check your network connection and try again shortly. Contact support if the issue persists."},IFRAME_REQUEST_TIMEOUT:{code:"APKT004",displayMessage:"Wallet Request Timeout",debugMessage:()=>"The request to the embedded wallet timed out. Please check your network connection and try again shortly. Contact support if the issue persists."},UNVERIFIED_DOMAIN:{code:"APKT005",displayMessage:"Unverified Domain",debugMessage:()=>"Embedded wallet load failed. Ensure your domain is verified in https://dashboard.reown.com."},JWT_TOKEN_NOT_VALID:{code:"APKT006",displayMessage:"Session Expired",debugMessage:"Your session is invalid or expired. Please check your system\u2019s date and time settings, then reconnect."},INVALID_PROJECT_ID:{code:"APKT007",displayMessage:"Invalid Project ID",debugMessage:"The specified project ID is invali
303d. Please visit https://dashboard.reown.com to obtain a valid project ID."},PROJECT_ID_NOT_CONFIGURED:{code:"APKT008",displayMessage:"Project ID Missing",debugMessage:"No project ID is configured. You can create and configure a project ID at https://dashboard.reown.com."},SERVER_ERROR_APP_CONFIGURATION:{code:"APKT009",displayMessage:"Server Error",debugMessage:e=>`Unable to fetch App Configuration. ${e}. Please check your network connection and try again shortly. Contact support if the issue persists.`},RATE_LIMITED_APP_CONFIGURATION:{code:"APKT010",displayMessage:"Rate Limited",debugMessage:"You have been rate limited while retrieving App Configuration. Please wait a few minutes and try again. Contact support if the issue persists."}},ALERT_WARNINGS:{LOCAL_CONFIGURATION_IGNORED:{debugMessage:e=>`[Reown Config Notice] ${e}`},INACTIVE_NAMESPACE_NOT_CONNECTED:{code:"APKTW001",displayMessage:"Inactive Namespace Not Connected",debugMessage:(e,t)=>`An error occurred while connecting an inactive namespace ${e}: "${t}"`},INVALID_EMAIL:{code:"APKTW002",displayMessage:"Invalid Email Address",debugMessage:"Please enter a valid email address"}}}});var a7,cge=h(()=>{st();a7={TOKEN_ADDRESSES_BY_SYMBOL:{USDC:{8453:QL.asset,84532:XL.asset}},getTokenSymbolByAddress(e){if(!e)return;let[t]=Object.entries(a7.TOKEN_ADDRESSES_BY_SYMBOL).find(([r,n])=>Object.values(n).includes(e))??[];return t}}});var lV,lge=h(()=>{jf();lV={createLogger(e,t="error"){let r=ry({level:t}),{logger:n}=Sl({opts:r});return n.error=(...o)=>{for(let s of o)if(s instanceof Error){e(s,...o);return}e(void 0,...o)},n}}});function dV(e,t){let r=new URL("https://rpc.walletconnect.org/v1/");return r.searchParams.set("chainId",e),r.searchParams.set("projectId",t),r.toString()}var kWe,uV,yu,uge=h(()=>{Mb();it();st();sge();kWe="rpc.walletconnect.org";uV=["near:mainnet","solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp","eip155:1101","eip155:56","eip155:42161","eip155:7777777","eip155:59144","eip155:324","solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1","eip155:5000","solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz","eip155:80084","eip155:5003","eip155:100","eip155:8453","eip155:42220","eip155:1313161555","eip155:17000","eip155:1","eip155:300","eip155:1313161554","eip155:1329","eip155:84532","eip155:421614","eip155:11155111","eip155:8217","eip155:43114","solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z","eip155:999999999","eip155:11155420","eip155:80002","eip155:97","eip155:43113","eip155:137","eip155:10","eip155:1301","eip155:80094","eip155:80069","eip155:560048","eip155:31","eip155:2818","eip155:57054","eip155:911867","eip155:534351","eip155:1112","eip155:534352","eip155:1111","eip155:146","eip155:130","eip155:1284","eip155:30","eip155:2810","eip155:55931","bip122:000000000019d6689c085ae165831e93","bip122:000000000933ea01ad0ee984209779ba"],yu={extendRpcUrlWithProjectId(e,t){let r=!1;try{r=new URL(e).host===kWe}catch{r=!1}if(r){let n=new URL(e);return n.searchParams.has("projectId")||n.searchParams.set("projectId",t),n.toString()}return e},isCaipNetwork(e){return"chainNamespace"in e&&"caipNetworkId"in e},getChainNamespace(e){return this.isCaipNetwork(e)?e.chainNamespace:j.CHAIN.EVM},getCaipNetworkId(e){return this.isCaipNetwork(e)?e.caipNetworkId:`${j.CHAIN.EVM}:${e.id}`},getDefaultRpcUrl(e,t,r){let n=e.rpcUrls?.default?.http?.[0];return uV.includes(t)?dV(t,r):n||""},extendCaipNetwork(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:n}){let o=this.getChainNamespace(e),s=this.getCaipNetworkId(e),i=e.rpcUrls?.default?.http?.[0],a=this.getDefaultRpcUrl(e,s,r),c=e?.rpcUrls?.chainDefault?.http?.[0]||i,l=n?.[s]?.map(p=>p.url)||[],u=[...l,...a?[a]:[]],d=[...l];return c&&!d.includes(c)&&d.push(c),{...e,chainNamespace:o,caipNetworkId:s,assets:{imageId:oge.NetworkImageIds[e.id],imageUrl:t?.[e.id]},rpcUrls:{...e.rpcUrls,default:{http:u},chainDefault:{http:d}}}},extendCaipNetworks(e,{customNetworkImageUrls:t,projectId:r,customRpcUrls:n}){return e.map(o=>yu.extendCaipNetwork(o,{customNetworkImageUrls:t,customRpcUrls:n,projectId:r}))},getViemTransport(e,t,r){let n=[];return r?.forEach(o=>{n.push(fg(o.url,o.config))}),uV.includes(e.caipNetworkId)&&n.push(fg(dV(e.caipNetworkId,t),{fetchOptions:{headers:{"Content-Type":"text/plain"}}})),e?.rpcUrls?.default?.http?.forEach(o=>{n.push(fg(o))}),G4(n)},extendWagmiTransports(e,t,r){if(uV.includes(e.caipNetworkId)){let n=this.getDefaultRpcUrl(e,e.caipNetworkId,t);return G4([r,fg(n)])}return r},getUnsupportedNetwork(e){return{id:e.split(":")[1],caipNetworkId:e,name:j.UNSUPPORTED_NETWORK_NAME,chainNamespace:e.split(":")[0],nativeCurrency:{name:"",decimals:0,symbol:""},rpcUrls:{default:{http:[]}}}},getCaipNetworkFromStorage(e){let t=ae.getActiveCaipNetworkId(),r=k.getAllRequestedCaipNetworks(),n=Array.from(k.state.chains?.keys()||[]),o=t?.split(":")[0],s=o?n.includes(o):!1,i=r?.find(c=>c.caipNetworkId===t);return s&&!i&&t?this.getUnsupportedNetwork(t):i||e||r?.[0]}}});var ul=h(()=>{i7();ige();age();cge();lge();uge()});function DWe(e){if(e.length>=255)throw new TypeError("Alphabet too long");let t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){let u=e.charAt(l),d=u.charCodeAt(0);if(t[d]!==255)throw new TypeError(u+" is ambiguous");t[d]=l}let r=e.length,n=e.charAt(0),o=Math.log(r)/Math.log(256),s=Math.log(256)/Math.log(r);function i(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let u=0,d=0,p=0,f=l.length;for(;p!==f&&l[p]===0;)p++,u++;let m=(f-p)*s+1>>>0,g=new Uint8Array(m);for(;p!==f;){let C=l[p],w=0;for(let x=m-1;(C!==0||w<d)&&x!==-1;x--,w++)C+=256*g[x]>>>0,g[x]=C%r>>>0,C=C/r>>>0;if(C!==0)throw new Error("Non-zero carry");d=w,p++}let y=m-d;for(;y!==m&&g[y]===0;)y++;let b=n.repeat(u);for(;y<m;++y)b+=e.charAt(g[y]);return b}function a(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let u=0,d=0,p=0;for(;l[u]===n;)d++,u++;let f=(l.length-u)*o+1>>>0,m=new Uint8Array(f);for(;u<l.length;){let C=l.charCodeAt(u);if(C>255)return;let w=t[C];if(w===255)return;let x=0;for(let S=f-1;(w!==0||x<p)&&S!==-1;S--,x++)w+=r*m[S]>>>0,m[S]=w%256>>>0,w=w/256>>>0;if(w!==0)throw new Error("Non-zero carry");p=x,u++}let g=f-p;for(;g!==f&&m[g]===0;)g++;let y=new Uint8Array(d+(f-g)),b=d;for(;g!==f;)y[b++]=m[g++];return y}function c(l){let u=a(l);if(u)return u;throw new Error("Non-base"+r+" character")}return{encode:i,decodeUnsafe:a,decode:c}}var dge,pge=h(()=>{dge=DWe});var UWe,fge,hge=h(()=>{pge();UWe="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",fge=dge(UWe)});var ev,mge=h(()=>{ev={ERROR_CODE_UNRECOGNIZED_CHAIN_ID:4902,ERROR_CODE_DEFAULT:5e3,ERROR_INVALID_CHAIN_ID:32603}});var c7,gge=h(()=>{hge();Mb();it();st();st();mge();c7=class extends n3{async setUniversalProvider(t){if(!this.namespace)throw new Error("UniversalAdapter
303:setUniversalProvider - namespace is required");return this.addConnector(new o3({provider:t,caipNetworks:this.getCaipNetworks(),namespace:this.namespace})),Promise.resolve()}async connect(t){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:Number(t.chainId),provider:this.provider,address:""})}async disconnect(){try{await this.getWalletConnectConnector().disconnect(),this.emit("disconnect")}catch(t){console.warn("UniversalAdapter:disconnect - error",t)}return{connections:[]}}syncConnections(){return Promise.resolve()}async writeSolanaTransaction(){return Promise.resolve({hash:""})}async getAccounts({namespace:t}){let n=(this.provider?.session?.namespaces?.[t]?.accounts||[]).filter((o,s,i)=>i.indexOf(o)===s);return Promise.resolve({accounts:n.map(o=>ee.createAccount({caipAddress:o,type:t==="bip122"?"payment":"eoa"}))})}async syncConnectors(){return Promise.resolve()}async getBalance(t){if(!(t.caipNetwork&&We.BALANCE_SUPPORTED_CHAINS.includes(t.caipNetwork?.chainNamespace))||t.caipNetwork?.testnet)return{balance:"0.00",symbol:t.caipNetwork?.nativeCurrency.symbol||""};let n=k.getAccountData();if(n?.balanceLoading&&t.chainId===k.state.activeCaipNetwork?.id)return{balance:n?.balance||"0.00",symbol:n?.balanceSymbol||""};let s=(await k.fetchTokenBalance()).find(i=>i.chainId===`${t.caipNetwork?.chainNamespace}:${t.chainId}`&&i.symbol===t.caipNetwork?.nativeCurrency.symbol);return{balance:s?.quantity.numeric||"0.00",symbol:s?.symbol||t.caipNetwork?.nativeCurrency.symbol||""}}async signMessage(t){let{provider:r,message:n,address:o}=t;if(!r)throw new Error("UniversalAdapter:signMessage - provider is undefined");let s="";return k.state.activeCaipNetwork?.chainNamespace===j.CHAIN.SOLANA?s=(await r.request({method:"solana_signMessage",params:{message:fge.encode(new TextEncoder().encode(n)),pubkey:o}},k.state.activeCaipNetwork?.caipNetworkId)).signature:s=await r.request({method:"personal_sign",params:[n,o]},k.state.activeCaipNetwork?.caipNetworkId),{signature:s}}async estimateGas(){return Promise.resolve({gas:BigInt(0)})}async sendTransaction(){return Promise.resolve({hash:""})}walletGetAssets(t){return Promise.resolve({})}async writeContract(){return Promise.resolve({hash:""})}emitFirstAvailableConnection(){}parseUnits(){return 0n}formatUnits(){return"0"}async getCapabilities(){return Promise.resolve({})}async grantPermissions(){return Promise.resolve({})}async revokePermissions(){return Promise.resolve("0x")}async syncConnection(){return Promise.resolve({id:"WALLET_CONNECT",type:"WALLET_CONNECT",chainId:1,provider:this.provider,address:""})}async switchNetwork(t){let{caipNetwork:r}=t,n=this.getWalletConnectConnector();if(r.chainNamespace===j.CHAIN.EVM)try{await n.provider?.request({method:"wallet_switchEthereumChain",params:[{chainId:vr(r.id)}]})}catch(o){if(o.code===ev.ERROR_CODE_UNRECOGNIZED_CHAIN_ID||o.code===ev.ERROR_INVALID_CHAIN_ID||o.code===ev.ERROR_CODE_DEFAULT||o?.data?.originalError?.code===ev.ERROR_CODE_UNRECOGNIZED_CHAIN_ID)try{await n.provider?.request({method:"wallet_addEthereumChain",params:[{chainId:vr(r.id),rpcUrls:[r?.rpcUrls.chainDefault?.http],chainName:r.name,nativeCurrency:r.nativeCurrency,blockExplorerUrls:[r.blockExplorers?.default.url]}]})}catch{throw new Error("Chain is not supported")}}n.provider.setDefaultChain(r.caipNetworkId)}getWalletConnectProvider(){return this.connectors.find(n=>n.type==="WALLET_CONNECT")?.provider}}});var LWe,l7,yge,wge=h(()=>{st();ul();LWe=["email","socials","swaps","onramp","activity","reownBranding","multiWallet","emailCapture","payWithExchange","payments","reownAuthentication","headless"],l7={email:{apiFeatureName:"social_login",localFeatureName:"email",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return!!e.isEnabled&&t.includes("email")},processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.email:!!e},socials:{apiFeatureName:"social_login",localFeatureName:"socials",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return e.isEnabled&&t.length>0?t.filter(r=>r!=="email"):!1},processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.socials:typeof e=="boolean"?e?We.DEFAULT_REMOTE_FEATURES.socials:!1:e},swaps:{apiFeatureName:"swap",localFeatureName:"swaps",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return e.isEnabled&&t.length>0?t:!1},processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.swaps:typeof e=="boolean"?e?We.DEFAULT_REMOTE_FEATURES.swaps:!1:e},onramp:{apiFeatureName:"onramp",localFeatureName:"onramp",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>{if(!e?.config)return!1;let t=e.config;return e.isEnabled&&t.length>0?t:!1},processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.onramp:typeof e=="boolean"?e?We.DEFAULT_REMOTE_FEATURES.onramp:!1:e},activity:{apiFeatureName:"activity",localFeatureName:"history",returnType:!1,isLegacy:!0,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.activity:!!e},reownBranding:{apiFeatureName:"reown_branding",localFeatureName:"reownBranding",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>e===void 0?We.DEFAULT_REMOTE_FEATURES.reownBranding:!!e},emailCapture:{apiFeatureName:"email_capture",localFeatureName:"emailCapture",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>e.isEnabled&&(e.config??[]),processFallback:e=>!1},multiWallet:{apiFeatureName:"multi_wallet",localFeatureName:"multiWallet",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>We.DEFAULT_REMOTE_FEATURES.multiWallet},payWithExchange:{apiFeatureName:"fund_from_exchange",localFeatureName:"payWithExchange",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>We.DEFAULT_REMOTE_FEATURES.payWithExchange},payments:{apiFeatureName:"payments",localFeatureName:"payments",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>We.DEFAULT_REMOTE_FEATURES.payments},reownAuthentication:{apiFeatureName:"reown_authentication",localFeatureName:"reownAuthentication",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:e=>typeof e>"u"?We.DEFAULT_REMOTE_FEATURES.reownAuthentication:!!e},headless:{apiFeatureName:"headless",localFeatureName:"headless",returnType:!1,isLegacy:!1,isAvailableOnBasic:!1,processApi:e=>!!e.isEnabled,processFallback:()=>We.DEFAULT_REMOTE_FEATURES.headless}},yge={localSettingsOverridden:new Set,getApiConfig(e,t){return t?.find(r=>r.id===e)},addWarning(e,t){if(e!==void 0){let r=l7[t],n=r.isLegacy?`"features.${r.localFeatureName}" (now "${t}")`:`"features.${t}"`;this.localSettingsOverridden.add(n)}},processFeature(e,t,r,n,o){let s=l7[e],i=t[s.localFeatureName];if(o&&!s.isAvailableOnBasic)return!1;if(n){let a=this.getApiConfig(s.apiFeatureName,r);return a?.config===null?this.processFallbackFeature(e,i):a?.config?(i!==void 0&&this.addWarning(i,e),this.processApiFeature(e,a)):!1}return this.processFallbackFeature(e,i)},processApiFeature(e,t){return l7[e].processApi(t)},processFallbackFeature(e,t){return l7[e].processFallback(t)},async fetchRemoteFeatures(e){let t=e.basic??!1,r=e.features||{};this.localSettingsOverridden.clear();let n=null,o=!1;try{n=await de.fetchProjectConfig(),o=n!=null}catch(i){console.warn("[Reown Config] Failed to fetch remote project configuration. Using local/default values.",i)}let s=o&&!t?We.DEFAULT_REMOTE_FEATURES:We.DEFAULT_REMOTE_FEATURES_DISABLED;try{for(let i of LWe){let a=this.processFeature(i,r,n,o,t);Object.assign(s,{[i]:a})}}catch(i){return console.warn("[Reown Config] Failed to process the configuration from Cloud. Using default values.",i),We.DEFAULT_REMOTE_FEATURES}if(o&&this.localSettingsOverridden.size>0){let i=`Your local configuration for ${Array.from(this.localSettingsOverridden).join(", ")} was ignored because a remote configuration was successfully fetched. Please manage these features via your project dashboard on dashboard.reown.com.`;Jr.open({debugMessage:ri.ALERT_WARNINGS.LOCAL_CONFIGURATION_IGNORED.debugMessage(i)},"warning")}return s}}});var tv,pV=h(()=>{it();kr();tv=class{constructor(t){this.getNonce=t.getNonce}async createMessage(t){let r={accountAddress:t.accountAddress,chainId:t.chainId,version:"1",domain:typeof document>"u"?"Unknown Domain":document.location.host,uri:typeof document>"u"?"Unknown URI":document.location.href,resources:this.resources,nonce:await this.getNonce(t),issuedAt:this.stringifyDate(new Date),statement:void 0,expirationTime:void 0,notBefore:void 0};return Object.assign(r,{toString:()=>this.stringify(r)})}stringify(t){let r=this.getNetworkName(t.chainId);return[`${t.domain} wants you to sign in with your ${r} account:`,t.accountAddress,t.statement?`
304${t.statement}
305`:"",`URI: ${t.uri}`,`Version: ${t.version}`,`Chain ID: ${t.chainId}`,`Nonce: ${t.nonce}`,t.issuedAt&&`Issued At: ${t.issuedAt}`,t.expirationTime&&`Expiration Time: ${t.expirationTime}`,t.notBefore&&`Not Before: ${t.notBefore}`,t.requestId&&`Request ID: ${t.requestId}`,t.resources?.length&&t.resources.reduce((n,o)=>`${n}
306- ${o}`,"Resources:")].filter(n=>typeof n=="string").join(`
307`).trim()}getNetworkName(t){let r=k.getAllRequestedCaipNetworks();return o1.getNetworkNameByCaipNetworkId(r,t)}stringifyDate(t){return t.toISOString()}}});function MWe(e){let t=e.split(".");if(t.length!==3)throw new Error("Invalid token");let r=t[1];if(typeof r!="string")throw new Error("Invalid token");let n=r.replace(/-/gu,"+").replace(/_/gu,"/"),o=n.padEnd(n.length+(4-n.length%4)%4,"=");return JSON.parse(atob(o))}var fV,bge=h(()=>{it();su();Lp();kr();nc();pV();fV=class{constructor(t={}){this.otpUuid=null,this.listeners={sessionChanged:[]},this.localAuthStorageKey=t.localAuthStorageKey||Le.SIWX_AUTH_TOKEN,this.localNonceStorageKey=t.localNonceStorageKey||Le.SIWX_NONCE_TOKEN,this.required=t.required??!0,this.messenger=new tv({getNonce:this.getNonce.bind(this)})}async createMessage(t){return this.messenger.createMessage(t)}async addSession(t){let r=await this.request({method:"POST",key:"authenticate",body:{data:t.data,message:t.message,signature:t.signature,clientId:this.getClientId(),walletInfo:this.getWalletInfo()},headers:["nonce","otp"]});this.setStorageToken(r.token,this.localAuthStorageKey),this.emit
307("sessionChanged",t),this.setAppKitAccountUser(MWe(r.token)),this.otpUuid=null}async getSessions(t,r){try{if(!this.getStorageToken(this.localAuthStorageKey))return[];let n=await this.request({method:"GET",key:"me",query:{},headers:["auth"]});if(!n)return[];let o=n.address.toLowerCase()===r.toLowerCase(),s=n.caip2Network===t;if(!o||!s)return[];let i={data:{accountAddress:n.address,chainId:n.caip2Network},message:"",signature:""};return this.emit("sessionChanged",i),this.setAppKitAccountUser(n),[i]}catch{return[]}}async revokeSession(t,r){return Promise.resolve(this.clearStorageTokens())}async setSessions(t){if(t.length===0)this.clearStorageTokens();else{let r=t.find(n=>n.data.chainId===mg()?.caipNetworkId)||t[0];await this.addSession(r)}}getRequired(){return this.required}async getSessionAccount(){if(!this.getStorageToken(this.localAuthStorageKey))throw new Error("Not authenticated");return this.request({method:"GET",key:"me",body:void 0,query:{includeAppKitAccount:!0},headers:["auth"]})}async setSessionAccountMetadata(t=null){if(!this.getStorageToken(this.localAuthStorageKey))throw new Error("Not authenticated");return this.request({method:"PUT",key:"account-metadata",body:{metadata:t},headers:["auth"]})}on(t,r){return this.listeners[t].push(r),()=>{this.listeners[t]=this.listeners[t].filter(n=>n!==r)}}removeAllListeners(){Object.keys(this.listeners).forEach(r=>{this.listeners[r]=[]})}async requestEmailOtp({email:t,account:r}){let n=await this.request({method:"POST",key:"otp",body:{email:t,account:r}});return this.otpUuid=n.uuid,this.messenger.resources=[`email:${t}`],n}confirmEmailOtp({code:t}){return this.request({method:"PUT",key:"otp",body:{code:t},headers:["otp"]})}async request({method:t,key:r,query:n,body:o,headers:s}){let{projectId:i,st:a,sv:c}=this.getSDKProperties(),l=new URL(`${j.W3M_API_URL}/auth/v1/${String(r)}`);l.searchParams.set("projectId",i),l.searchParams.set("st",a),l.searchParams.set("sv",c),n&&Object.entries(n).forEach(([d,p])=>l.searchParams.set(d,String(p)));let u=await fetch(l,{method:t,body:o?JSON.stringify(o):void 0,headers:Array.isArray(s)?s.reduce((d,p)=>{switch(p){case"nonce":d["x-nonce-jwt"]=`Bearer ${this.getStorageToken(this.localNonceStorageKey)}`;break;case"auth":d.Authorization=`Bearer ${this.getStorageToken(this.localAuthStorageKey)}`;break;case"otp":this.otpUuid&&(d["x-otp"]=this.otpUuid);break;default:break}return d},{}):void 0});if(!u.ok)throw new Error(await u.text());return u.headers.get("content-type")?.includes("application/json")?u.json():null}getStorageToken(t){return Be.getItem(t)}setStorageToken(t,r){Be.setItem(r,t)}clearStorageTokens(){this.otpUuid=null,Be.removeItem(this.localAuthStorageKey),Be.removeItem(this.localNonceStorageKey),this.emit("sessionChanged",void 0)}async getNonce(){let{nonce:t,token:r}=await this.request({method:"GET",key:"nonce"});return this.setStorageToken(r,this.localNonceStorageKey),t}getClientId(){return Me.state.clientId}getWalletInfo(){let t=k.getAccountData()?.connectedWalletInfo;if(!t)return;if("social"in t&&"identifier"in t){let s=t.social,i=t.identifier;return{type:"social",social:s,identifier:i}}let{name:r,icon:n}=t,o="unknown";switch(t.type){case"EXTERNAL":case"INJECTED":case"ANNOUNCED":o="extension";break;case"WALLET_CONNECT":o="walletconnect";break;default:o="unknown"}return{type:o,name:r,icon:n}}
vendor: 14,107 bytes, line 307
307getSDKProperties(){return de._getSdkProperties()}emit(t,r){this.listeners[t].forEach(n=>n(r))}setAppKitAccountUser(t){let{email:r}=t;r&&Object.values(j.CHAIN).forEach(n=>{k.setAccountProp("user",{email:r},n)})}}});var xge=h(()=>{bge();pV()});var vge={};Ce(vge,{ReownAuthentication:()=>fV,ReownAuthenticationMessenger:()=>tv});var Ege=h(()=>{xge()});var u7,Age=h(()=>{R1e();it();st();He();ul();gge();wge();u7=class{constructor(t){this.chainNamespaces=[],this.features={},this.remoteFeatures={},this.reportedAlertErrors={},this.getCaipNetwork=(r,n)=>{if(r){let o=k.getCaipNetworks(r)?.find(a=>a.id===n);if(o)return o;let s=k.getNetworkData(r)?.caipNetwork;return s||k.getRequestedCaipNetworks(r).filter(a=>a.chainNamespace===r)?.[0]}return k.state.activeCaipNetwork||this.defaultCaipNetwork},this.getCaipNetworkId=()=>{let r=this.getCaipNetwork();if(r)return r.id},this.getCaipNetworks=r=>k.getCaipNetworks(r),this.getActiveChainNamespace=()=>k.state.activeChain,this.setRequestedCaipNetworks=(r,n)=>{k.setRequestedCaipNetworks(r,n)},this.getApprovedCaipNetworkIds=()=>k.getAllApprovedCaipNetworkIds(),this.getCaipAddress=r=>k.state.activeChain===r||!r?k.state.activeCaipAddress:k.state.chains.get(r)?.accountState?.caipAddress,this.setClientId=r=>{Me.setClientId(r)},this.getProvider=r=>or.getProvider(r),this.getProviderType=r=>or.getProviderId(r),this.getPreferredAccountType=r=>Dr(r),this.setCaipAddress=(r,n,o=!1)=>{k.setAccountProp("caipAddress",r,n,o),k.setAccountProp("address",ee.getPlainAddress(r),n,o)},this.setBalance=(r,n,o)=>{k.setAccountProp("balance",r,o),k.setAccountProp("balanceSymbol",n,o)},this.setProfileName=(r,n)=>{k.setAccountProp("profileName",r,n)},this.setProfileImage=(r,n)=>{k.setAccountProp("profileImage",r,n)},this.setUser=(r,n)=>{k.setAccountProp("user",r,n)},this.resetAccount=r=>{k.resetAccount(r)},this.setCaipNetwork=r=>{k.setActiveCaipNetwork(r)},this.setCaipNetworkOfNamespace=(r,n)=>{k.setChainNetworkData(n,{caipNetwork:r})},this.setStatus=(r,n)=>{k.setAccountProp("status",r,n),X.isConnected()?ae.setConnectionStatus("connected"):ae.setConnectionStatus("disconnected")},this.getAddressByChainNamespace=r=>k.getAccountData(r)?.address,this.setConnectors=r=>{let n=[...X.state.allConnectors,...r];X.setConnectors(n)},this.setConnections=(r,n)=>{ae.setConnections(r,n),J.setConnections(r,n)},this.fetchIdentity=r=>Me.fetchIdentity(r),this.getReownName=r=>H0.getNamesForAddress(r),this.getConnectors=()=>X.getConnectors(),this.getConnectorImage=r=>vt.getConnectorImage(r),this.getConnections=r=>this.remoteFeatures.multiWallet?$p.getConnectionsData(r).connections:(Jr.open(j.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.getRecentConnections=r=>this.remoteFeatures.multiWallet?$p.getConnectionsData(r).recentConnections:(Jr.open(j.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),[]),this.switchConnection=async r=>{if(!this.remoteFeatures.multiWallet){Jr.open(j.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}await J.switchConnection(r)},this.deleteConnection=r=>{if(!this.remoteFeatures.multiWallet){Jr.open(j.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info");return}ae.deleteAddressFromConnection(r),J.syncStorageConnections()},this.setConnectedWalletInfo=(r,n)=>{let o=or.getProviderId(n),s=r?{...r,type:o}:void 0;k.setAccountProp("connectedWalletInfo",s,n)},this.getIsConnectedState=()=>!!k.state.activeCaipAddress,this.addAddressLabel=(r,n,o)=>{let s=k.getAccountData(o)?.addressLabels||{};k.setAccountProp("addressLabels",{...s,[r]:n},o)},this.removeAddressLabel=(r,n)=>{let o=k.getAccountData(n)?.addressLabels||{};k.setAccountProp("addressLabels",{...o,[r]:void 0},n)},this.getAddress=r=>{let n=r||k.state.activeChain;return k.getAccountData(n)?.address},this.resetNetwork=r=>{k.resetNetwork(r)},this.addConnector=r=>{X.addConnector(r)},this.resetWcConnection=()=>{J.resetWcConnection()},this.setAddressExplorerUrl=(r,n)=>{k.setAccountProp("addressExplorerUrl",r,n)},this.setSmartAccountDeployed=(r,n)=>{k.setAccountProp("smartAccountDeployed",r,n)},this.setPreferredAccountType=(r,n)=>{k.setAccountProp("preferredAccountType",r,n)},this.setEIP6963Enabled=r=>{W.setEIP6963Enabled(r)},this.handleUnsafeRPCRequest=()=>{if(this.isOpen()){if(this.isTransactionStackEmpty())return;this.redirect("ApproveTransaction")}else this.open({view:"ApproveTransaction"})},this.options=t,this.version=t.sdkVersion,this.caipNetworks=this.extendCaipNetworks(t),this.chainNamespaces=this.getChainNamespacesSet(t.adapters,this.caipNetworks),this.defaultCaipNetwork=this.extendDefaultCaipNetwork(t),this.chainAdapters=this.createAdapters(t.adapters),this.readyPromise=this.initialize(t)}getChainNamespacesSet(t,r){let n=t?.map(s=>s.namespace).filter(s=>!!s);if(n?.length)return[...new Set(n)];let o=r?.map(s=>s.chainNamespace);return[...new Set(o)]}async initialize(t){if(this.initializeProjectSettings(t),this.initControllers(t),await this.initChainAdapters(),this.sendInitializeEvent(t),t.features?.headless&&!Tn.hasInjectedConnectors()&&de.prefetch({fetchNetworkImages:!1,fetchConnectorImages:!1,fetchWalletRanks:!1,fetchRecommendedWallets:!0}),W.state.enableReconnect?(await this.syncExistingConnection(),await this.syncAdapterConnections()):await this.unSyncExistingConnection(),!t.basic&&!t.manualWCControl&&(this.remoteFeatures=await yge.fetchRemoteFeatures(t)),await de.fetchUsage(),W.setRemoteFeatures(this.remoteFeatures),this.remoteFeatures.onramp&&r3.setOnrampProviders(this.remoteFeatures.onramp),(W.state.remoteFeatures?.email||Array.isArray(W.state.remoteFeatures?.socials)&&W.state.remoteFeatures?.socials.length>0)&&await this.checkAllowedOrigins(),W.state.features?.reownAuthentication||W.state.remoteFeatures?.reownAuthentication){let{ReownAuthentication:r}=await Promise.resolve().then(()=>(Ege(),vge)),n=W.state.siwx;n instanceof r||(n&&console.warn("ReownAuthentication option is enabled, SIWX configuration will be overridden."),W.setSIWX(new r))}}async openSend(t){let r=t.namespace||k.state.activeChain,n=this.getCaipAddress(r),o=this.getCaipNetwork(r)?.id;if(!n)throw new Error("openSend: caipAddress not found");if(o?.toString()!==t.chainId.toString()){let s=k.getCaipNetworkById(t.chainId,r);if(!s)throw new Error(`openSend: caipNetwork with chainId ${t.chainId} not found`);await this.switchNetwork(s,{throwOnFailure:!0})}try{let s=a7.getTokenSymbolByAddress(t.assetAddress);s&&await de.fetchTokenImages([s])}catch{}return await Oe.open({view:"WalletSend",data:{send:t}}),new Promise((s,i)=>{let a=mt.subscribeKey("hash",u=>{u&&(l(),s({hash:u}))}),c=Oe.subscribe(u=>{u.open||(l(),i(new Error("Modal closed")))}),l=this.createCleanupHandler([a,c])})}toModalOptions(){function t(n){return n?.view==="Swap"}function r(n){return n?.view==="WalletSend"}return{isSwap:t,isSend:r}}async checkAllowedOrigins(){try{let t=await de.fetchAllowedOrigins();if(!ee.isClient())return;let r=window.location.origin;qc.isOriginAllowed(r,t,j.DEFAULT_ALLOWED_ANCESTORS)||Jr.open(ri.ALERT_ERRORS.ORIGIN_NOT_ALLOWED,"error")}catch(t){if(!(t instanceof Error))return;switch(t.message){case"RATE_LIMITED":Jr.open(ri.ALERT_ERRORS.RATE_LIMITED_APP_CONFIGURATION,"error");break;case"SERVER_ERROR":{let r=t.cause instanceof Error?t.cause:t;Jr.open({displayMessage:ri.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.displayMessage,debugMessage:ri.ALERT_ERRORS.SERVER_ERROR_APP_CONFIGURATION.debugMessage(r.message)},"error");break}default:break}}}createCleanupHandler(t){return()=>{t.forEach(r=>{try{r()}catch{}})}}sendInitializeEvent(t){let{...r}=t;delete r.adapters,delete r.universalProvider,xe.sendEvent({type:"track",event:"INITIALIZE",properties:{...r,networks:t.networks.map(n=>n.id),siweConfig:{options:t.siweConfig?.options||{}}}})}initControllers(t){this.initializeOptionsController(t),this.initializeChainController(t),this.initializeThemeController(t),this.initializeConnectionController(t),this.initializeConnectorController()}initAdapterController(){gg.initialize(this.chainAdapters)}initializeThemeController(t){t.themeMode&&Gr.setThemeMode(t.themeMode),t.themeVariables&&Gr.setThemeVariables(t.themeVariables)}initializeChainController(t){if(!this.connectionControllerClient)throw new Error("ConnectionControllerClient must be set");k.initialize(t.adapters??[],this.caipNetworks,{connectionControllerClient:this.connectionControllerClient});let r=this.getDefaultNetwork();r&&k.setActiveCaipNetwork(r)}initializeConnectionController(t){J.initialize(t.adapters??[]),J.setWcBasic(t.basic??!1)}initializeConnectorController(){X.initialize(this.chainNamespaces)}initializeProjectSettings(t){W.setProjectId(t.projectId),W.setSdkVersion(t.sdkVersion)}initializeOptionsController(t){W.setDebug(t.debug!==!1),W.setEnableWalletGuide(t.enableWalletGuide!==!1),W.setEnableWallets(t.enableWallets!==!1),W.setEIP6963Enabled(t.enableEIP6963!==!1),W.setEnableCoinbase(t.enableCoinbase!==!1),W.setEnableNetworkSwitch(t.enableNetworkSwitch!==!1),W.setEnableReconnect(t.enableReconnect!==!1),W.setEnableMobileFullScreen(t.enableMobileFullScreen===!0),W.setCoinbasePreference(t.coinbasePreference),W.setEnableAuthLogger(t.enableAuthLogger!==!1),W.setCustomRpcUrls(t.customRpcUrls),W.setEnableEmbedded(t.enableEmbedded),W.setAllWallets(t.allWallets),W.setIncludeWalletIds(t.includeWalletIds),W.setExcludeWalletIds(t.excludeWalletIds),W.setFeaturedWalletIds(t.featuredWalletIds),W.setTokens(t.tokens),W.setTermsConditionsUrl(t.termsConditionsUrl),W.setPrivacyPolicyUrl(t.privacyPolicyUrl),W.setCustomWallets(t.customWallets),W.setFeatures(t.features),W.setAllowUnsupportedChain(t.allowUnsupportedChain),W.setUniversalProviderConfigOverride(t.universalProviderConfigOverride),W.setPreferUniversalLinks(t.experimental_preferUniversalLinks),W.setDefaultAccountTypes(t.defaultAccountTypes);let r=this.getDefaultMetaData();if(!t.metadata&&r&&(t.metadata=r),W.setMetadata(t.metadata),W.setDisableAppend(t.disableAppend),W.setEnableEmbedded(t.enableEmbedded),W.setSIWX(t.siwx),this.features=W.state.features??{},!t.projectId){Jr.open(ri.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED,"error");return}if(t.adapters?.find(o=>o.namespace===j.CHAIN.EVM)&&t.siweConfig){if(t.siwx)throw new Error("Cannot set both `siweConfig` and `siwx` options");W.setSIWX(t.siweConfig.mapToSIWX())}}getDefaultMetaData(){return ee.isClient()?{name:document.getElementsByTagName("title")?.[0]?.textContent||"",description:document.querySelector('meta[property="og:description"]')?.content||"",url:window.location.origin,icons:[document.querySelector('link[rel~="icon"]')?.href||""]}:null}setUnsupportedNetwork(t){let r=this.getActiveChainNamespace();if(r){let n=yu.getUnsupportedNetwork(`${r}:${t}`);k.setActiveCaipNetwork(n)}}getDefaultNetwork(){return yu.getCaipNetworkFromStorage(this.defaultCaipNetwork)}extendCaipNetwork(t,r){return yu.extendCaipNetwork(t,{customNetworkImageUrls:r.chainImages,projectId:r.projectId})}extendCaipNetworks(t){return yu.extendCaipNetworks(t.networks,{customNetworkImageUrls:t.chainImages,customRpcUrls:t.customRpcUrls,projectId:t.projectId})}extendDefaultCaipNetwork(t){let r=t.networks.find(o=>o.id===t.defaultNetwork?.id);return r?yu.extendCaipNetwork(r,{customNetworkImageUrls:t.chainImages,customRpcUrls:t.customRpcUrls,projectId:t.projectId}):void 0}async disconnectConnector(t,r){try{this.setLoading(!0,t);let n={connections:[]},o=this.getAdapter(t);return(k.state.chains.get(t)?.accountState?.caipAddress||!W.state.enableReconnect)&&o?.disconnect&&(n=await o.disconnect({id:r})),this.setLoading(!1,t),n}catch(n){throw this.setLoading(!1,t),new Error(`Failed to disconnect chains: ${n.message}`)}}createClients(){this.connectionControllerClient={connectWalletConnect:async()=>{let t=k.state.activeChain,r=this.getAdapter(t),n=this.getCaipNetwork(t)?.id,o=J.getConnections(t),s=this.remoteFeatures.multiWallet,i=o.length>0;if(!r)throw new Error("Adapter not found");let a=await r.connectWalletConnect(n);(!i||!s)&&this.close(),this.setClientId(a?.clientId||null),ae.setConnectedNamespaces([...k.state.chains.keys()]),await this.syncWalletConnectAccount(),await ho.initializeIfEnabled()},connectExternal:async t=>{let r=await this.onConnectExternal(t);return await this.connectInactiveNamespaces(t,r),r?{address:r.address}:void 0},reconnectExternal:async({id:t,info:r,type:n,provider:o})=>{let s=k.state.activeChain,i=this.getAdapter(s);if(!s)throw new Error("reconnectExternal: namespace not found");if(!i)throw new Error("reconnectExternal: adapter not found");i?.reconnect&&(await i?.reconnect({id:t,info:r,type:n,provider:o,chainId:this.getCaipNetwork()?.id}),ae.addConnectedNamespace(s),this.syncConnectedWalletInfo(s))},disconnectConnector:async t=>{await this.disconnectConnector(t.namespace,t.id)},disconnect:async t=>{let{id:r,chainNamespace:n,initialDisconnect:o}=t||{},s=n||k.state.activeChain,i=X.getConnectorId(s),a=r===j.CONNECTOR_ID.AUTH||i===j.CONNECTOR_ID.AUTH,c=r===j.CONNECTOR_ID.WALLET_CONNECT||i===j.CONNECTOR_ID.WALLET_CONNECT;try{let l=Array.from(k.state.chains.keys()),u=n?[n]:l;(c||a)&&(u=l);let d=u.map(async m=>{let g=X.getConnectorId(m),y=r||g,b=await this.disconnectConnector(m,y);b&&(a&&ae.deleteConnectedSocialProvider(),b.connections.forEach(C=>{ae.addDisconnectedConnectorId(C.connectorId,m)})),o&&this.onDisconnectNamespace({chainNamespace:m,closeModal:!1})}),p=await Promise.allSettled(d);mt.resetSend(),J.resetWcConnection(),ho.getSIWX()?.signOutOnDisconnect&&await ho.clearSessions(),X.setFilterByNamespace(void 0),J.syncStorageConnections();let f=p.filter(m=>m.status==="rejected");if(f.length>0)throw new Error(f.map(m=>m.reason.message).join(", "));xe.sendEvent({type:"track",event:"DISCONNECT_SUCCESS",properties:{namespace:n||"all"}})}catch(l){throw new Error(`Failed to disconnect chains: ${l.message}`)}},checkInstalled:t=>t?t.some(r=>!!window.ethereum?.[String(r)]):!!window.ethereum,signMessage:async t=>{let r=k.state.activeChain,n=this.getAdapter(k.state.activeChain);if(!r)throw new Error("signMessage: namespace not found");if(!n)throw new Error("signMessage: adapter not found");let o=this.getAddress(r);if(!o)throw new Error("signMessage: address not found");
307return(await n?.signMessage({message:t,address:o,provider:or.getProvider(r)}))?.signature||""},sendTransaction:async t=>{let r=t.chainNamespace;if(!r)throw new Error("sendTransaction: namespace not found");if(We.SEND_SUPPORTED_NAMESPACES.includes(r)){let n=this.getAdapter(r);if(!n)throw new Error("sendTransaction: adapter not found");let o=or.getProvider(r);return(await n?.sendTransaction({...t,caipNetwork:this.getCaipNetwork(),provider:o}))?.hash||""}return""},estimateGas:async t=>{let r=t.chainNamespace;if(r===j.CHAIN.EVM){let n=this.getAdapter(r);if(!n)throw new Error("estimateGas: adapter is required but got undefined");let o=or.getProvider(r),s=this.getCaipNetwork();if(!s)throw new Error("estimateGas: caipNetwork is required but got undefined");return(await n?.estimateGas({...t,provider:o,caipNetwork:s}))?.gas||0n}return 0n},getEnsAvatar:async()=>{let t=k.state.activeChain;if(!t)throw new Error("getEnsAvatar: namespace is required but got undefined");let r=this.getAddress(t);if(!r)throw new Error("getEnsAvatar: address not found");return await this.syncIdentity({address:r,chainId:Number(this.getCaipNetwork()?.id),chainNamespace:t}),k.getAccountData()?.profileImage||!1},getEnsAddress:async t=>await qc.resolveReownName(t),writeContract:async t=>{let r=k.state.activeChain,n=this.getAdapter(r);if(!r)throw new Error("writeContract: namespace is required but got undefined");if(!n)throw new Error("writeContract: adapter is required but got undefined");let o=this.getCaipNetwork(),s=this.getCaipAddress(),i=or.getProvider(r);if(!o||!s)throw new Error("writeContract: caipNetwork or caipAddress is required but got undefined");return(await n?.writeContract({...t,caipNetwork:o,provider:i,caipAddress:s}))?.hash},writeSolanaTransaction:async t=>{let r=k.state.activeChain,n=this.getAdapter(r);if(!r)throw new Error("writeContract: namespace is required but got undefined");if(!n)throw new Error("writeContract: adapter is required but got undefined");let o=this.getCaipNetwork(),s=this.getCaipAddress(),i=or.getProvider(r);if(!o||!s)throw new Error("writeContract: caipNetwork or caipAddress is required but got undefined");return(await n?.writeSolanaTransaction({...t,caipNetwork:o,provider:i,caipAddress:s}))?.hash},parseUnits:(t,r)=>{let n=this.getAdapter(k.state.activeChain);if(!n)throw new Error("parseUnits: adapter is required but got undefined");return n?.parseUnits({value:t,decimals:r})??0n},formatUnits:(t,r)=>{let n=this.getAdapter(k.state.activeChain);if(!n)throw new Error("formatUnits: adapter is required but got undefined");return n?.formatUnits({value:t,decimals:r})??"0"},getCapabilities:async t=>{let r=this.getAdapter(k.state.activeChain);if(!r)throw new Error("getCapabilities: adapter is required but got undefined");return await r?.getCapabilities(t)},grantPermissions:async t=>{let r=this.getAdapter(k.state.activeChain);if(!r)throw new Error("grantPermissions: adapter is required but got undefined");return await r?.grantPermissions(t)},revokePermissions:async t=>{let r=this.getAdapter(k.state.activeChain);if(!r)throw new Error("revokePermissions: adapter is required but got undefined");return r?.revokePermissions?await r.revokePermissions(t):"0x"},walletGetAssets:async t=>{let r=this.getAdapter(k.state.activeChain);if(!r)throw new Error("walletGetAssets: adapter is required but got undefined");return await r?.walletGetAssets(t)??{}},updateBalance:t=>{let r=this.getAddress(t),n=this.getCaipNetwork(t);!n||!r||this.updateNativeBalance(r,n?.id,t)}},J.setClient(this.connectionControllerClient)}async onConnectExternal(t){let r=k.state.activeChain,n=t.chain||r,o=this.getAdapter(n),s=!0;if(t.type===_r.CONNECTOR_TYPE_AUTH&&j.AUTH_CONNECTOR_SUPPORTED_CHAINS.some(d=>X.getConnectorId(d)===j.CONNECTOR_ID.AUTH)&&t.chain!==r&&(s=!1),t.chain&&t.chain!==r&&!t.caipNetwork){let l=this.getCaipNetworks().find(u=>u.chainNamespace===t.chain);l&&s&&this.setCaipNetwork(l)}if(!n)throw new Error("connectExternal: namespace not found");if(!o)throw new Error("connectExternal: adapter not found");let i=this.getCaipNetwork(n),a=t.caipNetwork||i,c=await o.connect({id:t.id,address:t.address,info:t.info,type:t.type,provider:t.provider,socialUri:t.socialUri,chainId:t.caipNetwork?.id||i?.id,rpcUrl:t.caipNetwork?.rpcUrls?.default?.http?.[0]||i?.rpcUrls?.default?.http?.[0]});if(c)return ae.addConnectedNamespace(n),this.syncProvider({...c,chainNamespace:n}),this.setStatus("connected",n),this.syncConnectedWalletInfo(n),ae.removeDisconnectedConnectorId(t.id,n),{address:c.address,connectedCaipNetwork:a}}async connectInactiveNamespaces(t,r){let n=t.type===_r.CONNECTOR_TYPE_AUTH,o=Qr.getOtherAuthNamespaces(r?.connectedCaipNetwork?.chainNamespace),s=k.state.activeCaipNetwork,i=this.getAdapter(s?.chainNamespace);n&&(await Promise.all(o.map(async a=>{try{let c=or.getProvider(a),l=this.getCaipNetwork(a);await this.getAdapter(a)?.connect({...t,provider:c,socialUri:void 0,chainId:l?.id,rpcUrl:l?.rpcUrls?.default?.http?.[0]})&&(ae.addConnectedNamespace(a),ae.removeDisconnectedConnectorId(t.id,a),this.setStatus("connected",a),this.syncConnectedWalletInfo(a))}catch(c){Jr.warn(ri.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.displayMessage,ri.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.debugMessage(
vendor: 12,018 bytes, line 307
307a,c instanceof Error?c.message:void 0),ri.ALERT_WARNINGS.INACTIVE_NAMESPACE_NOT_CONNECTED.code)}})),s&&await i?.switchNetwork({caipNetwork:s}))}getApprovedCaipNetworksData(){if(or.getProviderId(k.state.activeChain)===_r.CONNECTOR_TYPE_WALLET_CONNECT){let r=this.universalProvider?.session?.namespaces;return{supportsAllNetworks:this.universalProvider?.session?.peer?.metadata.name==="MetaMask Wallet",approvedCaipNetworkIds:this.getChainsFromNamespaces(r)}}return{supportsAllNetworks:!0,approvedCaipNetworkIds:[]}}async switchCaipNetwork(t){let r=t.chainNamespace;if(this.getAddressByChainNamespace(t.chainNamespace)){let o=or.getProviderId(r);if(t.chainNamespace===k.state.activeChain)await this.getAdapter(r)?.switchNetwork({caipNetwork:t});else if(this.setCaipNetwork(t),o===_r.CONNECTOR_TYPE_WALLET_CONNECT)this.syncWalletConnectAccount();else{let s=this.getAddressByChainNamespace(r);s&&this.syncAccount({address:s,chainId:t.id,chainNamespace:r})}}else this.setCaipNetwork(t)}getChainsFromNamespaces(t={}){return Object.values(t).flatMap(r=>{let n=r.chains||[],o=r.accounts.map(s=>{let{chainId:i,chainNamespace:a}=Qe.parseCaipAddress(s);return`${a}:${i}`});return Array.from(new Set([...n,...o]))})}createAdapters(t){return this.createClients(),this.chainNamespaces.reduce((r,n)=>{let o=t?.find(s=>s.namespace===n);return o?(o.construct({namespace:n,projectId:this.options?.projectId,networks:this.caipNetworks?.filter(({chainNamespace:s})=>s===n)}),r[n]=o):r[n]=new c7({namespace:n,networks:this.getCaipNetworks()}),r},{})}async initChainAdapter(t){this.onConnectors(t),this.listenAdapter(t);let r=this.getAdapter(t);if(!r)throw new Error("adapter not found");await r.syncConnectors(),await this.createUniversalProviderForAdapter(t)}async initChainAdapters(){await Promise.all(this.chainNamespaces.map(async t=>{await this.initChainAdapter(t)})),this.initAdapterController()}onConnectors(t){this.getAdapter(t)?.on("connectors",this.setConnectors.bind(this))}listenAdapter(t){let r=this.getAdapter(t);if(!r)return;let n=ae.getConnectionStatus();W.state.enableReconnect===!1?this.setStatus("disconnected",t):n==="connected"?this.setStatus("connecting",t):n==="disconnected"?(ae.clearAddressCache(),this.setStatus(n,t)):this.setStatus(n,t),r.on("switchNetwork",({address:o,chainId:s})=>{let i=this.getCaipNetworks().find(l=>l.id.toString()===s.toString()||l.caipNetworkId.toString()===s.toString()),a=k.state.activeChain===t,c=k.state.chains.get(t)?.accountState?.address;if(i){let l=a&&o?o:c;l&&this.syncAccount({address:l,chainId:i.id,chainNamespace:t})}else this.setUnsupportedNetwork(s)}),r.on("disconnect",()=>{let o=this.remoteFeatures.multiWallet,s=Array.from(J.state.connections.values()).flat();this.onDisconnectNamespace({chainNamespace:t,closeModal:!o||s.length===0})}),r.on("connections",o=>{this.setConnections(o,t)}),r.on("pendingTransactions",()=>{let o=this.getAddress(t),s=k.state.activeCaipNetwork;!o||!s?.id||this.updateNativeBalance(o,s.id,s.chainNamespace)}),r.on("accountChanged",({address:o,chainId:s,connector:i})=>{this.handlePreviousConnectorConnection(i);let a=k.state.activeChain===t;i?.provider&&(this.syncProvider({id:i.id,type:i.type,provider:i?.provider,chainNamespace:t}),this.syncConnectedWalletInfo(t));let c=k.getNetworkData(t)?.caipNetwork?.id,l=s||c;a&&l?this.syncAccount({address:o,chainId:l,chainNamespace:t}):!a&&l?(this.syncAccountInfo(o,l,t),this.syncBalance({address:o,chainId:l,chainNamespace:t})):this.syncAccountInfo(o,s,t),ae.addConnectedNamespace(t)})}async handlePreviousConnectorConnection(t){let r=t?.chain,n=t?.id,o=X.getConnectorId(r),s=W.state.remoteFeatures?.multiWallet,a=r&&n&&o&&o!==n&&!s;try{a&&await J.disconnect({id:o,namespace:r})}catch(c){console.warn("Error disconnecting previous connector",c)}}async createUniversalProviderForAdapter(t){await this.getUniversalProvider(),this.universalProvider&&await this.chainAdapters?.[t]?.setUniversalProvider?.(this.universalProvider)}async syncExistingConnection(){await Promise.allSettled(this.chainNamespaces.map(t=>this.syncNamespaceConnection(t)))}async unSyncExistingConnection(){try{await Promise.allSettled(this.chainNamespaces.map(t=>J.disconnect({namespace:t,initialDisconnect:!0})))}catch(t){console.error("Error disconnecting existing connections:",t)}}async reconnectWalletConnect(){await this.syncWalletConnectAccount();let t=this.getAddress();this.getCaipAddress()||ae.deleteRecentWallet();let r=ae.getRecentWallet();xe.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:t,properties:{method:ee.isMobile()?"mobile":"qrcode",name:r?.name||"Unknown",reconnect:!0,view:Z.state.view,walletRank:r?.order}})}async syncNamespaceConnection(t){try{t===j.CHAIN.EVM&&ee.isSafeApp()&&X.setConnectorId(j.CONNECTOR_ID.SAFE,t);let r=X.getConnectorId(t);switch(this.setStatus("connecting",t),r){case j.CONNECTOR_ID.WALLET_CONNECT:await this.reconnectWalletConnect();break;case j.CONNECTOR_ID.AUTH:break;default:await this.syncAdapterConnection(t)}}catch(r){console.warn("AppKit couldn't sync existing connection",r),this.setStatus("disconnected",t)}}onDisconnectNamespace(t){let{chainNamespace:r,closeModal:n}=t||{};k.resetAccount(r),k.resetNetwork(r),ae.removeConnectedNamespace(r);let o=Array.from(k.state.chains.keys());(r?[r]:o).forEach(i=>ae.addDisconnectedConnectorId(X.getConnectorId(i)||"",i)),X.removeConnectorId(r),or.resetChain(r),this.setUser(null,r),this.setStatus("disconnected",r),this.setConnectedWalletInfo(null,r),n!==!1&&Oe.close()}async syncAdapterConnections(){await Promise.allSettled(this.chainNamespaces.map(t=>{let r=this.getAdapter(t),n=this.getCaipAddress(t),o=this.getCaipNetwork(t);return r?.syncConnections({connectToFirstConnector:!n,caipNetwork:o})}))}async syncAdapterConnection(t){let r=this.getAdapter(t),n=this.getCaipNetwork(t),o=X.getConnectorId(t),i=X.getConnectors(t).find(a=>a.id===o);try{if(!r||!i)throw new Error(`Adapter or connector not found for namespace ${t}`);if(!n?.id)throw new Error("CaipNetwork not found");let a=await r?.syncConnection({namespace:t,id:i.id,chainId:n.id,rpcUrl:n?.rpcUrls?.default?.http?.[0]});a?(this.syncProvider({...a,chainNamespace:t}),await this.syncAccount({...a,chainNamespace:t}),this.setStatus("connected",t),xe.sendEvent({type:"track",event:"CONNECT_SUCCESS",address:a.address,properties:{method:"browser",name:i.info?.name||i.name||"Unknown",reconnect:!0,view:Z.state.view,walletRank:i?.explorerWallet?.order}})):this.setStatus("disconnected",t)}catch{this.onDisconnectNamespace({chainNamespace:t,closeModal:!1})}}async syncWalletConnectAccount(){let t=Object.keys(this.universalProvider?.session?.namespaces||{}),r=this.chainNamespaces.map(async n=>{let o=this.getAdapter(n);if(!o)return;let s=this.universalProvider?.session?.namespaces?.[n]?.accounts||[],i=k.state.activeCaipNetwork?.id,a=s.find(l=>{let{chainId:u}=Qe.parseCaipAddress(l);return u===i?.toString()})||s[0];if(a){let l=Qe.validateCaipAddress(a),{chainId:u,address:d}=Qe.parseCaipAddress(l);if(or.setProviderId(n,_r.CONNECTOR_TYPE_WALLET_CONNECT),this.caipNetworks&&k.state.activeCaipNetwork&&o.namespace!==j.CHAIN.EVM){let p=o.getWalletConnectProvider({caipNetworks:this.getCaipNetworks(),provider:this.universalProvider,activeCaipNetwork:k.state.activeCaipNetwork});or.setProvider(n,p)}else or.setProvider(n,this.universalProvider);X.setConnectorId(j.CONNECTOR_ID.WALLET_CONNECT,n),ae.addConnectedNamespace(n),await this.syncAccount({address:d,chainId:u,chainNamespace:n})}else t.includes(n)&&this.setStatus("disconnected",n);let c=this.getApprovedCaipNetworksData();this.syncConnectedWalletInfo(n),k.setApprovedCaipNetworksData(n,{approvedCaipNetworkIds:c.approvedCaipNetworkIds,supportsAllNetworks:c.supportsAllNetworks})});await Promise.all(r)}syncProvider({type:t,provider:r,id:n,chainNamespace:o}){or.setProviderId(o,t),or.setProvider(o,r),X.setConnectorId(n,o)}async syncAccount(t){let r=t.chainNamespace===k.state.activeChain,n=k.getCaipNetworkByNamespace(t.chainNamespace,t.chainId),{address:o,chainId:s,chainNamespace:i}=t,{chainId:a}=ae.getActiveNetworkProps(),c=n?.id||a,l=k.state.activeCaipNetwork?.name===j.UNSUPPORTED_NETWORK_NAME,u=k.getNetworkProp("supportsAllNetworks",i);if(this.setStatus("connected",i),!(l&&!u)&&c){let d=this.getCaipNetworks().find(g=>g.id.toString()===c.toString()),p=this.getCaipNetworks().find(g=>g.chainNamespace===i);if(!u&&!d&&!p){let g=this.getApprovedCaipNetworkIds()||[],y=g.find(C=>Qe.parseCaipNetworkId(C)?.chainId===c.toString()),b=g.find(C=>Qe.parseCaipNetworkId(C)?.chainNamespace===i);d=this.getCaipNetworks().find(C=>C.caipNetworkId===y),p=this.getCaipNetworks().find(C=>C.caipNetworkId===b||"deprecatedCaipNetworkId"in C&&C.deprecatedCaipNetworkId===b)}let f=d||p;f?.chainNamespace===k.state.activeChain?W.state.enableNetworkSwitch&&!W.state.allowUnsupportedChain&&k.state.activeCaipNetwork?.name===j.UNSUPPORTED_NETWORK_NAME?k.showUnsupportedChainUI():this.setCaipNetwork(f):r||n&&this.setCaipNetworkOfNamespace(n,i),this.syncConnectedWalletInfo(i);let m=this.getAddress(i);Qr.isLowerCaseMatch(o,m)||this.syncAccountInfo(o,f?.id,i),r?await this.syncBalance({address:o,chainId:f?.id,chainNamespace:i}):await this.syncBalance({address:o,chainId:n?.id,chainNamespace:i}),this.syncIdentity({address:o,chainId:s,chainNamespace:i})}}async syncAccountInfo(t,r,n){let o=this.getCaipAddress(n),s=r||o?.split(":")[1];if(!s)return;let i=`${n}:${s}:${t}`;this.setCaipAddress(i,n,!0),await this.syncIdentity({address:t,chainId:s,chainNamespace:n})}async syncReownName(t,r){try{let n=await this.getReownName(t);if(n[0]){let o=n[0];this.setProfileName(o.name,r)}else this.setProfileName(null,r)}catch{this.setProfileName(null,r)}}syncConnectedWalletInfo(t){let r=X.getConnectorId(t),n=or.getProviderId(t);if(n===_r.CONNECTOR_TYPE_ANNOUNCED||n===_r.CONNECTOR_TYPE_INJECTED){if(r){let s=this.getConnectors().find(i=>{let a=i.id===r,c=i.info?.rdns===r,l=i.connectors?.some(u=>u.id===r||u.info?.rdns===r);return a||c||!!l});if(s){let{info:i,name:a,imageUrl:c}=s,l=c||this.getConnectorImage(s);this.setConnectedWalletInfo({name:a,icon:l,...i},t)}}}else if(n===_r.CONNECTOR_TYPE_WALLET_CONNECT){let o=or.getProvider(t);o?.session&&this.setConnectedWalletInfo({...o.session.peer.metadata,name:o.session.peer.metadata.name,icon:o.session.peer.metadata.icons?.[0]},t)}else if(r&&(r===j.CONNECTOR_ID.COINBASE_SDK||r===j.CONNECTOR_ID.COINBASE)){let o=this.getConnectors().find(c=>c.id===r),s=o?.name||"Coinbase Wallet",i=o?.imageUrl||this.getConnectorImage(o),a=o?.info;this.setConnectedWalletInfo({...a,name:s,icon:i},t)}}async syncBalance(t){!o1.getNetworksByNamespace(this.getCaipNetworks(),t.chainNamespace).find(n=>n.id.toString()===t.chainId?.toString())||!t.chainId||await this.updateNativeBalance(t.address,t.chainId,t.chainNamespace)}async ready(){await this.readyPromise}async updateNativeBalance(t,r,n){let o=this.getAdapter(n),s=k.getCaipNetworkByNamespace(n,r);if(o){let i=await o.getBalance({address:t,chainId:r,caipNetwork:s,tokens:this.options.tokens});return this.setBalance(i.balance,i.symbol,n),i}}async initializeUniversalAdapter(){let t=lV.createLogger((o,...s)=>{o&&this.handleAlertError(o),console.error(...s)}),r={projectId:this.options?.projectId,metadata:{name:this.options?.metadata?this.options?.metadata.name:"",description:this.options?.metadata?this.options?.metadata.description:"",url:this.options?.metadata?this.options?.metadata.url:"",icons:this.options?.metadata?this.options?.metadata.icons:[""]},logger:t};W.setManualWCControl(!!this.options?.manualWCControl),this.universalProvider=this.options.universalProvider??await j_.init(r);let n=this.universalProvider.disconnect.bind(this.universalProvider);this.universalProvider.disconnect=async()=>{try{return await n()}catch(o){if(o instanceof Error&&o.message.includes("Missing or invalid. Record was recently deleted"))return;throw o}},W.state.enableReconnect===!1&&this.universalProvider.session&&await this.universalProvider.disconnect(),this.listenWalletConnect()}listenWalletConnect(){this.universalProvider&&this.chainNamespaces.forEac
307h(t=>{qc.listenWcProvider({universalProvider:this.universalProvider,namespace:t,onDisplayUri:r=>{J.setUri(r)},onConnect:r=>{let{address:n}=ee.getAccount(r[0]);for(let o of this.chainNamespaces)ae.removeDisconnectedConnectorId(j.CONNECTOR_ID.WALLET_CONNECT,o);J.finalizeWcConnection(n)},onDisconnect:()=>{k.state.noAdapters&&this.resetAccount(t),J.resetWcConnection()},onChainChanged:r=>{let n=k.state.activeChain,o=n&&X.state.activeConnectorIds[n]===j.CONNECTOR_ID.WALLET_CONNECT;if(n===t&&(k.state.noAdapters||o)){let s=this.getCaipNetworks().find(a=>a.id.toString()===r.toString()||a.caipNetworkId.toString()===r.toString()),i=this.getCaipNetwork();if(!s){this.setUnsupportedNetwork(r);return}i?.id.toString()!==s?.id.toString()&&i?.chainNamespace===s?.chainNamespace&&this.setCaipNetwork(s)}},onAccountsChanged:r=>{let n=k.state.activeChain,o=n&&X.state.activeConnectorIds[n]===j.CONNECTOR_ID.WALLET_CONNECT;if(n===t&&(k.state.noAdapters||o)){let s=r?.[0];s&&this.syncAccount({address:s.address,chainId:s.chainId,chainNamespace:s.chainNamespace})}}})})}createUniversalProvider(){return!this.universalProviderInitPromise&&ee.isClient()&&this.options?.projectId&&(this.universalProviderInitPromise=this.initializeUniversalAdapter()),this.universalProviderInitPromise}
307async getUniversalProvider(){if(!this.universalProvider)try{await this.createUniversalProvider()}catch(t){xe.sendEvent({type:"error",event:"INTERNAL_SDK_ERROR",properties:{errorType:"UniversalProviderInitError",errorMessage:t instanceof Error?t.message:"Unknown",uncaught:!1}}),console.error("AppKit:getUniversalProvider - Cannot create provider",t)}return this.universalProvider}getDisabledCaipNetworks(){let t=k.getAllApprovedCaipNetworkIds(),r=k.getAllRequestedCaipNetworks();return ee.sortRequestedNetworks(t,r).filter(o=>k.isCaipNetworkDisabled(o))}handleAlertError(t){let r=Object.entries(ri.UniversalProviderErrors).find(([,{message:a}])=>t.message.includes(a)),[n,o]=r??[],{message:s,alertErrorKey:i}=o??{};if(n&&s&&!this.reportedAlertErrors[n]){let a=ri.ALERT_ERRORS[i];a&&(Jr.open(a,"error"),this.reportedAlertErrors[n]=!0)}}getAdapter(t){if(t)return this.chainAdapters?.[t]}createAdapter(t){if(!t)return;let r=t.namespace;if(!r)return;this.createClients();let n=t;n.namespace=r,n.construct({namespace:r,projectId:this.options?.projectId,networks:this.caipNetworks?.filter(({chainNamespace:o})=>o===r)}),this.chainNamespaces.includes(r)||this.chainNamespaces.push(r),this.chainAdapters&&(this.chainAdapters[r]=n)}async open(t){await this.injectModalUi(),t?.uri&&J.setUri(t.uri);let{isSwap:r,isSend:n}=this.toModalOptions();return r(t)?Oe.open({...t,data:{swap:t.arguments}}):n(t)&&t.arguments?this.openSend(t.arguments):Oe.open(t)}async close(){await this.injectModalUi(),Oe.close()}setLoading(t,r){Oe.setLoading(t,r)}async disconnect(t){await J.disconnect({namespace:t})}getSIWX(){return W.state.siwx}getError(){return""}getChainId(){return k.state.activeCaipNetwork?.id}async switchNetwork(t,{throwOnFailure:r=!1}={}){let n=this.getCaipNetworks().find(o=>o.id===t.id);if(!n){Jr.open(ri.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND,"error");return}await k.switchActiveNetwork(n,{throwOnFailure:r})}getWalletProvider(){return k.state.activeChain?or.state.providers[k.state.activeChain]:null}getWalletProviderType(){return or.getProviderId(k.state.activeChain)}subscribeProviders(t){return or.subscribeProviders(t)}getThemeMode(){return Gr.state.themeMode}getThemeVariables(){return Gr.state.themeVariables}setThemeMode(t){Gr.setThemeMode(t),X3(Gr.state.themeMode)}setTermsConditionsUrl(t){W.setTermsConditionsUrl(t)}setPrivacyPolicyUrl(t){W.setPrivacyPolicyUrl(t)}setThemeVariables(t){Gr.setThemeVariables(t),cV(Gr.state.themeVariables)}subscribeTheme(t){return Gr.subscribe(t)}subscribeConnections(t){return this.remoteFeatures.multiWallet?J.subscribe(t):(Jr.open(j.REMOTE_FEATURES_ALERTS.MULTI_WALLET_NOT_ENABLED.DEFAULT,"info"),()=>{})}getWalletInfo(t){return t?k.state.chains.get(t)?.accountState?.connectedWalletInfo:k.getAccountData()?.connectedWalletInfo}getAccount(t){let r=t||k.state.activeChain,n=X.getAuthConnector(r),o=k.getAccountData(r),s=ae.getConnectedConnectorId(k.state.activeChain),i=J.getConnections(r);if(!r)throw new Error("AppKit:getAccount - namespace is required");let a=i.flatMap(c=>{let{caipNetwork:l}=c;return l?c.accounts.map(({address:u,type:d,publicKey:p})=>ee.createAccount({caipAddress:`${l.caipNetworkId}:${u}`,type:d||"eoa",publicKey:p})):[]});if(o)return{allAccounts:a,caipAddress:o.caipAddress,address:ee.getPlainAddress(o.caipAddress),isConnected:!!o.caipAddress,status:o.status,embeddedWalletInfo:n&&s===j.CONNECTOR_ID.AUTH?{user:o.user?{...o.user,username:ae.getConnectedSocialUsername()}:void 0,authProvider:o.socialProvider||"email",accountType:Dr(r),isSmartAccountDeployed:!!o.smartAccountDeployed}:void 0}}subscribeAccount(t,r){let n=[],o=()=>{let i=this.getAccount(r);i&&t(i)};if(r){let i=k.subscribeChainProp("accountState",o,r);n.push(i)}else{let i=k.subscribe(o);n.push(i)}let s=X.subscribe(o);return n.push(s),()=>{n.forEach(i=>i())}}subscribeNetwork(t){return k.subscribe(({activeCaipNetwork:r})=>{t({caipNetwork:r,chainId:r?.id,caipNetworkId:r?.caipNetworkId})})}subscribeWalletInfo(t,r){return r?k.subscribeChainProp("accountState",n=>t(n?.connectedWalletInfo),r):k.subscribeChainProp("accountState",n=>t(n?.connectedWalletInfo))}subscribeShouldUpdateToAddress(t){return k.subscribeChainProp("accountState",r=>t(r?.shouldUpdateToAddress))}subscribeCaipNetworkChange(t){return k.subscribeKey("activeCaipNetwork",t)}getState(){return as.state}getRemoteFeatures(){return W.state.remoteFeatures}subscribeState(t){return as.subscribe(t)}subscribeRemoteFeatures(t){return W.subscribeKey("remoteFeatures",t)}showErrorMessage(t){Ze.showError(t)}showSuccessMessage(t){Ze.showSuccess(t)}getEvent(){return{...xe.state}}subscribeEvents(t){return xe.subscribe(t)}replace(t){Z.replace(t)}redirect(t){Z.push(t)}popTransactionStack(t){Z.popTransactionStack(t)}isOpen(){return Oe.state.open}isTransactionStackEmpty(){return Z.state.transactionStack.length===0}static getInstance(){return this.instance}updateFeatures(t){W.setFeatures(t)}updateRemoteFeatures(t){W.setRemoteFeatures(t)}updateOptions(t){let n={...W.state||{},...t};W.setOptions(n)}setConnectMethodsOrder(t){W.setConnectMethodsOrder(t)}setWalletFeaturesOrder(t){W.setWalletFeaturesOrder(t)}setCollapseWallets(t){W.setCollapseWallets(t)}setSocialsOrder(t){W.setSocialsOrder(t)}getConnectMethodsOrder(){return is.getConnectOrderMethod(W.state.features,X.getConnectors())}addNetwork(t,r){if(this.chainAdapters&&!this.chainAdapters[t])throw new Error(`Adapter for namespace ${t} doesn't exist`);let n=this.extendCaipNetwork(r,this.options);this.getCaipNetworks().find(o=>o.id===n.id)||k.addNetwork(n)}removeNetwork(t,r){if(this.chainAdapters&&!this.chainAdapters[t])throw new Error(`Adapter for namespace ${t} doesn't exist`);this.getCaipNetworks().find(o=>o.id===r)&&k.removeNetwork(t,r)}}});var Cge=h(()=>{});function V(e){return(t,r)=>typeof r=="object"?$We(e,t,r):((n,o,s)=>{let i=o.hasOwnProperty(s);return o.constructor.createProperty(s,n),i?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,r)}var HWe,$We,hV=h(()=>{K3();HWe={attribute:!0,type:String,converter:W3,reflect:!1,hasChanged:G_},$We=(e=HWe,t,r)=>{let{kind:n,metadata:o}=r,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),n==="setter"&&((e=Object.create(e)).wrapped=!0),s.set(r.name,e),n==="accessor"){let{name:i}=r;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(i,c,e,!0,a)},init(a){return a!==void 0&&this.C(i,void 0,e,a),a}}}if(n==="setter"){let{name:i}=r;return function(a){let c=this[i];t.call(this,a),this.requestUpdate(i,c,e,!0,a)}}throw Error("Unsupported decorator location: "+n)}});function ie(e){return V({...e,state:!0,attribute:!1})}var Sge=h(()=>{hV();});var Ige=h(()=>{});var C6=h(()=>{});var Tge=h(()=>{C6();});var _ge=h(()=>{C6();});var Pge=h(()=>{C6();});var Nge=h(()=>{C6();});var Rge=h(()=>{C6();});var Ue=h(()=>{Cge();hV();Sge();Ige();Tge();_ge();Pge();Nge();Rge()});var Oge,Bge=h(()=>{le();Oge=yr`
308  :host {
309    display: flex;
310    width: inherit;
311    height: inherit;
312    box-sizing: border-box;
313  }
314`});var Di,bs,Zg=h(()=>{le();Ue();kt();A6();Pt();Bge();Di=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},bs=class extends ne{render(){return this.style.cssText=`
315      flex-direction: ${this.flexDirection};
316      flex-wrap: ${this.flexWrap};
317      flex-basis: ${this.flexBasis};
318      flex-grow: ${this.flexGrow};
319      flex-shrink: ${this.flexShrink};
320      align-items: ${this.alignItems};
321      justify-content: ${this.justifyContent};
322      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
323      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
324      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
325      padding-top: ${this.padding&&pr.getSpacingStyles(this.padding,0)};
326      padding-right: ${this.padding&&pr.getSpacingStyles(this.padding,1)};
327      padding-bottom: ${this.padding&&pr.getSpacingStyles(this.padding,2)};
328      padding-left: ${this.padding&&pr.getSpacingStyles(this.padding,3)};
329      margin-top: ${this.margin&&pr.getSpacingStyles(this.margin,
3290)};
330      margin-right: ${this.margin&&pr.getSpacingStyles(this.margin,1)};
331      margin-bottom: ${this.margin&&pr.getSpacingStyles(this.margin,2)};
332      margin-left: ${this.margin&&pr.getSpacingStyles(this.margin,3)};
333      width: ${this.width};
334    `,$`<slot></slot>`}};bs.styles=[ke,Oge];Di([V()],bs.prototype,"flexDirection",void 0);Di([V()],bs.prototype,"flexWrap",void 0);Di([V()],bs.prototype,"flexBasis",void 0);Di([V()],bs.prototype,"flexGrow",void 0);Di([V()],bs.prototype,"flexShrink",void 0);Di([V()],bs.prototype,"alignItems",void 0);Di([V()],bs.prototype,"justifyContent",void 0);Di([V()],bs.prototype,"columnGap",void 0);Di([V()],bs.prototype,"rowGap",void 0);Di([V()],bs.prototype,"gap",void 0);Di([V()],bs.prototype,"padding",void 0);Di([V()],bs.prototype,"margin",void 0);Di([V()],bs.prototype,"width",void 0);bs=Di([te("wui-flex")],bs)});var Mr=h(()=>{Zg()});var ve,kge=h(()=>{uf();ve=e=>e??an});var Pr=h(()=>{kge()});var Uge,FWe,Lge,Dge,mV,gV,SWt,IWt,Mge=h(()=>{uf();Uge=Symbol.for(""),FWe=e=>{if(e?.r===Uge)return e?._$litStatic$},Lge=e=>({_$litStatic$:e,r:Uge}),Dge=new Map,mV=e=>(t,...r)=>{let n=r.length,o,s,i=[],a=[],c,l=0,u=!1;for(;l<n;){for(c=t[l];l<n&&(s=r[l],(o=FWe(s))!==void 0);)c+=o+t[++l],u=!0;l!==n&&a.push(s),i.push(c),l++}if(l===n&&i.push(t[n]),u){let d=i.join("$$lit$$");(t=Dge.get(d))===void 0&&(i.raw=i,Dge.set(d,t=i)),r=a}return e(t,...r)},gV=mV($),SWt=mV(De),IWt=mV(W1e)});var Hge=h(()=>{Mge()});var $ge,Fge=h(()=>{le();$ge=De`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
335  <g clip-path="url(#clip0_87_33)">
336    <path d="M23.9367 2.29447e-07H6.05917C5.26333 -0.000218805 4.47526 0.156384 3.73997 0.46086C3.00469 0.765337 2.33661 1.21172 1.77391 1.7745C1.21121 2.33727 0.7649
33617 3.00542 0.460542 3.74074C0.156167 4.47607 -0.000327963 5.26417 5.16031e-07 6.06V23.9433C4.48257e-07 24.7389 0.156744 25.5267 0.461276 26.2617C0.765808 26.9967 1.21216 27.6645 1.77484 28.2269C2.33752 28.7894 3.0055 29.2355 3.74061 29.5397C4.47573 29.8439 5.26358 30.0003 6.05917 30H23.9417C25.5486 29.9996 27.0895 29.3609 28.2257 28.2245C29.3618 27.0881 30 25.5469 30 23.94V6.06C29.9993 4.45241 29.3602 2.91091 28.2232 1.77449C27.0861 0.638064 25.5443 -0.000220881 23.9367 2.29447e-07Z" fill="url(#paint0_linear_87_33)"/>
337    <path d="M14.8708 6.89259L15.4783 5.84259C15.5679 5.68703 15.6873 5.55064 15.8296 5.44122C15.9719 5.3318 16.1344 5.25148 16.3078 5.20486C16.4812 5.15824 16.662 5.14622 16.8401 5.1695C17.0181 5.19277 17.1898 5.25088 17.3453 5.34051C17.5009 5.43013 17.6373 5.54952 17.7467 5.69186C17.8561 5.83419 17.9364 5.99669 17.9831 6.17006C18.0297 6.34344 18.0417 6.5243 18.0184 6.70232C17.9952 6.88034 17.9371 7.05203 17.8474 7.20759L11.9949 17.3401H16.2283C17.5999 17.3401 18.3691 18.9526 17.7724 20.0701H5.36159C5.18215 20.0707 5.00436 20.0359 4.83845 19.9675C4.67254 19.8992 4.5218 19.7986 4.39492 19.6718C4.26803 19.5449 4.16751 19.3941 4.09915 19.2282C4.03079 19.0623 3.99593 18.8845 3.99659 18.7051C3.99659 17.9476 4.60492 17.3401 5.36159 17.3401H8.84159L13.2958 9.61926L11.9041 7.20426C11.738 6.89096 11.7 6.52543 11.7982 6.18469C11.8963 5.84395 12.1229 5.5546 12.4301 5.37763C12.7374 5.20065 13.1014 5.14987 13.4454 5.23599C13.7893 5.3221 14.0864 5.53838 14.2741 5.83926L14.8708 6.89259ZM9.60659 21.4759L8.29409 23.7526C8.20446 23.9082 8.08506 24.0446 7.94271 24.1541C7.80035 24.2636 7.63783 24.344 7.46441 24.3906C7.291 24.4373 7.11009 24.4493 6.93202 24.4261C6.75395 24.4028 6.58221 24.3447 6.42659 24.2551C6.27097 24.1655 6.13454 24.0461 6.02506 23.9037C5.91559 23.7613 5.83523 23.5988 5.78857 23.4254C5.74191 23.252 5.72986 23.0711 5.75311 22.893C5.77637 22.715 5.83446 22.5432 5.92409 22.3876L6.89909 20.7001C8.00159 20.3584 8.89742 20.6209 9.60659 21.4759ZM20.9066 17.3476H24.4583C25.2158 17.3476 25.8233 17.9551 25.8233 18.7126C25.8233 19.4701 25.2149 20.0776 24.4583 20.0776H22.4858L23.8166 22.3876C24.1916 23.0443 23.9708 23.8726 23.3149 24.2551C23.0006 24.4359 22.6274 24.4845 22.2772 24.3903C21.927 24.2961 21.6286 24.0667 21.4474 23.7526C19.2058 19.8643 17.5216 16.9534 16.4041 15.0151C15.2608 13.0426 16.0783 11.0626 16.8841 10.3909C17.7799 11.9293 19.1191 14.2501 20.9074 17.3476H20.9066Z" fill="white"/>
338  </g>
339  <defs>
340    <linearGradient id="paint0_linear_87_33" x1="15" y1="2.29447e-07" x2="15" y2="30" gradientUnits="userSpaceOnUse">
341      <stop stop-color="#18BFFB"/>
342      <stop offset="1" stop-color="#2072F3"/>
343    </linearGradient>
344    <clipPath id="clip0_87_33">
345      <rect width="30" height="30" fill="white"/>
346    </clipPath>
347  </defs>
348</svg>`});var Vge,zge=h(()=>{le();Vge=De`<svg fill="none" viewBox="0 0 40 40">
349  <g clip-path="url(#a)">
350    <g clip-path="url(#b)">
351      <circle cx="20" cy="19.89" r="20" fill="#000" />
352      <g clip-path="url(#c)">
353        <path
354          fill="#fff"
355          d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
356        />
357      </g>
358    </g>
359  </g>
360  <defs>
361    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
362    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
363    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
364  </defs>
365</svg>`});var jge,qge=h(()=>{le();jge=De`
366  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 8 11">
367    <path
368      fill="var(--apkt-tokens-theme-textPrimary)"
369      d="M7.862 4.86c.159-1.064-.652-1.637-1.76-2.018l.36-1.443-.879-.218-.35 1.404c-.23-.058-.468-.112-.703-.166l.352-1.413-.877-.219-.36 1.442a29.02 29.02 0 0 1-.56-.132v-.005l-1.21-.302-.234.938s.652.15.638.158c.356.089.42.324.41.51l-.41 1.644a.715.715 0 0 1 .09.03l-.092-.024-.574 2.302c-.044.108-.154.27-.402.208.008.013-.639-.16-.639-.16L.227 8.403l1.142.285c.213.053.42.109.626.161l-.363 1.459.877.218.36-1.443c.239.065.472.125.7.
369182l-.36 1.436.879.219.363-1.456c1.497.283 2.623.17 3.097-1.185.381-1.09-.02-1.719-.807-2.129.574-.132 1.006-.51 1.12-1.289ZM5.856 7.673c-.272 1.09-2.107.5-2.702.353l.482-1.933c.595.149 2.503.443 2.22 1.58Zm.271-2.829c-.247.992-1.775.488-2.27.365l.436-1.753c.496.124 2.092.354 1.834 1.388Z"
370    />
371  </svg>
372`});var Wge,Kge=h(()=>{le();Wge=De`<svg viewBox="0 0 32 32" fill="none">
373<path d="M29.0612 10.0613L13.0612 26.0613C12.9218 26.2011 12.7563 26.3121 12.5739 26.3878C12.3916 26.4635 12.1961 26.5024 11.9987 26.5024C11.8013 26.5024 11.6058 26.4635 11.4235 26.3878C11.2411 26.3121 11.0756 26.2011 10.9362 26.0613L3.9362 19.0613C3.79667 18.9217 3.68599 18.7561 3.61047 18.5738C3.53496 18.3915 3.49609 18.1961 3.49609 17.9988C3.49609 17.8014 3.53496 17.606 3.61047 17.4237C3.68599 17.2414 3.79667 17.0758 3.9362 16.9363C4.07573 16.7967 4.24137 16.686 4.42367 16.6105C4.60598 16.535 4.80137 16.4962 4.9987 16.4962C5.19602 16.4962 5.39141 16.535 5.57372 16.6105C5.75602 16.686 5.92167 16.7967 6.0612 16.9363L11.9999 22.875L26.9387 7.93876C27.2205 7.65697 27.6027 7.49866 28.0012 7.49866C28.3997 7.49866 28.7819 7.65697 29.0637 7.93876C29.3455 8.22055 29.5038 8.60274 29.5038 9.00126C29.5038 9.39977 29.3455 9.78197 29.0637 10.0638L29.0612 10.0613Z" fill="currentColor"/>
374</svg>
375`});var Zge,Gge=h(()=>{le();Zge=De`<svg width="30" height="30" viewBox="0 0 30 30" fill="none">
376<path d="M14.9978 7.80003H27.4668C26.2032 5.61107 24.3857 3.79333 22.1968 2.52955C20.008 1.26577 17.525 0.600485 14.9975 0.600586C12.47 0.600687 9.98712 1.26617 7.79838 2.53012C5.60964 3.79408 3.79221 5.61197 2.52881 7.80103L8.76281 18.599L8.76881 18.598C8.13412 17.5044 7.79906 16.2628 7.79743 14.9983C7.79579 13.7339 8.12764 12.4914 8.7595 11.3961C9.39136 10.3008 10.3009 9.39159 11.3963 8.76005C12.4918 8.12851 13.7344 7.79702 14.9988 7.79903L14.9978 7.80003Z" fill="url(#paint0_linear_87_32)"/>
377<path d="M21.237 18.5981L15.003 29.3961C17.5305 29.3961 20.0134 28.7308 22.2022 27.467C24.391 26.2032 26.2086 24.3854 27.4721 22.1965C28.7356 20.0075 29.4006 17.5245 29.4003 14.997C29.3999 12.4695 28.7342 9.9867 27.47 7.7981H15.002L15 7.8041C16.2642 7.80168 17.5067 8.13257 18.6022 8.76342C19.6977 9.39428 20.6076 10.3028 21.2401 11.3974C21.8726 12.492 22.2053 13.734 22.2048 14.9982C22.2042 16.2623 21.8704 17.504 21.237 18.5981Z" fill="url(#paint1_linear_87_32)"/>
378<path d="M8.76502 18.601L2.53102 7.80298C1.26664 9.99172 0.600848 12.4748 0.600586 15.0025C0.600324 17.5302 1.2656 20.0134 2.52953 22.2024C3.79345 24.3914 5.61145 26.209 7.80071 27.4725C9.98998 28.736 12.4733 29.4008 15.001 29.4L21.236 18.602L21.232 18.598C20.6022 19.6941 19.6944 20.6049 18.6003 21.2383C17.5062 21.8717 16.2644 22.2055 15.0002 22.2059C13.7359 22.2063 12.4939 21.8733 11.3994 21.2406C10.3049 20.6079 9.39657 19.6977 8.76602 18.602L8.76502 18.601Z" fill="url(#paint2_linear_87_32)"/>
379<path d="M14.9998 22.2C16.9094 22.2 18.7407 21.4415 20.091 20.0912C21.4412 18.741 22.1998 16.9096 22.1998 15C22.1998 13.0905 21.4412 11.2591 20.091 9.90888C18.7407 8.55862 16.9094 7.80005 14.9998 7.80005C13.0902 7.80005 11.2589 8.55862 9.90864 9.90888C8.55837 11.2591 7.7998 13.0905 7.7998 15C7.7998 16.9096 8.55837 18.741 9.90864 20.0912C11.2589 21.4415 13.0902 22.2 14.9998 22.2Z" fill="white"/>
380<path d="M14.9998 20.7C16.5115 20.7 17.9614 20.0995 19.0303 19.0306C20.0993 17.9616 20.6998 16.5118 20.6998 15C20.6998 13.4883 20.0993 12.0385 19.0303 10.9695C17.9614 9.90058 16.5115 9.30005 14.9998 9.30005C13.4881 9.30005 12.0383 9.90058 10.9693 10.9695C9.90034 12.0385 9.2998 13.4883 9.2998 15C9.2998 16.5118 9.90034 17.9616 10.9693 19.0306C12.0383 20.0995 13.4881 20.7 14.9998 20.7Z" fill="#1A73E8"/>
381<defs>
382  <linearGradient id="paint0_linear_87_32" x1="3.29381" y1="2.99503" x2="38.0998" y2="2.99503" gradientUnits="userSpaceOnUse">
383    <stop stop-color="#D93025"/>
384    <stop offset="1" stop-color="#EA4335"/>
385  </linearGradient>
386  <linearGradient id="paint1_linear_87_32" x1="17.953" y1="29.1431" x2="34.194" y2="-0.298904" gradientUnits="userSpaceOnUse">
387    <stop stop-color="#FCC934"/>
388    <stop offset="1" stop-color="#FBBC04"/>
389  </linearGradient>
390  <linearGradient id="paint2_linear_87_32" x1="22.873" y1="28.2" x2="6.63202" y2="-1.24102" gradientUnits="userSpaceOnUse">
391    <stop stop-color="#1E8E3E"/>
392    <stop offset="1" stop-color="#34A853"/>
393  </linearGradient>
394</defs>
395</svg>`});var Yge,Jge=h(()=>{le();Yge=De`<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
396<path d="M23 11.1962V10.5C23 7.365 18.2712 5 12 5C5.72875 5 1 7.365 1 10.5V15.5C1 18.1112 4.28125 20.1863 9 20.8075V21.5C9 24.635 13.7288 27 20 27C26.2712 27 31 24.635 31 21.5V16.5C31 13.9125 27.8225 11.835 23 11.1962ZM7 18.3587C4.55125 17.675 3 16.5487 3 15.5V13.7413C4.02 14.4637 5.38625 15.0463 7 15.4375V18.3587ZM17 15.4375C18.6138 15.0463 19.98 14.4637 21 13.7413V15.5C21 16.5487 19.4487 17.675 17 18.3587V15.4375ZM15 24.3587C12.5513 23.675 11 22.5487 11 21.5V20.9788C11.3287 20.9913 11.6613 21 12 21C12.485 21 12.9587 20.9837 13.4237 20.9562C13.9403 21.1412 14.4665 21.2981 15 21.4263V24.3587ZM15 18.7812C14.0068 18.928 13.004 19.0011 12 19C10.996 19.0011 9.99324 18.928 9 18.7812V15.8075C9.99472 15.9371 10.9969 16.0014 12 16C13.0031 16.0014 14.0053 15.9371 15 15.8075V18.7812ZM23 24.7812C21.0106 25.0729 18.9894 25.0729 17 24.7812V21.8C17.9944 21.9337 18.9967 22.0005 20 22C21.0031 22.0014 22.0053 21.9371 23 21.8075V24.7812ZM29 21.5C29 22.5487 27.4487 23.675 25 24.3587V21.4375C26.6138 21.0462 27.98 20.4637 29 19.7412V21.5Z" fill="currentColor"/>
397</svg>
398`});var Qge,Xge=h(()=>{le();Qge=De` <svg fill="none" viewBox="0 0 13 4">
399  <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
400</svg>`});var e2e,t2e=h(()=>{le();e2e=De`<svg fill="none" viewBox="0 0 40 40">
401  <g clip-path="url(#a)">
402    <g clip-path="url(#b)">
403      <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
404      <path
405        fill="#fff"
406        fill-rule="evenodd"
407        d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
408        clip-rule="evenodd"
409      />
410    </g>
411  </g>
412  <defs>
413    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
414    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
415  </defs>
416</svg>`});var r2e,n2e=h(()=>{le();r2e=De`<svg
417  xmlns="http://www.w3.org/2000/svg"
418  fill="none"
419  viewBox="0 0 9 12"
420>
421  <path
422    fill="var(--apkt-tokens-theme-textPrimary)"
423    d="M4.666.001v4.435l3.748 1.675L4.666.001Zm0 0L.917 6.111l3.749-1.675V.001Zm0 8.984V12l3.75-5.19-3.75 2.176Zm0 3.014V8.985L.917 6.81 4.666 12Zm0-3.712 3.748-2.176-3.748-1.675v3.851Z"
424  />
425  <path fill="var(--apkt-tokens-theme-textPrimary)" d="m.917 6.111 3.749 2.176v-3.85L.917 6.11Z" />
426</svg>`});var o2e,s2e=h(()=>{le();o2e=De`<svg fill="none" viewBox="0 0 16 16">
427  <path
428    fill="currentColor"
429    d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
430  />
431</svg>`});var i2e,a2e=h(()=>{le();i2e=De`<svg fill="none" viewBox="0 0 40 40">
432  <g clip-path="url(#a)">
433    <g clip-path="url(#b)">
434      <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
435      <g clip-path="url(#c)">
436        <path
437          fill="#fff"
438          d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H2
4381.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
439        />
440      </g>
441    </g>
442    <path
443      fill="#1877F2"
444      d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
445    />
446    <path
447      fill="#fff"
448      d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
449    />
450  </g>
451  <defs>
452    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
453    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
454    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
455  </defs>
456</svg>`});var c2e,l2e=h(()=>{le();c2e=De`<svg style="border-radius: 9999px; overflow: hidden;"  fill="none" viewBox="0 0 1000 1000">
457  <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
458  <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
459  <path
460    fill="#fff"
461    d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
462  />
463  <path
464    fill="#fff"
465    d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
466  />
467</svg>`});var u2e,d2e=h(()=>{le();u2e=De`<svg fill="none" viewBox="0 0 40 40">
468  <g clip-path="url(#a)">
469    <g clip-path="url(#b)">
470      <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
471      <g clip-path="url(#c)">
472        <path
473          fill="#fff"
474          d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
475        />
476      </g>
477    </g>
478  </g>
479  <defs>
480    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
481    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
482    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
483  </defs>
484</svg>`});var p2e,f2e=h(()=>{le();p2e=De`<svg fill="none" viewBox="0 0 40 40">
485  <path
486    fill="#4285F4"
487    d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
488  />
489  <path
490    fill="#34A853"
491    d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
492  />
493  <path
494    fill="#FBBC05"
495    d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
496  />
497  <path
498    fill="#EA4335"
499    d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
500  />
501</svg>`});var h2e,m2e=h(()=>{le();h2e=De`<svg width="10" height="10" viewBox="0 0 10 10" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
502<path d="M4.875 0C3.91082 0 2.96829 0.285914 2.1666 0.821586C1.36491 1.35726 0.740067 2.11863 0.371089 3.00942C0.00211226 3.90021 -0.094429 4.88041 0.093674 5.82607C0.281777 6.77172 0.746076 7.64036 1.42786 8.32215C2.10964 9.00393 2.97828 9.46823 3.92394 9.65633C4.86959 9.84443 5.84979 9.74789 6.74058 9.37891C7.63137 9.00994 8.39274 8.38509 8.92842 7.5834C9.46409 6.78171 9.75 5.83918 9.75 4.875C9.74864 3.58249 9.23458 2.34331 8.32064 1.42936C7.4067 0.515418 6.16751 0.00136492 4.875 0ZM4.6875 2.25C4.79875 2.25 4.90751 2.28299 5.00001 2.3448C5.09251 2.40661 5.16461 2.49446 5.20718 2.59724C5.24976 2.70002 5.2609 2.81312 5.23919 2.92224C5.21749 3.03135 5.16392 3.13158 5.08525 3.21025C5.00658 3.28891 4.90635 3.34249 4.79724 3.36419C4.68813 3.3859 4.57503 3.37476 4.47224 3.33218C4.36946 3.28961 4.28161 3.21751 4.2198 3.12501C4.15799 3.03251 4.125 2.92375 4.125 2.8125C4.125 2.66332 4.18427 2.52024 4.28975 2.41475C4.39524 2.30926 4.53832 2.25 4.6875 2.25ZM5.25 7.5C5.05109 7.5 4.86032 7.42098 4.71967 7.28033C4.57902 7.13968 4.5 6.94891 4.5 6.75V4.875C4.40055 4.875 4.30516 4.83549 4.23484 4.76516C4.16451 4.69484 4.125 4.59946 4.125 4.5C4.125 4.40054 4.16451 4.30516 4.23484 4.23484C4.30516 4.16451 4.40055 4.125 4.5 4.125C4.69891 4.125 4.88968 4.20402 5.03033 4.34467C5.17098 4.48532 5.25 4.67609 5.25 4.875V6.75C5.34946 6.75 5.44484 6.78951 5.51517 6.85983C5.58549 6.93016 5.625 7.02554 5.625 7.125C5.625 7.22446 5.58549 7.31984 5.51517 7.39017C5.44484 7.46049 5.34946 7.5 5.25 7.5Z" fill="#9A9A9A"/>
503</svg>
504`});var g2e,y2e=h(()=>{le();g2e=De`<svg width="32" height="32" viewBox="0 0 32 32" fill="none">
505<path d="M28.925 5.5425C28.925 5.5425 28.925 5.555 28.925 5.56125L21.65 29.5537C21.5399 29.9434 21.3132 30.2901 21.0004 30.5473C20.6876 30.8045 20.3036 3
5050.9598 19.9 30.9925C19.8425 30.9975 19.785 31 19.7275 31C19.3493 31.0012 18.9786 30.8941 18.6592 30.6915C18.3398 30.4888 18.085 30.199 17.925 29.8563L13.375 20.5187C13.3295 20.4252 13.3143 20.3197 13.3315 20.2171C13.3488 20.1145 13.3976 20.0198 13.4713 19.9463L20.7113 12.7063C20.8909 12.5172 20.9895 12.2654 20.9862 12.0047C20.9829 11.7439 20.8778 11.4948 20.6934 11.3104C20.509 11.126 20.2599 11.0209 19.9991 11.0176C19.7383 11.0142 19.4866 11.1129 19.2975 11.2925L12.0538 18.5325C11.9802 18.6061 11.8855 18.655 11.7829 18.6722C11.6803 18.6895 11.5748 18.6743 11.4813 18.6287L2.13502 14.08C1.76954 13.9047 1.46598 13.6224 1.26454 13.2706C1.06311 12.9189 0.973316 12.5142 1.00707 12.1102C1.04082 11.7063 1.19652 11.3221 1.45354 11.0087C1.71056 10.6952 2.05676 10.4673 2.44627 10.355L26.4388 3.08H26.4575C26.7991 2.98403 27.1601 2.98066 27.5034 3.07025C27.8468 3.15984 28.1601 3.33916 28.4113 3.58981C28.6624 3.84045 28.8424 4.15341 28.9326 4.49656C29.0229 4.83971 29.0203 5.2007 28.925 5.5425Z" fill="currentColor"/>
506</svg>
507`});var w2e,b2e=h(()=>{le();w2e=De` <svg width="27" height="30" viewBox="0 0 27 30" fill="none">
508  <path d="M12.5395 14.3237L0.116699 27.5049V27.5188C0.251527 28.0177 0.49972 28.4788 0.841941 28.866C1.18416 29.2533 1.61117 29.5563 2.0897 29.7515C2.56823 29.9467 3.08536 30.0287 3.60081 29.9913C4.11625 29.9538 4.61609 29.7979 5.06139 29.5356L5.0975 29.512L19.0718 21.4519L12.5395 14.3237Z" fill="#EA4335"/>
509  <path d="M25.103 12.0833L25.0919 12.0722L19.0611 8.57202L12.2607 14.6279L19.0847 21.4504L25.0919 17.9864C25.6229 17.6983 26.0665 17.2725 26.376 16.7537C26.6854 16.2349 26.8493 15.6422 26.8505 15.0381C26.8516 14.434 26.6899 13.8408 26.3824 13.3208C26.0749 12.8008 25.633 12.3734 25.103 12.0833Z" fill="#FBBC04"/>
510  <path d="M0.116672 2.49553C0.047224 2.7761 0 3.05528 0 3.35946V26.6537C0 26.9565 0.0347234 27.237 0.116672 27.5162L12.959 14.6725L0.116672 2.49553Z" fill="#4285F4"/>
511  <path d="M12.634 15.0001L19.0607 8.57198L5.0975 0.477133C4.65115 0.210463 4.14916 0.0506574 3.63079 0.0102139C3.11242 -0.0302296 2.59172 0.0497852 2.10941 0.244001C1.6271 0.438216 1.19625 0.741368 0.850556 1.12975C0.504864 1.51813 0.253698 1.98121 0.116699 2.48279L12.634 15.0001Z" fill="#34A853"/>
512</svg>`});var x2e,v2e=h(()=>{le();x2e=De`<svg width="75" height="20" viewBox="0 0 75 20" fill="none" xmlns="http://www.w3.org/2000/svg">
513<path d="M11.6666 5.83334C11.6666 2.61168 14.2783 0 17.5 0H25.8334C29.055 0 31.6666 2.61168 31.6666 5.83334V14.1666C31.6666 17.3883 29.055 20 25.8334 20H17.5C14.2783 20 11.6666 17.3883 11.6666 14.1666V5.83334Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
514<path d="M19.5068 13.7499L22.4309 5.83331H23.2895L20.3654 13.7499H19.5068Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
515<path d="M0 5.41666C0 2.42513 2.42513 0 5.41666 0C8.40821 0 10.8334 2.42513 10.8334 5.41666V14.5833C10.8334 17.5748 8.40821 20 5.41666 20C2.42513 20 0 17.5748 0 14.5833V5.41666Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
516<path d="M4.89581 12.4997V11.458H5.93747V12.4997H4.89581Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
517<path d="M32.5 10C32.5 4.47715 36.6896 0 41.8578 0H65.6422C70.8104 0 75 4.47715 75 10C75 15.5229 70.8104 20 65.6422 20H41.8578C36.6896 20 32.5 15.5229 32.5 10Z" fill="var(--apkt-tokens-theme-foregroundTertiary)"/>
518<path d="M61.7108 12.4475V7.82751H62.5266V8.52418C62.8199 8.01084 63.4157 7.70834 64.0757 7.70834C65.0749 7.70834 65.7715 8.34084 65.7715 9.56918V12.4475H64.9649V9.61503C64.9649 8.80831 64.5066 8.38668 63.8374 8.38668C63.1132 8.38668 62.5266 8.9642 62.5266 9.78001V12.4475H61.7108Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
519<path d="M56.5671 12.4475L55.7147 7.82748H56.4846L57.0896 11.6409L57.8871 9.12916H58.6479L59.4363 11.6134L60.0505 7.82748H60.8204L59.9679 12.4475H59.0513L58.2721 10.0458L57.4838 12.4475H56.5671Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
520<path d="M52.9636 12.5666C51.5611 12.5666 50.7361 11.5217 50.7361 10.1375C50.7361 8.76254 51.5611 7.70834 52.9636 7.70834C54.3661 7.70834 55.1911 8.76254 55.1911 10.1375C55.1911 11.5217 54.3661 12.5666 52.9636 12.5666ZM52.9636 11.8883C53.9719 11.8883 54.357 11.0266 54.357 10.1283C54.357 9.23914 53.9719 8.38668 52.9636 8.38668C51.9552 8.38668 51.5702 9.23914 51.5702 10.1283C51.5702 11.0266 51.9552 11.8883 52.9636 11.8883Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
521<path d="M47.8507 12.5666C46.494 12.5666 45.6415 11.5308 45.6415 10.1375C45.6415 8.75337 46.494 7.70834 47.8507 7.70834C48.9965 7.70834 50.0048 8.35917 49.8948 10.3483H46.4756C46.5398 11.2009 46.934 11.8975 47.8507 11.8975C48.4648 11.8975 48.8681 11.5217 49.0057 11.0908H49.8123C49.684 11.8609 48.9598 12.5666 47.8507 12.5666ZM46.494 9.73416H49.1065C49.0423 8.80831 48.6114 8.37751 47.8507 8.37751C47.0165 8.37751 46.604 8.98254 46.494 9.73416Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
522<path d="M41.7284 12.4475V7.82748H42.5625V8.60665C42.8559 8.09332 43.3601 7.82748 43.8825 7.82748H44.9917V8.60665H43.8184C43.0851 8.60665 42.5625 9.08331 42.5625 10.0092V12.4475H41.7284Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
523</svg>
524
525`});var E2e,A2e=h(()=>{le();E2e=De`
526  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 8">
527    <path
528      fill="var(--apkt-tokens-theme-textPrimary)"
529      d="m9.524 6.307-1.51 1.584A.35.35 0 0 1 7.76 8H.604a.178.178 0 0 1-.161-.103.168.168 0 0 1 .033-.186l1.51-1.583a.35.35 0 0 1 .256-.11h7.154c.034 0 .068.01.096.029a.168.168 0 0 1 .032.26Zm-1.51-3.189a.35.35 0 0 0-.255-.109H.604a.178.178 0 0 0-.161.103.168.168 0 0 0 .033.186l1.51 1.583a.35.35 0 0 0 .256.11h7.154a.178.178 0 0 0 .16-.104.168.168 0 0 0-.032-.185l-1.51-1.584ZM.605 1.981H7.76a.357.357 0 0 0 .256-.11L9.525.289a.17.17 0 0 0 .032-.185.173.173 0 0 0-.16-.103H2.241a.357.357 0 0 0-.256.109L.476 1.692a.17.17 0 0 0-.033.185.178.178 0 0 0 .16.103Z"
530    />
531  </svg>
532`});var C2e,S2e=h(()=>{le();C2e=De`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
533  <g clip-path="url(#a)">
534    <path fill="url(#b)" d="M0 0h32v32H0z"/>
535    <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
536  </g>
537  <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
538  <defs>
539    <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
540      <stop stop-color="#2AABEE"/>
541      <stop offset="1" stop-color="#229ED9"/>
542    </linearGradient>
543    <clipPath id="a">
544      <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
545    </clipPath>
546  </defs>
547</svg>`});var I2e,T2e=h(()=>{le();I2e=De`
548  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 10 10">
549  <path d="M8.37651 0H1.62309C0.381381 0 -0.405611 1.33944 0.219059 2.42225L4.38701 9.64649C4.659 10.1182 5.3406 10.1182 5.61259 9.64649L9.78139 2.42225C10.4052 1.34117 9.61822 0 8.37736 0H8.37651ZM4.38362 7.48005L3.47591 5.72329L1.2857 1.80606C1.14121 1.55534 1.31968 1.23405 1.62225 1.23405H4.38278V7.4809L4.38362 7.48005ZM8.71221 1.80521L6.52284 5.72414L5.61513 7.48005V1.2332H8.37566C8.67823 1.2332 8.85669 1.55449 8.71221 1.80521Z" fill="var(--apkt-tokens-theme-textPrimary)" />
550</svg>
551`});var _2e,P2e=h(()=>{le();_2e=De`
552  <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 64 64">
553    <path fill="var(--apkt-tokens-theme-textPrimary)" d="M61.55 19.28c-3-2.77-7.15-7-10.53-10l-.2-.14a3.82 3.82 0 0 0-1.11-.62l0 0C41.56 7 3.63-.09 2.89 0a1.4 1.4 0 0 0-.58.22L2.12.37a2.23 2.23 0 0 0-.52.84l-.05.13v.71l0 .11C5.82 14.05 22.68 53 26 62.14c.2.62.58 1.8 1.29 1.86h.16c.38 0 2-2.14 2-2.14S58.41 26.74 61.34 23a9.46 9.46 0 0 0 1-1.48A2.41 2.41 0 0 0 61.55 19.28ZM36.88 23.37 49.24 13.12l7.25 6.68Zm-4.8-.67L10.8 5.26l34.43 6.35ZM34 27.27l21.78-3.51-24.9 30ZM7.91 7 30.3 26 27.06 53.78Z"/>
554  </svg>
555`});var N2e,R2e=h(()=>{le();N2e=De`<svg fill="none" viewBox="0 0 40 40">
556  <g clip-path="url(#a)">
557    <g clip-path="url(#b)">
558      <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
559      <g clip-path="url(#c)">
560        <path
561          fill="#fff"
562          d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
563        />
564      </g>
565    </g>
566  </g>
567  <defs>
568    <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
569    <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
570    <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
571  </defs>
572</svg>`});var O2e,B2e=h(()=>{le();O2e=De`<svg fill="none" viewBox="0 0 16 16">
573  <path
574    fill="currentColor"
575    d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 
5750 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
576  />
577</svg>`});var k2e,D2e,U2e,L2e,M2e=h(()=>{le();k2e=De`
578<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
579<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
580<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textPrimary)"/>
581</svg>`,D2e=De`
582<svg xmlns="http://www.w3.org/2000/svg" width="89" height="89" viewBox="0 0 89 89" fill="none">
583<path d="M60.0468 39.2502L65.9116 33.3854C52.6562 20.13 36.1858 20.13 22.9304 33.3854L28.7952 39.2502C38.8764 29.169 49.9725 29.169 60.0536 39.2502H60.0468Z" fill="var(--apkt-tokens-theme-textInvert)"/>
584<path d="M58.0927 52.9146L44.415 39.2369L30.7373 52.9146L17.0596 39.2369L11.2017 45.0949L30.7373 64.6374L44.415 50.9597L58.0927 64.6374L77.6284 45.0949L71.7704 39.2369L58.0927 52.9146Z" fill="var(--apkt-tokens-theme-textInvert)"/>
585</svg>`,U2e=De`
586<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
587<g clip-path="url(#clip0_22274_4692)">
588<path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
589<path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="currentColor"/>
590</g>
591<defs>
592<clipPath id="clip0_22274_4692">
593<path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
594</clipPath>
595</defs>
596</svg>
597`,L2e=De`
598<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
599<circle cx="11" cy="11" r="11" transform="matrix(-1 0 0 1 23 1)" fill="#202020"/>
600<circle cx="11" cy="11" r="11.5" transform="matrix(-1 0 0 1 23 1)" stroke="#C7B994" stroke-opacity="0.7"/>
601<path d="M15.4523 11.0686L16.7472 9.78167C13.8205 6.87297 10.1838 6.87297 7.25708 9.78167L8.55201 11.0686C10.7779 8.85645 13.2279 8.85645 15.4538 11.0686H15.4523Z" fill="#C7B994"/>
602<path d="M15.0199 14.067L12 11.0656L8.98 14.067L5.96004 11.0656L4.66663 12.3511L8.98 16.6393L12 13.638L15.0199 16.6393L19.3333 12.3511L18.0399 11.0656L15.0199 14.067Z" fill="#C7B994"/>
603</svg>
604`});var yV,H2e=h(()=>{le();yV=De`<svg fill="none" viewBox="0 0 41 40">
605  <g clip-path="url(#a)">
606    <path fill="#000" d="M.8 0h40v40H.8z" />
607    <path
608      fill="#fff"
609      d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
610    />
611  </g>
612  <defs>
613    <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
614  </defs>
615</svg>`});var $2e,F2e=h(()=>{le();$2e=yr`
616  :host {
617    display: flex;
618    justify-content: center;
619    align-items: center;
620    aspect-ratio: 1 / 1;
621    color: var(--local-color);
622    width: var(--local-width);
623  }
624
625  svg {
626    height: inherit;
627    width: inherit;
628    object-fit: contain;
629    object-position: center;
630  }
631`});var p7,f7,wV,V2e,rv,z2e,ge,j2e,bV,Ye=h(()=>{p7=globalThis,f7=p7.ShadowRoot&&(p7.ShadyCSS===void 0||p7.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wV=Symbol(),V2e=new WeakMap,rv=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==wV)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o,r=this.t;if(f7&&t===void 0){let n=r!==void 0&&r.length===1;n&&(t=V2e.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&V2e.set(r,t))}return t}toString(){return this.cssText}},z2e=e=>new rv(typeof e=="string"?e:e+"",void 0,wV),ge=(e,...t)=>{let r=e.length===1?e[0]:t.reduce((n,o,s)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[s+1],e[0]);return new rv(r,e,wV)},j2e=(e,t)=>{if(f7)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),o=p7.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=r.cssText,e.appendChild(n)}},bV=f7?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(let n of t.cssRules)r+=n.cssText;return z2e(r)})(e):e});var VWe,zWe,jWe,qWe,WWe,KWe,S6,q2e,ZWe,W2e,nv,I6,ov,K2e,GWe,YWe,pf,Z2e,Ge=h(()=>{Ye();Ye();({is:VWe,defineProperty:zWe,getOwnPropertyDescriptor:jWe,getOwnPropertyNames:qWe,getOwnPropertySymbols:WWe,getPrototypeOf:KWe}=Object),S6=globalThis,q2e=S6.trustedTypes,ZWe=q2e?q2e.emptyScript:"",W2e=S6.reactiveElementPolyfillSupport,nv=(e,t)=>e,I6={toAttribute(e,t){switch(t){case Boolean:e=e?ZWe:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},ov=(e,t)=>!VWe(e,t),K2e={attribute:!0,type:String,converter:I6,reflect:!1,hasChanged:ov};(GWe=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(YWe=S6.litPropertyMetadata)!=null||(S6.litPropertyMetadata=new WeakMap);pf=class extends HTMLElement{static addInitializer(t){var r;this._$Ei(),((r=this.l)!=null?r:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=K2e){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){let n=Symbol(),o=this.getPropertyDescriptor(t,n,r);o!==void 0&&zWe(this.prototype,t,o)}}static getPropertyDescriptor(t,r,n){var o;let{get:s,set:i}=(o=jWe(this.prototype,t))!=null?o:{get(){return this[r]},set(a){this[r]=a}};return{get(){return s?.call(this)},set(a){let c=s?.call(this);i.call(this,a),this.requestUpdate(t,c,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var r;return(r=this.elementProperties.get(t))!=null?r:K2e}static _$Ei(){if(this.hasOwnProperty(nv("elementProperties")))return;let t=KWe(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(nv("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(nv("properties"))){let r=this.properties,n=[...qWe(r),...WWe(r)];for(let o of n)this.createProperty(o,r[o])}let t=this[Symbol.metadata];if(t!==null){let r=litPropertyMetadata.get(t);if(r!==void 0)for(let[n,o]of r)this.elementProperties.set(n,o)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let o=this._$Eu(r,n);o!==void 0&&this._$Eh.set(o,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let r=[];if(Array.isArray(t)){let n=new Set(t.flat(1/0).reverse());for(let o of n)r.unshift(bV(o))}else t!==void 0&&r.push(bV(t));return r}static _$Eu(t,r){let n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(r=>r(this))}addController(t){var r,n;((r=this._$EO)!=null?r:this._$EO=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&((n=t.hostConnected)==null||n.call(t))}
vendor: 8,659 bytes, lines 631-633
631removeController(t){var r;(r=this._$EO)==null||r.delete(t)}_$E_(){let t=new Map,r=this.constructor.elementProperties;for(let n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var t;let r=(t=this.shadowRoot)!=null?t:this.attachShadow(this.constructor.shadowRootOptions);return j2e(r,this.constructor.elementStyles),r}connectedCallback(){var t,r;(t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostConnected)==null?void 0:o.call(n)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$EC(t,r){var n;let o=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,o);if(s!==void 0&&o.reflect===!0){let i=(((n=o.converter)==null?void 0:n.toAttribute)!==void 0?o.converter:I6).toAttribute(r,o.type);this._$Em=t,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(t,r){var n;let o=this.constructor,s=o._$Eh.get(t);if(s!==void 0&&this._$Em!==s){let i=o.getPropertyOptions(s),a=typeof i.converter=="function"?{fromAttribute:i.converter}:((n=i.converter)==null?void 0:n.fromAttribute)!==void 0?i.converter:I6;this._$Em=s,this[s]=a.fromAttribute(r,i.type),this._$Em=null}}requestUpdate(t,r,n){var o;if(t!==void 0){if(n!=null||(n=this.constructor.getPropertyOptions(t)),!((o=n.hasChanged)!=null?o:ov)(this[t],r))return;this.P(t,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,r,n){var o;this._$AL.has(t)||this._$AL.set(t,r),n.reflect===!0&&this._$Em!==t&&((o=this._$Ej)!=null?o:this._$Ej=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t,r;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((t=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[i,a]of s)a.wrapped!==!0||this._$AL.has(i)||this[i]===void 0||this.P(i,this[i],a)}let n=!1,o=this._$AL;try{n=this.shouldUpdate(o),n?(this.willUpdate(o),(r=this._$EO)==null||r.forEach(s=>{var i;return(i=s.hostUpdate)==null?void 0:i.call(s)}),this.update(o)):this._$EU()}catch(s){throw n=!1,this._$EU(),s}n&&this._$AE(o)}willUpdate(t){}_$AE(t){var r;(r=this._$EO)==null||r.forEach(n=>{var o;return(o=n.hostUpdated)==null?void 0:o.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(r=>this._$EC(r,this[r]))),this._$EU()}updated(t){}firstUpdated(t){}};pf.elementStyles=[],pf.shadowRootOptions={mode:"open"},pf[nv("elementProperties")]=new Map,pf[nv("finalized")]=new Map,W2e?.({ReactiveElement:pf}),((Z2e=S6.reactiveElementVersions)!=null?Z2e:S6.reactiveElementVersions=[]).push("2.0.4")});function cye(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return G2e!==void 0?G2e.createHTML(t):t}function T6(e,t,r=e,n){var o,s,i;if(t===Qg)return t;let a=n!==void 0?(o=r._$Co)==null?void 0:o[n]:r._$Cl,c=av(t)?void 0:t._$litDirective$;return a?.constructor!==c&&((s=a?._$AO)==null||s.call(a,!1),c===void 0?a=void 0:(a=new c(e),a._$AT(e,r,n)),n!==void 0?((i=r._$Co)!=null?i:r._$Co=[])[n]=a:r._$Cl=a),a!==void 0&&(t=T6(e,a._$AS(e,t.values),a,n)),t}var h7,m7,G2e,nye,um,oye,JWe,Jg,iv,av,sye,QWe,xV,sv,Y2e,J2e,Gg,Q2e,X2e,iye,aye,ye,H,Qg,Yn,eye,Yg,XWe,cv,vV,lv,_6,EV,AV,CV,SV,tye,rye,lye,Je=h(()=>{h7=globalThis,m7=h7.trustedTypes,G2e=m7?m7.createPolicy("lit-html",{createHTML:e=>e}):void 0,nye="$lit$",um=`lit$${Math.random().toFixed(9).slice(2)}$`,oye="?"+um,JWe=`<${oye}>`,Jg=document,iv=()=>Jg.createComment(""),av=e=>e===null||typeof e!="object"&&typeof e!="function",sye=Array.isArray,QWe=e=>sye(e)||typeof e?.[Symbol.iterator]=="function",xV=`[ 	
632\f\r]`,sv=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Y2e=/-->/g,J2e=/>/g,Gg=RegExp(`>|${xV}(?:([^\\s"'>=/]+)(${xV}*=${xV}*(?:[^ 	
633\f\r"'\`<>=]|("|')|))|$)`,"g"),Q2e=/'/g,X2e=/"/g,iye=/^(?:script|style|textarea|title)$/i,aye=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),ye=aye(1),H=aye(2),Qg=Symbol.for("lit-noChange"),Yn=Symbol.for("lit-nothing"),eye=new WeakMap,Yg=Jg.createTreeWalker(Jg,129);XWe=(e,t)=>{let r=e.length-1,n=[],o,s=t===2?"<svg>":"",i=sv;for(let a=0;a<r;a++){let c=e[a],l,u,d=-1,p=0;for(;p<c.length&&(i.lastIndex=p,u=i.exec(c),u!==null);)p=i.lastIndex,i===sv?u[1]==="!--"?i=Y2e:u[1]!==void 0?i=J2e:u[2]!==void 0?(iye.test(u[2])&&(o=RegExp("</"+u[2],"g")),i=Gg):u[3]!==void 0&&(i=Gg):i===Gg?u[0]===">"?(i=o??sv,d=-1):u[1]===void 0?d=-2:(d=i.lastIndex-u[2].length,l=u[1],i=u[3]===void 0?Gg:u[3]==='"'?X2e:Q2e):i===X2e||i===Q2e?i=Gg:i===Y2e||i===J2e?i=sv:(i=Gg,o=void 0);let f=i===Gg&&e[a+1].startsWith("/>")?" ":"";s+=i===sv?c+JWe:d>=0?(n.push(l),c.slice(0,d)+nye+c.slice(d)+um+f):c+um+(d===-2?a:f)}return[cye(e,s+(e[r]||"<?>")+(t===2?"</svg>":"")),n]},cv=class e{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let s=0,i=0,a=t.length-1,c=this.parts,[l,u]=XWe(t,r);if(this.el=e.createElement(l,n),Yg.currentNode=this.el.content,r===2){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Yg.nextNode())!==null&&c.length<a;){if(o.nodeType===1){if(o.hasAttributes())for(let d of o.getAttributeNames())if(d.endsWith(nye)){let p=u[i++],f=o.getAttribute(d).split(um),m=/([.?@])?(.*)/.exec(p);c.push({type:1,index:s,name:m[2],strings:f,ctor:m[1]==="."?EV:m[1]==="?"?AV:m[1]==="@"?CV:_6}),o.removeAttribute(d)}else d.startsWith(um)&&(c.push({type:6,index:s}),o.removeAttribute(d));if(iye.test(o.tagName)){let d=o.textContent.split(um),p=d.length-1;if(p>0){o.textContent=m7?m7.emptyScript:"";for(let f=0;f<p;f++)o.append(d[f],iv()),Yg.nextNode(),c.push({type:2,index:++s});o.append(d[p],iv())}}}else if(o.nodeType===8)if(o.data===oye)c.push({type:2,index:s});else{let d=-1;for(;(d=o.data.indexOf(um,d+1))!==-1;)c.push({type:7,index:s}),d+=um.length-1}s++}}static createElement(t,r){let n=Jg.createElement("template");return n.innerHTML=t,n}};vV=class{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var r;let{el:{content:n},parts:o}=this._$AD,s=((r=t?.creationScope)!=null?r:Jg).importNode(n,!0);Yg.currentNode=s;let i=Yg.nextNode(),a=0,c=0,l=o[0];for(;l!==void 0;){if(a===l.index){let u;l.type===2?u=new lv(i,i.nextSibling,this,t):l.type===1?u=new l.ctor(i,l.name,l.strings,this,t):l.type===6&&(u=new SV(i,this,t)),this._$AV.push(u),l=o[++c]}a!==l?.index&&(i=Yg.nextNode(),a++)}return Yg.currentNode=Jg,s}p(t){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}},lv=class e{get _$AU(){var t,r;return(r=(t=this._$AM)==null?void 0:t._$AU)!=null?r:this._$Cv}constructor(t,r,n,o){var s;this.type=2,this._$AH=Yn,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=o,this._$Cv=(s=o?.isConnected)!=null?s:!0}get parentNode(){let t=this._$AA.parentNode,r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=T6(this,t,r),av(t)?t===Yn||t==null||t===""?(this._$AH!==Yn&&this._$AR(),this._$AH=Yn):t!==this._$AH&&t!==Qg&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):QWe(t)?this.k(t):this._(t)}S(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.S(t))}_(t){this._$AH!==Yn&&av(this._$AH)?this._$AA.nextSibling.data=t:this.T(Jg.createTextNode(t)),this._$AH=t}$(t){var r;let{values:n,_$litType$:o}=t,s=typeof o=="number"?this._$AC(t):(o.el===void 0&&(o.el=cv.createElement(cye(o.h,o.h[0]),this.options)),o);if(((r=this._$AH)==null?void 0:r._$AD)===s)this._$AH.p(n);else{let i=new vV(s,this),a=i.u(this.options);i.p(n),this.T(a),this._$AH=i}}_$AC(t){let r=eye.get(t.strings);return r===void 0&&eye.set(t.strings,r=new cv(t)),r}k(t){sye(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,o=0;for(let s of t)o===r.length?r.push(n=new e(this.S(iv()),this.S(iv()),this,this.options)):n=r[o],n._$AI(s),o++;o<r.length&&(this._$AR(n&&n._$AB.nextSibling,o),r.length=o)}_$AR(t=this._$AA.nextSibling,r){var n;
633for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);t&&t!==this._$AB;){let o=t.nextSibling;t.remove(),t=o}}setConnected(t){var r;this._$AM===void 0&&(this._$Cv=t,(r=this._$AP)==null||r.call(this,t))}},_6=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,r,n,o,s){this.type=1,this._$AH=Yn,this._$AN=void 0,this.element=t,this.name=r,this._$AM=o,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=Yn}_$AI(t,r=this,n,o){let s=this.strings,i=!1;if(s===void 0)t=T6(this,t,r,0),i=!av(t)||t!==this._$AH&&t!==Qg,i&&(this._$AH=t);else{let a=t,c,l;for(t=s[0],c=0;c<s.length-1;c++)l=T6(this,a[n+c],r,c),l===Qg&&(l=this._$AH[c]),i||(i=!av(l)||l!==this._$AH[c]),l===Yn?t=Yn:t!==Yn&&(t+=(l??"")+s[c+1]),this._$AH[c]=l}i&&!o&&this.j(t)}j(t){t===Yn?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},EV=class extends _6{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Yn?void 0:t}},AV=class extends _6{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==Yn)}},CV=class extends _6{constructor(t,r,n,o,s){super(t,r,n,o,s),this.type=5}_$AI(t,r=this){var n;if((t=(n=T6(this,t,r,0))!=null?n:Yn)===Qg)return;let o=this._$AH,s=t===Yn&&o!==Yn||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,i=t!==Yn&&(o===Yn||s);s&&this.element.removeEventListener(this.name,this,o),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var r,n;typeof this._$AH=="function"?this._$AH.call((n=(r=this.options)==null?void 0:r.host)!=null?n:this.element,t):this._$AH.handleEvent(t)}},SV=class{constructor(t,r,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){T6(this,t)}},tye=h7.litHtmlPolyfillSupport;tye?.(cv,lv),((rye=h7.litHtmlVersions)!=null?rye:h7.litHtmlVersions=[]).push("3.1.4");lye=(e,t,r)=>{var n,o;let s=(n=r?.renderBefore)!=null?n:t,i=s._$litPart$;if(i===void 0){let a=(o=r?.renderBefore)!=null?o:null;s._$litPart$=i=new lv(t.insertBefore(iv(),a),a,void 0,r??{})}return i._$AI(e),i}});var fe,uye,dye,pye,tt=h(()=>{Ge();Ge();Je();Je();fe=class extends pf{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let n=super.createRenderRoot();return(r=(t=this.renderOptions).renderBefore)!=null||(t.renderBefore=n.firstChild),n}update(t){let r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=lye(r,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return Qg}};fe._$litElement$=!0,fe.finalized=!0,(uye=globalThis.litElementHydrateSupport)==null||uye.call(globalThis,{LitElement:fe});dye=globalThis.litElementPolyfillSupport;dye?.({LitElement:fe});((pye=globalThis.litElementVersions)!=null?pye:globalThis.litElementVersions=[]).push("4.0.6")});var we,rt=h(()=>{we=e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)}});function z(e){return(t,r)=>typeof r=="object"?cKe(e,t,r):((n,o,s)=>{let i=o.hasOwnProperty(s);return o.constructor.createProperty(s,i?iKe(sKe({},n),{wrapped:!0}):n),i?Object.getOwnPropertyDescriptor(o,s):void 0})(e,t,r)}var eKe,tKe,rKe,fye,nKe,oKe,hye,sKe,iKe,aKe,cKe,nt=h(()=>{Ge();eKe=Object.defineProperty,tKe=Object.defineProperties,rKe=Object.getOwnPropertyDescriptors,fye=Object.getOwnPropertySymbols,nKe=Object.prototype.hasOwnProperty,oKe=Object.prototype.propertyIsEnumerable,hye=(e,t,r)=>t in e?eKe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sKe=(e,t)=>{for(var r in t||(t={}))nKe.call(t,r)&&hye(e,r,t[r]);if(fye)for(var r of fye(t))oKe.call(t,r)&&hye(e,r,t[r]);return e},iKe=(e,t)=>tKe(e,rKe(t));aKe={attribute:!0,type:String,converter:I6,reflect:!1,hasChanged:ov},cKe=(e=aKe,t,r)=>{let{kind:n,metadata:o}=r,s=globalThis.litPropertyMetadata.get(o);if(s===void 0&&globalThis.litPropertyMetadata.set(o,s=new Map),s.set(r.name,e),n==="accessor"){let{name:i}=r;return{set(a){let c=t.get.call(this);t.set.call(this,a),this.requestUpdate(i,c,e)},init(a){return a!==void 0&&this.P(i,void 0,e),a}}}if(n==="setter"){let{name:i}=r;return function(a){let c=this[i];t.call(this,a),this.requestUpdate(i,c,e)}}throw Error("Unsupported decorator location: "+n)}});var mye={};Ce(mye,{PhArrowCircleDown:()=>wu});var lKe,uKe,uv,wu,gye=h(()=>{Ge();Je();tt();rt();nt();Ye();lKe=Object.defineProperty,uKe=Object.getOwnPropertyDescriptor,uv=(e,t,r,n)=>{for(var o=n>1?void 0:n?uKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&lKe(t,r,o),o},wu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
634      xmlns="http://www.w3.org/2000/svg"
635      width="${this.size}"
636      height="${this.size}"
637      fill="${this.color}"
638      viewBox="0 0 256 256"
639      transform=${this.mirrored?"scale(-1, 1)":null}
640    >
641      ${wu.weightsMap.get((e=this.weight)!=null?e:"regular")}
642    </svg>`}};wu.weightsMap=new Map([["thin",H`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm34.83-86.83a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L124,158.34V88a4,4,0,0,1,8,0v70.34l25.17-25.17A4,4,0,0,1,162.83,133.17Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm36.24-86.24a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L122,153.51V88a6,6,0,0,1,12,0v65.51l21.76-21.75A6,6,0,0,1,164.24,131.76Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-85.66a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L120,148.69V88a8,8,0,0,1,16,0v60.69l18.34-18.35A8,8,0,0,1,165.66,130.34Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm40.49-84.49a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L116,139V88a12,12,0,0,1,24,0v51l11.51-11.52A12,12,0,0,1,168.49,127.51Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm37.66,117.66-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L120,148.69V88a8,8,0,0,1,16,0v60.69l18.34-18.35a8,8,0,0,1,11.32,11.32Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm37.66-85.66a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L120,148.69V88a8,8,0,0,1,16,0v60.69l18.34-18.35A8,8,0,0,1,165.66,130.34Z"/>`]]);wu.styles=ge`
643    :host {
644      display: contents;
645    }
646  `;uv([z({type:String,reflect:!0})],wu.prototype,"size",2);uv([z({type:String,reflect:!0})],wu.prototype,"weight",2);uv([z({type:String,reflect:!0})],wu.prototype,"color",2);uv([z({type:Boolean,reflect:!0})],wu.prototype,"mirrored",2);wu=uv([we("ph-arrow-circle-down")],wu)});var yye={};Ce(yye,{PhArrowClockwise:()=>bu});var dKe,pKe,dv,bu,wye=h(()=>{Ge();Je();tt();rt();nt();Ye();dKe=Object.defineProperty,pKe=Object.getOwnPropertyDescriptor,dv=(e,t,r,n)=>{for(var o=n>1?void 0:n?pKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&dKe(t,r,o),o},bu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
647      xmlns="http://www.w3.org/2000/svg"
648      width="${this.size}"
649      height="${this.size}"
650      fill="${this.color}"
651      viewBox="0 0 256 256"
652      transform=${this.mirrored?"scale(-1, 1)":null}
653    >
654      ${bu.weightsMap.get((e=this.weight)!=null?e:"regular")}
655    </svg>`}};bu.weightsMap=new Map([["thin",H`<path d="M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z"/>`],["light",H`<path d="M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z"/>`],["regular",H`<path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/>`],["bold",H`<path d="M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z"/>`],["fill",H`<path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z"/>`],["duotone",H`<path d="M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z" opacity="0.2"/><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/>`]]);bu.styles=ge`
656    :host {
657      display: contents;
658    }
659  `;dv([z({type:String,reflect:!0})],bu.prototype,"size",2);dv([z({type:String,reflect:!0})],bu.prototype,"weight",2);dv([z({type:String,reflect:!0})],bu.prototype,"color",2);dv([z({type:Boolean,reflect:!0})],bu.prototype,"mirrored",2);bu=dv([we("ph-arrow-clockwise")],bu)});var bye={};Ce(bye,{PhArrowDown:()=>xu});var fKe,hKe,pv,xu,xye=h(()=>{Ge();Je();tt();rt();nt();Ye();fKe=Object.defineProperty,hKe=Object.getOwnPropertyDescriptor,pv=(e,t,r,n)=>{for(var o=n>1?void 0:n?hKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fKe(t,r,o),o},xu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
660      xmlns="http://www.w3.org/2000/svg"
661      width="${this.size}"
662      height="${this.size}"
663      fill="${this.color}"
664      viewBox="0 0 256 256"
665      transform=${this.mirrored?"scale(-1, 1)":null}
666    >
667      ${xu.weightsMap.get((e=this.weight)!=null?e:"regular")}
668    </svg>`}};xu.weightsMap=new Map([["thin",H`<path d="M202.83,146.83l-72,72a4,4,0,0,1-5.66,0l-72-72a4,4,0,0,1,5.66-5.66L124,206.34V40a4,4,0,0,1,8,0V206.34l65.17-65.17a4,4,0,0,1,5.66,5.66Z"/>`],["light",H`<path d="M204.24,148.24l-72,72a6,6,0,0,1-8.48,0l-72-72a6,6,0,0,1,8.48-8.48L122,201.51V40a6,6,0,0,1,12,0V201.51l61.76-61.75a6,6,0,0,1,8.48,8.48Z"/>`],["regular",H`<path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/>`],["bold",H`<path d="M208.49,152.49l-72,72a12,12,0,0,1-17,0l-72-72a12,12,0,0,1,17-17L116,187V40a12,12,0,0,1,24,0V187l51.51-51.52a12,12,0,0,1,17,17Z"/>`],["fill",H`<path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,56,136h64V40a8,8,0,0,1,16,0v96h64a8,8,0,0,1,5.66,13.66Z"/>`],["duotone",H`<path d="M200,144l-72,72L56,144Z" opacity="0.2"/><path d="M207.39,140.94A8,8,0,0,0,200,136H136V40a8,8,0,0,0-16,0v96H56a8,8,0,0,0-5.66,13.66l72,72a8,8,0,0,0,11.32,0l72-72A8,8,0,0,0,207.39,140.94ZM128,204.69,75.31,152H180.69Z"/>`]]);xu.styles=ge`
669    :host {
670      display: contents;
671    }
672  `;pv([z({type:String,reflect:!0})],xu.prototype,"size",2);pv([z({type:String,reflect:!0})],xu.prototype,"weight",2);pv([z({type:String,reflect:!0})],xu.prototype,"color",2);pv([z({type:Boolean,reflect:!0})],xu.prototype,"mirrored",2);xu=pv([we("ph-arrow-down")],xu)});var vye={};Ce(vye,{PhArrowLeft:()=>vu});var mKe,gKe,fv,vu,Eye=h(()=>{Ge();Je();tt();rt();nt();Ye();mKe=Object.defineProperty,gKe=Object.getOwnPropertyDescriptor,fv=(e,t,r,n)=>{for(var o=n>1?void 0:n?gKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mKe(t,r,o),o},vu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
673      xmlns="http://www.w3.org/2000/svg"
674      width="${this.size}"
675      height="${this.size}"
676      fill="${this.color}"
677      viewBox="0 0 256 256"
678      transform=${this.mirrored?"scale(-1, 1)":null}
679    >
680      ${vu.weightsMap.get((e=this.weight)!=null?e:"regular")}
681    </svg>`}};vu.weightsMap=new Map([["thin",H`<path d="M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z"/>`],["light",H`<path d="M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z"/>`],["regular",H`<path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/>`],["bold",H`<path d="M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z"/>`],["fill",H`<path d="M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z"/>`],["duotone",H`<path d="M112,56V200L40,128Z" opacity="0.2"/><path d="M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z"/>`]]);vu.styles=ge`
682    :host {
683      display: contents;
684    }
685  `;fv([z({type:String,reflect:!0})],vu.prototype,"size",2);fv([z({type:String,reflect:!0})],vu.prototype,"weight",2);fv([z({type:String,reflect:!0})],vu.prototype,"color",2);fv([z({type:Boolean,reflect:!0})],vu.prototype,"mirrored",2);vu=fv([we("ph-arrow-left")],vu)});var Aye={};Ce(Aye,{PhArrowRight:()=>Eu});var yKe,wKe,hv,Eu,Cye=h(()=>{Ge();Je();tt();rt();nt();Ye();yKe=Object.defineProperty,wKe=Object.getOwnPropertyDescriptor,hv=(e,t,r,n)=>{for(var o=n>1?void 0:n?wKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yKe(t,r,o),o},Eu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
686      xmlns="http://www.w3.org/2000/svg"
687      width="${this.size}"
688      height="${this.size}"
689      fill="${this.color}"
690      viewBox="0 0 256 256"
691      transform=${this.mirrored?"scale(-1, 1)":null}
692    >
693      ${Eu.weightsMap.get((e=this.weight)!=null?e:"regular")}
694    </svg>`}};Eu.weightsMap=new Map([["thin",H`<path d="M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"/>`],["light",H`<path d="M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"/>`],["regular",H`<path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/>`],["bold",H`<path d="M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"/>`],["fill",H`<path d="M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"/>`],["duotone",H`<path d="M216,128l-72,72V56Z" opacity="0.2"/><path d="M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"/>`]]);Eu.styles=ge`
695    :host {
696      display: contents;
697    }
698  `;hv([z({type:String,reflect:!0})],Eu.prototype,"size",2);hv([z({type:String,reflect:!0})],Eu.prototype,"weight",2);hv([z({type:String,reflect:!0})],Eu.prototype,"color",2);hv([z({type:Boolean,reflect:!0})],Eu.prototype,"mirrored",2);Eu=hv([we("ph-arrow-right")],Eu)});var Sye={};Ce(Sye,{PhArrowSquareOut:()=>Au});var bKe,xKe,mv,Au,Iye=h(()=>{Ge();Je();tt();rt();nt();Ye();bKe=Object.defineProperty,xKe=Object.getOwnPropertyDescriptor,mv=(e,t,r,n)=>{for(var o=n>1?void 0:n?xKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&bKe(t,r,o),o},Au=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
699      xmlns="http://www.w3.org/2000/svg"
700      width="${this.size}"
701      height="${this.size}"
702      fill="${this.color}"
703      viewBox="0 0 256 256"
704      transform=${this.mirrored?"scale(-1, 1)":null}
705    >
706      ${Au.weightsMap.get((e=this.weight)!=null?e:"regular")}
707    </svg>`}};Au.weightsMap=new Map([["thin",H`<path d="M220,104a4,4,0,0,1-8,0V49.66l-73.16,73.17a4,4,0,0,1-5.66-5.66L206.34,44H152a4,4,0,0,1,0-8h64a4,4,0,0,1,4,4Zm-36,28a4,4,0,0,0-4,4v72a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V80a4,4,0,0,1,4-4h72a4,4,0,0,0,0-8H48A12,12,0,0,0,36,80V208a12,12,0,0,0,12,12H176a12,12,0,0,0,12-12V136A4,4,0,0,0,184,132Z"/>`],["light",H`<path d="M222,104a6,6,0,0,1-12,0V54.49l-69.75,69.75a6,6,0,0,1-8.48-8.48L201.51,46H152a6,6,0,0,1,0-12h64a6,6,0,0,1,6,6Zm-38,26a6,6,0,0,0-6,6v72a2,2,0,0,1-2,2H48a2,2,0,0,1-2-2V80a2,2,0,0,1,2-2h72a6,6,0,0,0,0-12H48A14,14,0,0,0,34,80V208a14,14,0,0,0,14,14H176a14,14,0,0,0,14-14V136A6,6,0,0,0,184,130Z"/>`],["regular",H`<path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/>`],["bold",H`<path d="M228,104a12,12,0,0,1-24,0V69l-59.51,59.51a12,12,0,0,1-17-17L187,52H152a12,12,0,0,1,0-24h64a12,12,0,0,1,12,12Zm-44,24a12,12,0,0,0-12,12v64H52V84h64a12,12,0,0,0,0-24H48A20,20,0,0,0,28,80V208a20,20,0,0,0,20,20H176a20,20,0,0,0,20-20V140A12,12,0,0,0,184,128Z"/>`],["fill",H`<path d="M192,136v72a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V80A16,16,0,0,1,48,64h72a8,8,0,0,1,0,16H48V208H176V136a8,8,0,0,1,16,0Zm32-96a8,8,0,0,0-8-8H152a8,8,0,0,0-5.66,13.66L172.69,72l-42.35,42.34a8,8,0,0,0,11.32,11.32L184,83.31l26.34,26.35A8,8,0,0,0,224,104Z"/>`],["duotone",H`<path d="M184,80V208a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H176A8,8,0,0,1,184,80Z" opacity="0.2"/><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/>`]]);Au.styles=ge`
708    :host {
709      display: contents;
710    }
711  `;mv([z({type:String,reflect:!0})],Au.prototype,"size",2);mv([z({type:String,reflect:!0})],Au.prototype,"weight",2);mv([z({type:String,reflect:!0})],Au.prototype,"color",2);mv([z({type:Boolean,reflect:!0})],Au.prototype,"mirrored",2);Au=mv([we("ph-arrow-square-out")],Au)});var Tye={};Ce(Tye,{PhArrowsDownUp:()=>Cu});var vKe,EKe,gv,Cu,_ye=h(()=>{Ge();Je();tt();rt();nt();Ye();vKe=Object.defineProperty,EKe=Object.getOwnPropertyDescriptor,gv=(e,t,r,n)=>{for(var o=n>1?void 0:n?EKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&vKe(t,r,o),o},Cu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
712      xmlns="http://www.w3.org/2000/svg"
713      width="${this.size}"
714      height="${this.size}"
715      fill="${this.color}"
716      viewBox="0 0 256 256"
717      transform=${this.mirrored?"scale(-1, 1)":null}
718    >
719      ${Cu.weightsMap.get((e=this.weight)!=null?e:"regular")}
720    </svg>`}};Cu.weightsMap=new Map([["thin",H`<path d="M114.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66,0l-32-32a4,4,0,0,1,5.66-5.66L76,198.34V48a4,4,0,0,1,8,0V198.34l25.17-25.17A4,4,0,0,1,114.83,173.17Zm96-96-32-32a4,4,0,0,0-5.66,0l-32,32a4,4,0,0,0,5.66,5.66L172,57.66V208a4,4,0,0,0,8,0V57.66l25.17,25.17a4,4,0,1,0,5.66-5.66Z"/>`],["light",H`<path d="M116.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48,0l-32-32a6,6,0,0,1,8.48-8.48L74,193.51V48a6,6,0,0,1,12,0V193.51l21.76-21.75A6,6,0,0,1,116.24,171.76Zm96-96-32-32a6,6,0,0,0-8.48,0l-32,32a6,6,0,0,0,8.48,8.48L170,62.49V208a6,6,0,0,0,12,0V62.49l21.76,21.75a6,6,0,0,0,8.48-8.48Z"/>`],["regular",H`<path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/>`],["bold",H`<path d="M120.49,167.51a12,12,0,0,1,0,17l-32,32a12,12,0,0,1-17,0l-32-32a12,12,0,1,1,17-17L68,179V48a12,12,0,0,1,24,0V179l11.51-11.52A12,12,0,0,1,120.49,167.51Zm96-96-32-32a12,12,0,0,0-17,0l-32,32a12,12,0,0,0,17,17L164,77V208a12,12,0,0,0,24,0V77l11.51,11.52a12,12,0,0,0,17-17Z"/>`],["fill",H`<path d="M119.39,172.94a8,8,0,0,1-1.73,8.72l-32,32a8,8,0,0,1-11.32,0l-32-32A8,8,0,0,1,48,168H72V48a8,8,0,0,1,16,0V168h24A8,8,0,0,1,119.39,172.94Zm94.27-98.6-32-32a8,8,0,0,0-11.32,0l-32,32A8,8,0,0,0,144,88h24V208a8,8,0,0,0,16,0V88h24a8,8,0,0,0,5.66-13.66Z"/>`],["duotone",H`<path d="M176,48V208H80V48Z" opacity="0.2"/><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/>`]]);Cu.styles=ge`
721    :host {
722      display: contents;
723    }
724  `;gv([z({type:String,reflect:!0})],Cu.prototype,"size",2);gv([z({type:String,reflect:!0})],Cu.prototype,"weight",2);gv([z({type:String,reflect:!0})],Cu.prototype,"color",2);gv([z({type:Boolean,reflect:!0})],Cu.prototype,"mirrored",2);Cu=gv([we("ph-arrows-down-up")],Cu)});var Pye={};Ce(Pye,{PhArrowsLeftRight:()=>Su});var AKe,CKe,yv,Su,Nye=h(()=>{Ge();Je();tt();rt();nt();Ye();AKe=Object.defineProperty,CKe=Object.getOwnPropertyDescriptor,yv=(e,t,r,n)=>{for(var o=n>1?void 0:n?CKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&AKe(t,r,o),o},Su=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
725      xmlns="http://www.w3.org/2000/svg"
726      width="${this.size}"
727      height="${this.size}"
728      fill="${this.color}"
729      viewBox="0 0 256 256"
730      transform=${this.mirrored?"scale(-1, 1)":null}
731    >
732      ${Su.weightsMap.get((e=this.weight)!=null?e:"regular")}
733    </svg>`}};Su.weightsMap=new Map([["thin",H`<path d="M210.83,173.17a4,4,0,0,1,0,5.66l-32,32a4,4,0,0,1-5.66-5.66L198.34,180H48a4,4,0,0,1,0-8H198.34l-25.17-25.17a4,4,0,0,1,5.66-5.66ZM77.17,114.83a4,4,0,0,0,5.66-5.66L57.66,84H208a4,4,0,0,0,0-8H57.66L82.83,50.83a4,4,0,0,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66Z"/>`],["light",H`<path d="M212.24,171.76a6,6,0,0,1,0,8.48l-32,32a6,6,0,0,1-8.48-8.48L193.51,182H48a6,6,0,0,1,0-12H193.51l-21.75-21.76a6,6,0,0,1,8.48-8.48ZM75.76,116.24a6,6,0,0,0,8.48-8.48L62.49,86H208a6,6,0,0,0,0-12H62.49L84.24,52.24a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48Z"/>`],["regular",H`<path d="M213.66,181.66l-32,32a8,8,0,0,1-11.32-11.32L188.69,184H48a8,8,0,0,1,0-16H188.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,213.66,181.66Zm-139.32-64a8,8,0,0,0,11.32-11.32L67.31,88H208a8,8,0,0,0,0-16H67.31L85.66,53.66A8,8,0,0,0,74.34,42.34l-32,32a8,8,0,0,0,0,11.32Z"/>`],["bold",H`<path d="M216.49,184.49l-32,32a12,12,0,0,1-17-17L179,188H48a12,12,0,0,1,0-24H179l-11.52-11.51a12,12,0,0,1,17-17l32,32A12,12,0,0,1,216.49,184.49Zm-145-64a12,12,0,0,0,17-17L77,92H208a12,12,0,0,0,0-24H77L88.49,56.49a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17Z"/>`],["fill",H`<path d="M42.34,85.66a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,88,48V72H208a8,8,0,0,1,0,16H88v24a8,8,0,0,1-13.66,5.66Zm171.32,84.68-32-32A8,8,0,0,0,168,144v24H48a8,8,0,0,0,0,16H168v24a8,8,0,0,0,13.66,5.66l32-32A8,8,0,0,0,213.66,170.34Z"/>`],["duotone",H`<path d="M208,80v96H48V80Z" opacity="0.2"/><path d="M213.66,181.66l-32,32a8,8,0,0,1-11.32-11.32L188.69,184H48a8,8,0,0,1,0-16H188.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,213.66,181.66Zm-139.32-64a8,8,0,0,0,11.32-11.32L67.31,88H208a8,8,0,0,0,0-16H67.31L85.66,53.66A8,8,0,0,0,74.34,42.34l-32,32a8,8,0,0,0,0,11.32Z"/>`]]);Su.styles=ge`
734    :host {
735      display: contents;
736    }
737  `;yv([z({type:String,reflect:!0})],Su.prototype,"size",2);yv([z({type:String,reflect:!0})],Su.prototype,"weight",2);yv([z({type:String,reflect:!0})],Su.prototype,"color",2);yv([z({type:Boolean,reflect:!0})],Su.prototype,"mirrored",2);Su=yv([we("ph-arrows-left-right")],Su)});var Rye={};Ce(Rye,{PhArrowUp:()=>Iu});var SKe,IKe,wv,Iu,Oye=h(()=>{Ge();Je();tt();rt();nt();Ye();
737SKe=Object.defineProperty,IKe=Object.getOwnPropertyDescriptor,wv=(e,t,r,n)=>{for(var o=n>1?void 0:n?IKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&SKe(t,r,o),o},Iu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
738      xmlns="http://www.w3.org/2000/svg"
739      width="${this.size}"
740      height="${this.size}"
741      fill="${this.color}"
742      viewBox="0 0 256 256"
743      transform=${this.mirrored?"scale(-1, 1)":null}
744    >
745      ${Iu.weightsMap.get((e=this.weight)!=null?e:"regular")}
746    </svg>`}};Iu.weightsMap=new Map([["thin",H`<path d="M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"/>`],["light",H`<path d="M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"/>`],["regular",H`<path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/>`],["bold",H`<path d="M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"/>`],["fill",H`<path d="M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"/>`],["duotone",H`<path d="M200,112H56l72-72Z" opacity="0.2"/><path d="M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"/>`]]);Iu.styles=ge`
747    :host {
748      display: contents;
749    }
750  `;wv([z({type:String,reflect:!0})],Iu.prototype,"size",2);wv([z({type:String,reflect:!0})],Iu.prototype,"weight",2);wv([z({type:String,reflect:!0})],Iu.prototype,"color",2);wv([z({type:Boolean,reflect:!0})],Iu.prototype,"mirrored",2);Iu=wv([we("ph-arrow-up")],Iu)});var Bye={};Ce(Bye,{PhArrowUpRight:()=>Tu});var TKe,_Ke,bv,Tu,kye=h(()=>{Ge();Je();tt();rt();nt();Ye();TKe=Object.defineProperty,_Ke=Object.getOwnPropertyDescriptor,bv=(e,t,r,n)=>{for(var o=n>1?void 0:n?_Ke(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&TKe(t,r,o),o},Tu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
751      xmlns="http://www.w3.org/2000/svg"
752      width="${this.size}"
753      height="${this.size}"
754      fill="${this.color}"
755      viewBox="0 0 256 256"
756      transform=${this.mirrored?"scale(-1, 1)":null}
757    >
758      ${Tu.weightsMap.get((e=this.weight)!=null?e:"regular")}
759    </svg>`}};Tu.weightsMap=new Map([["thin",H`<path d="M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z"/>`],["light",H`<path d="M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z"/>`],["regular",H`<path d="M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z"/>`],["bold",H`<path d="M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z"/>`],["fill",H`<path d="M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z"/>`],["duotone",H`<path d="M192,64V168L88,64Z" opacity="0.2"/><path d="M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z"/>`]]);Tu.styles=ge`
760    :host {
761      display: contents;
762    }
763  `;bv([z({type:String,reflect:!0})],Tu.prototype,"size",2);bv([z({type:String,reflect:!0})],Tu.prototype,"weight",2);bv([z({type:String,reflect:!0})],Tu.prototype,"color",2);bv([z({type:Boolean,reflect:!0})],Tu.prototype,"mirrored",2);Tu=bv([we("ph-arrow-up-right")],Tu)});var Dye={};Ce(Dye,{PhArrowsClockwise:()=>_u});var PKe,NKe,xv,_u,Uye=h(()=>{Ge();Je();tt();rt();nt();Ye();PKe=Object.defineProperty,NKe=Object.getOwnPropertyDescriptor,xv=(e,t,r,n)=>{for(var o=n>1?void 0:n?NKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&PKe(t,r,o),o},_u=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
764      xmlns="http://www.w3.org/2000/svg"
765      width="${this.size}"
766      height="${this.size}"
767      fill="${this.color}"
768      viewBox="0 0 256 256"
769      transform=${this.mirrored?"scale(-1, 1)":null}
770    >
771      ${_u.weightsMap.get((e=this.weight)!=null?e:"regular")}
772    </svg>`}};_u.weightsMap=new Map([["thin",H`<path d="M220,48V96a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h38.34L184.89,70.54A84,84,0,0,0,66.8,69.85a4,4,0,1,1-5.6-5.72,92,92,0,0,1,129.34.76L212,86.34V48a4,4,0,0,1,8,0ZM189.2,186.15a83.44,83.44,0,0,1-58.68,23.91h-.47a83.52,83.52,0,0,1-58.94-24.6L49.66,164H88a4,4,0,0,0,0-8H40a4,4,0,0,0-4,4v48a4,4,0,0,0,8,0V169.66l21.46,21.45A91.43,91.43,0,0,0,130,218.06h.51a91.45,91.45,0,0,0,64.28-26.19,4,4,0,1,0-5.6-5.72Z"/>`],["light",H`<path d="M222,48V96a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h33.52L183.47,72a81.51,81.51,0,0,0-57.53-24h-.46A81.5,81.5,0,0,0,68.19,71.28a6,6,0,1,1-8.38-8.58,93.38,93.38,0,0,1,65.67-26.76H126a93.45,93.45,0,0,1,66,27.53l18,18V48a6,6,0,0,1,12,0ZM187.81,184.72a81.5,81.5,0,0,1-57.29,23.34h-.46a81.51,81.51,0,0,1-57.53-24L54.48,166H88a6,6,0,0,0,0-12H40a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V174.48l18,18.05a93.45,93.45,0,0,0,66,27.53h.52a93.38,93.38,0,0,0,65.67-26.76,6,6,0,1,0-8.38-8.58Z"/>`],["regular",H`<path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"/>`],["bold",H`<path d="M228,48V96a12,12,0,0,1-12,12H168a12,12,0,0,1,0-24h19l-7.8-7.8a75.55,75.55,0,0,0-53.32-22.26h-.43A75.49,75.49,0,0,0,72.39,75.57,12,12,0,1,1,55.61,58.41a99.38,99.38,0,0,1,69.87-28.47H126A99.42,99.42,0,0,1,196.2,59.23L204,67V48a12,12,0,0,1,24,0ZM183.61,180.43a75.49,75.49,0,0,1-53.09,21.63h-.43A75.55,75.55,0,0,1,76.77,179.8L69,172H88a12,12,0,0,0,0-24H40a12,12,0,0,0-12,12v48a12,12,0,0,0,24,0V189l7.8,7.8A99.42,99.42,0,0,0,130,226.06h.56a99.38,99.38,0,0,0,69.87-28.47,12,12,0,0,0-16.78-17.16Z"/>`],["fill",H`<path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L180.65,72a79.48,79.48,0,0,0-54.72-22.09h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27,96,96,0,0,1,192,60.7l18.36-18.36A8,8,0,0,1,224,48ZM186.41,183.29A80,80,0,0,1,75.35,184l18.31-18.31A8,8,0,0,0,88,152H40a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66L64,195.3a95.42,95.42,0,0,0,66,26.76h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"/>`],["duotone",H`<path d="M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z" opacity="0.2"/><path d="M224,48V96a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h28.69L182.06,73.37a79.56,79.56,0,0,0-56.13-23.43h-.45A79.52,79.52,0,0,0,69.59,72.71,8,8,0,0,1,58.41,61.27a96,96,0,0,1,135,.79L208,76.69V48a8,8,0,0,1,16,0ZM186.41,183.29a80,80,0,0,1-112.47-.66L59.31,168H88a8,8,0,0,0,0-16H40a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V179.31l14.63,14.63A95.43,95.43,0,0,0,130,222.06h.53a95.36,95.36,0,0,0,67.07-27.33,8,8,0,0,0-11.18-11.44Z"/>`]]);_u.styles=ge`
773    :host {
774      display: contents;
775    }
776  `;xv([z({type:String,reflect:!0})],_u.prototype,"size",2);xv([z({type:String,reflect:!0})],_u.prototype,"weight",2);xv([z({type:String,reflect:!0})],_u.prototype,"color",2);xv([z({type:Boolean,reflect:!0})],_u.prototype,"mirrored",2);_u=xv([we("ph-arrows-clockwise")],_u)});var Lye={};Ce(Lye,{PhBank:()=>Pu});var RKe,OKe,vv,Pu,Mye=h(()=>{Ge();Je();tt();rt();nt();Ye();RKe=Object.defineProperty,OKe=Object.getOwnPropertyDescriptor,vv=(e,t,r,n)=>{for(var o=n>1?void 0:n?OKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&RKe(t,r,o),o},Pu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
777      xmlns="http://www.w3.org/2000/svg"
778      width="${this.size}"
779      height="${this.size}"
780      fill="${this.color}"
781      viewBox="0 0 256 256"
782      transform=${this.mirrored?"scale(-1, 1)":null}
783    >
784      ${Pu.weightsMap.get((e=this.weight)!=null?e:"regular")}
785    </svg>`}};Pu.weightsMap=new Map([["thin",H`<path d="M24,100H52v72H32a4,4,0,0,0,0,8H224a4,4,0,0,0,0-8H204V100h28a4,4,0,0,0,2.1-7.41l-104-64a4,4,0,0,0-4.2,0l-104,64A4,4,0,0,0,24,100Zm36,0h40v72H60Zm88,0v72H108V100Zm48,72H156V100h40ZM128,36.7,217.87,92H38.13ZM244,208a4,4,0,0,1-4,4H16a4,4,0,0,1,0-8H240A4,4,0,0,1,244,208Z"/>`],["light",H`<path d="M24,102H50v68H32a6,6,0,0,0,0,12H224a6,6,0,0,0,0-12H206V102h26a6,6,0,0,0,3.14-11.11l-104-64a6,6,0,0,0-6.28,0l-104,64A6,6,0,0,0,24,102Zm38,0H98v68H62Zm84,0v68H110V102Zm48,68H158V102h36ZM128,39l82.8,51H45.2ZM246,208a6,6,0,0,1-6,6H16a6,6,0,0,1,0-12H240A6,6,0,0,1,246,208Z"/>`],["regular",H`<path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/>`],["bold",H`<path d="M24,108H44v48H32a12,12,0,0,0,0,24H224a12,12,0,0,0,0-24H212V108h20a12,12,0,0,0,6.29-22.22l-104-64a12,12,0,0,0-12.58,0l-104,64A12,12,0,0,0,24,108Zm44,0H92v48H68Zm72,0v48H116V108Zm48,48H164V108h24ZM128,46.09,189.6,84H66.4ZM252,208a12,12,0,0,1-12,12H16a12,12,0,0,1,0-24H240A12,12,0,0,1,252,208Z"/>`],["fill",H`<path d="M248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208ZM16.3,98.18a8,8,0,0,1,3.51-9l104-64a8,8,0,0,1,8.38,0l104,64A8,8,0,0,1,232,104H208v64h16a8,8,0,0,1,0,16H32a8,8,0,0,1,0-16H48V104H24A8,8,0,0,1,16.3,98.18ZM144,160a8,8,0,0,0,16,0V112a8,8,0,0,0-16,0Zm-48,0a8,8,0,0,0,16,0V112a8,8,0,0,0-16,0Z"/>`],["duotone",H`<path d="M232,96H24L128,32Z" opacity="0.2"/><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/>`]]);Pu.styles=ge`
786    :host {
787      display: contents;
788    }
789  `;vv([z({type:String,reflect:!0})],Pu.prototype,"size",2);vv([z({type:String,reflect:!0})],Pu.prototype,"weight",2);vv([z({type:String,reflect:!0})],Pu.prototype,"color",2);vv([z({type:Boolean,reflect:!0})],Pu.prototype,"mirrored",2);Pu=vv([we("ph-bank")],Pu)});var Hye={};Ce(Hye,{PhBrowser:()=>Nu});var BKe,kKe,Ev,Nu,$ye=h(()=>{Ge();Je();tt();rt();nt();Ye();BKe=Object.defineProperty,kKe=Object.getOwnPropertyDescriptor,Ev=(e,t,r,n)=>{for(var o=n>1?void 0:n?kKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&BKe(t,r,o),o},Nu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
790      xmlns="http://www.w3.org/2000/svg"
791      width="${this.size}"
792      height="${this.size}"
793      fill="${this.color}"
794      viewBox="0 0 256 256"
795      transform=${this.mirrored?"scale(-1, 1)":null}
796    >
797      ${Nu.weightsMap.get((e=this.weight)!=null?e:"regular")}
798    </svg>`}};Nu.weightsMap=new Map([["thin",H`<path d="M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V92H36V56A4,4,0,0,1,40,52ZM216,204H40a4,4,0,0,1-4-4V100H220V200A4,4,0,0,1,216,204Z"/>`],["light",H`<path d="M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V90H38V56A2,2,0,0,1,40,54ZM216,202H40a2,2,0,0,1-2-2V102H218v98A2,2,0,0,1,216,202Z"/>`],["regular",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Zm0,144H40V104H216v96Z"/>`],["bold",H`<path d="M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36Zm-4,24V84H44V60ZM44,196V108H212v88Z"/>`],["fill",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Z"/>`],["duotone",H`<path d="M224,56V96H32V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z" opacity="0.2"/><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V88H40V56Zm0,144H40V104H216v96Z"/>`]]);Nu.styles=ge`
799    :host {
800      display: contents;
801    }
802  `;Ev([z({type:String,reflect:!0})],Nu.prototype,"size",2);Ev([z({type:String,reflect:!0})],Nu.prototype,"weight",2);Ev([z({type:String,reflect:!0})],Nu.prototype,"color",2);Ev([z({type:Boolean,reflect:!0})],Nu.prototype,"mirrored",2);Nu=Ev([we("ph-browser")],Nu)});var Fye={};Ce(Fye,{PhCaretDown:()=>Ru});var DKe,UKe,Av,Ru,Vye=h(()=>{Ge();Je();tt();rt();nt();Ye();DKe=Object.defineProperty,UKe=Object.getOwnPropertyDescriptor,Av=(e,t,r,n)=>{for(var o=n>1?void 0:n?UKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&DKe(t,r,o),o},Ru=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
803      xmlns="http://www.w3.org/2000/svg"
804      width="${this.size}"
805      height="${this.size}"
806      fill="${this.color}"
807      viewBox="0 0 256 256"
808      transform=${this.mirrored?"scale(-1, 1)":null}
809    >
810      ${Ru.weightsMap.get((e=this.weight)!=null?e:"regular")}
811    </svg>`}};Ru.weightsMap=new Map([["thin",H`<path d="M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z"/>`],["light",H`<path d="M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z"/>`],["regular",H`<path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/>`],["bold",H`<path d="M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z"/>`],["fill",H`<path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z"/>`],["duotone",H`<path d="M208,96l-80,80L48,96Z" opacity="0.2"/><path d="M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z"/>`]]);Ru.styles=ge`
812    :host {
813      display: contents;
814    }
815  `;Av([z({type:String,reflect:!0})],Ru.prototype,"size",2);Av([z({type:String,reflect:!0})],Ru.prototype,"weight",2);Av([z({type:String,reflect:!0})],Ru.prototype,"color",2);Av([z({type:Boolean,reflect:!0})],Ru.prototype,"mirrored",2);Ru=Av([we("ph-caret-down")],Ru)});var zye={};Ce(zye,{PhCaretLeft:()=>Ou});var LKe,MKe,Cv,Ou,jye=h(()=>{Ge();Je();tt();rt();nt();Ye();LKe=Object.defineProperty,MKe=Object.getOwnPropertyDescriptor,Cv=(e,t,r,n)=>{for(var o=n>1?void 0:n?MKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&LKe(t,r,o),o},Ou=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
816      xmlns="http://www.w3.org/2000/svg"
817      width="${this.size}"
818      height="${this.size}"
819      fill="${this.color}"
820      viewBox="0 0 256 256"
821      transform=${this.mirrored?"scale(-1, 1)":null}
822    >
823      ${Ou.weightsMap.get((e=this.weight)!=null?e:"regular")}
824    </svg>`}};Ou.weightsMap=new Map([["thin",H`<path d="M162.83,205.17a4,4,0,0,1-5.66,5.66l-80-80a4,4,0,0,1,0-5.66l80-80a4,4,0,1,1,5.66,5.66L85.66,128Z"/>`],["light",H`<path d="M164.24,203.76a6,6,0,1,1-8.48,8.48l-80-80a6,6,0,0,1,0-8.48l80-80a6,6,0,0,1,8.48,8.48L88.49,128Z"/>`],["regular",H`<path d="M165.66,202.34a8,8,0,0,1-11.32,11.32l-80-80a8,8,0,0,1,0-11.32l80-80a8,8,0,0,1,11.32,11.32L91.31,128Z"/>`],["bold",H`<path d="M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"/>`],["fill",H`<path d="M168,48V208a8,8,0,0,1-13.66,5.66l-80-80a8,8,0,0,1,0-11.32l80-80A8,8,0,0,1,168,48Z"/>`],["duotone",H`<path d="M160,48V208L80,128Z" opacity="0.2"/><path d="M163.06,40.61a8,8,0,0,0-8.72,1.73l-80,80a8,8,0,0,0,0,11.32l80,80A8,8,0,0,0,168,208V48A8,8,0,0,0,163.06,40.61ZM152,188.69,91.31,128,152,67.31Z"/>`]]);Ou.styles=ge`
825    :host {
826      display: contents;
827    }
828  `;Cv([z({type:String,reflect:!0})],Ou.prototype,"size",2);Cv([z({type:String,reflect:!0})],Ou.prototype,"weight",2);Cv([z({type:String,reflect:!0})],Ou.prototype,"color",2);Cv([z({type:Boolean,reflect:!0})],Ou.prototype,"mirrored",2);Ou=Cv([we("ph-caret-left")],Ou)});var qye={};Ce(qye,{PhCaretRight:()=>Bu});var HKe,$Ke,Sv,Bu,Wye=h(()=>{Ge();Je();tt();rt();nt();Ye();HKe=Object.defineProperty,$Ke=Object.getOwnPropertyDescriptor,Sv=(e,t,r,n)=>{for(var o=n>1?void 0:n?$Ke(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&HKe(t,r,o),o},Bu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
829      xmlns="http://www.w3.org/2000/svg"
830      width="${this.size}"
831      height="${this.size}"
832      fill="${this.color}"
833      viewBox="0 0 256 256"
834      transform=${this.mirrored?"scale(-1, 1)":null}
835    >
836      ${Bu.weightsMap.get((e=this.weight)!=null?e:"regular")}
837    </svg>`}};Bu.weightsMap=new Map([["thin",H`<path d="M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z"/>`],["light",H`<path d="M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z"/>`],["regular",H`<path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/>`],["bold",H`<path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"/>`],["fill",H`<path d="M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z"/>`],["duotone",H`<path d="M176,128,96,208V48Z" opacity="0.2"/><path d="M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z"/>`]]);Bu.styles=ge`
838    :host {
839      display: contents;
840    }
841  `;Sv([z({type:String,reflect:!0})],Bu.prototype,"size",2);Sv([z({type:String,reflect:!0})],Bu.prototype,"weight",2);Sv([z({type:String,reflect:!0})],Bu.prototype,"color",2);Sv([z({type:Boolean,reflect:!0})],Bu.prototype,"mirrored",2);Bu=Sv([we("ph-caret-right")],Bu)});var Kye={};Ce(Kye,{PhCaretUp:()=>ku});var FKe,VKe,Iv,ku,Zye=h(()=>{Ge();Je();tt();rt();nt();Ye();FKe=Object.defineProperty,VKe=Object.getOwnPropertyDescriptor,Iv=(e,t,r,n)=>{for(var o=n>1?void 0:n?VKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&FKe(t,r,o),o},ku=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
842      xmlns="http://www.w3.org/2000/svg"
843      width="${this.size}"
844      height="${this.size}"
845      fill="${this.color}"
846      viewBox="0 0 256 256"
847      transform=${this.mirrored?"scale(-1, 1)":null}
848    >
849      ${ku.weightsMap.get((e=this.weight)!=null?e:"regular")}
850    </svg>`}};ku.weightsMap=new Map([["thin",H`<path d="M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z"/>`],["light",H`<path d="M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z"/>`],["regular",H`<path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/>`],["bold",H`<path d="M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"/>`],["fill",H`<path d="M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z"/>`],["duotone",H`<path d="M208,160H48l80-80Z" opacity="0.2"/><path d="M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z"/>`]]);ku.styles=ge`
851    :host {
852      display: contents;
853    }
854  `;Iv([z({type:String,reflect:!0})],ku.prototype,"size",2);Iv([z({type:String,reflect:!0})],ku.prototype,"weight",2);Iv([z({type:String,reflect:!0})],ku.prototype,"color",2);Iv([z({type:Boolean,reflect:!0})],ku.prototype,"mirrored",2);ku=Iv([we("ph-caret-up")],ku)});var Gye={};Ce(Gye,{PhCheck:()=>Du});var zKe,jKe,Tv,Du,Yye=h(()=>{Ge();Je();tt();rt();nt();Ye();zKe=Object.defineProperty,jKe=Object.getOwnPropertyDescriptor,Tv=(e,t,r,n)=>{for(var o=n>1?void 0:n?jKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&zKe(t,r,o),o},Du=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
855      xmlns="http://www.w3.org/2000/svg"
856      width="${this.size}"
857      height="${this.size}"
858      fill="${this.color}"
859      viewBox="0 0 256 256"
860      transform=${this.mirrored?"scale(-1, 1)":null}
861    >
862      ${Du.weightsMap.get((e=this.weight)!=null?e:"regular")}
863    </svg>`}};Du.weightsMap=new Map([["thin",H`<path d="M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"/>`],["light",H`<path d="M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"/>`],["regular",H`<path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/>`],["bold",H`<path d="M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"/>`],["fill",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"/>`],["duotone",H`<path d="M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z" opacity="0.2"/><path d="M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"/>`]]);Du.styles=ge`
864    :host {
865      display: contents;
866    }
867  `;Tv([z({type:String,reflect:!0})],Du.prototype,"size",2);Tv([z({type:String,reflect:!0})],Du.prototype,"weight",2);Tv([z({type:String,reflect:!0})],Du.prototype,"color",2);Tv([z({type:Boolean,reflect:!0})],Du.prototype,"mirrored",2);Du=Tv([we("ph-check")],Du)});var Jye={};Ce(Jye,{PhCircleHalf:()=>Uu});var qKe,WKe,_v,Uu,Qye=h(()=>{Ge();Je();tt();rt();nt();Ye();qKe=Object.defineProperty,WKe=Object.getOwnPropertyDescriptor,_v=(e,t,r,n)=>{for(var o=n>1?void 0:n?WKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&qKe(t,r,o),o},Uu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
868      xmlns="http://www.w3.org/2000/svg"
869      width="${this.size}"
870      height="${this.size}"
871      fill="${this.color}"
872      viewBox="0 0 256 256"
873      transform=${this.mirrored?"scale(-1, 1)":null}
874    >
875      ${Uu.weightsMap.get((e=this.weight)!=null?e:"regular")}
876    </svg>`}};Uu.weightsMap=new Map([["thin",H`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm4,8.09a91.58,91.58,0,0,1,24,4.27V215.64a91.58,91.58,0,0,1-24,4.27Zm32,7.25a92.21,92.21,0,0,1,24,15V197.69a92.21,92.21,0,0,1-24,15ZM36,128a92.11,92.11,0,0,1,88-91.91V219.91A92.11,92.11,0,0,1,36,128Zm160,61.9V66.1a91.83,91.83,0,0,1,0,123.8Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm6,12.2a89.86,89.86,0,0,1,20,3.63V214.17a89.86,89.86,0,0,1-20,3.63Zm32,8.23a90.48,90.48,0,0,1,20,12.81V196.76a90.48,90.48,0,0,1-20,12.81ZM38,128a90.12,90.12,0,0,1,84-89.8V217.8A90.12,90.12,0,0,1,38,128Zm160,56.5V71.5a89.81,89.81,0,0,1,0,113Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm8,16.37a86.4,86.4,0,0,1,16,3V212.67a86.4,86.4,0,0,1-16,3Zm32,9.26a87.81,87.81,0,0,1,16,10.54V195.83a87.81,87.81,0,0,1-16,10.54ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm160,50.54V77.46a87.82,87.82,0,0,1,0,101.08Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm12,24.87a83.53,83.53,0,0,1,24,7.25V203.88a83.53,83.53,0,0,1-24,7.25ZM44,128a84.12,84.12,0,0,1,72-83.13V211.13A84.12,84.12,0,0,1,44,128Zm144,58.71V69.29a83.81,83.81,0,0,1,0,117.42Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.1,88.1,0,0,1,88-88V216A88.1,88.1,0,0,1,40,128Z"/>`],["duotone",H`<path d="M224,128a96,96,0,0,1-96,96V32A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24ZM40,128a88.11,88.11,0,0,1,80-87.63V215.63A88.11,88.11,0,0,1,40,128Zm96,87.63V40.37a88,88,0,0,1,0,175.26Z"/>`]]);Uu.styles=ge`
877    :host {
878      display: contents;
879    }
880  `;_v([z({type:String,reflect:!0})],Uu.prototype,"size",2);_v([z({type:String,reflect:!0})],Uu.prototype,"weight",2);_v([z({type:String,reflect:!0})],Uu.prototype,"color",2);_v([z({type:Boolean,reflect:!0})],Uu.prototype,"mirrored",2);Uu=_v([we("ph-circle-half")],Uu)});var Xye={};Ce(Xye,{PhClock:()=>Lu});var KKe,ZKe,Pv,Lu,ewe=h(()=>{Ge();Je();tt();rt();nt();Ye();KKe=Object.defineProperty,ZKe=Object.getOwnPropertyDescriptor,Pv=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&KKe(t,r,o),o},Lu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
881      xmlns="http://www.w3.org/2000/svg"
882      width="${this.size}"
883      height="${this.size}"
884      fill="${this.color}"
885      viewBox="0 0 256 256"
886      transform=${this.mirrored?"scale(-1, 1)":null}
887    >
888      ${Lu.weightsMap.get((e=this.weight)!=null?e:"regular")}
889    </svg>`}};Lu.weightsMap=new Map([["thin",H`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/>`]]);Lu.styles=ge`
890    :host {
891      display: contents;
892    }
893  `;Pv([z({type:String,reflect:!0})],Lu.prototype,"size",2);Pv([z({type:String,reflect:!0})],Lu.prototype,"weight",2);Pv([z({type:String,reflect:!0})],Lu.prototype,"color",2);Pv([z({type:Boolean,reflect:!0})],Lu.prototype,"mirrored",2);Lu=Pv([we("ph-clock")],Lu)});var twe={};Ce(twe,{PhCompass:()=>Mu});var GKe,YKe,Nv,Mu,rwe=h(()=>{Ge();Je();tt();rt();nt();Ye();GKe=Object.defineProperty,YKe=Object.getOwnPropertyDescriptor,Nv=(e,t,r,n)=>{for(var o=n>1?void 0:n?YKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&GKe(t,r,o),o},Mu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
894      xmlns="http://www.w3.org/2000/svg"
895      width="${this.size}"
896      height="${this.size}"
897      fill="${this.color}"
898      viewBox="0 0 256 256"
899      transform=${this.mirrored?"scale(-1, 1)":null}
900    >
901      ${Mu.weightsMap.get((e=this.weight)!=null?e:"regular")}
902    </svg>`}};Mu.weightsMap=new Map([["thin",H`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220ZM174.21,76.42l-64,32a4.08,4.08,0,0,0-1.79,1.79l-32,64A4,4,0,0,0,80,180a4.05,4.05,0,0,0,1.79-.42l64-32a4.08,4.08,0,0,0,1.79-1.79l32-64a4,4,0,0,0-5.37-5.37ZM141,141l-52.08,26L115,115l52.08-26Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218ZM173.32,74.63l-64,32a6,6,0,0,0-2.69,2.69l-32,64A6,6,0,0,0,80,182a6.06,6.06,0,0,0,2.68-.63l64-32a6,6,0,0,0,2.69-2.69l32-64a6,6,0,0,0-8.05-8.05Zm-33.79,64.9L93.42,162.58l23-46.11,46.11-23Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212ZM163.27,77l-56,24a12,12,0,0,0-6.3,6.3l-24,56A12,12,0,0,0,92.73,179l56-24a12,12,0,0,0,6.3-6.3l24-56A12,12,0,0,0,163.27,77Zm-28.41,57.89-24,10.29,10.29-24,24-10.29Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm51.58,57.79-32,64a4.08,4.08,0,0,1-1.79,1.79l-64,32a4,4,0,0,1-5.37-5.37l32-64a4.08,4.08,0,0,1,1.79-1.79l64-32A4,4,0,0,1,179.58,81.79Z"/>`],["duotone",H`<path d="M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32Zm16,112L80,176l32-64,64-32Z" opacity="0.2"/><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216ZM172.42,72.84l-64,32a8.05,8.05,0,0,0-3.58,3.58l-32,64A8,8,0,0,0,80,184a8.1,8.1,0,0,0,3.58-.84l64-32a8.05,8.05,0,0,0,3.58-3.58l32-64a8,8,0,0,0-10.74-10.74ZM138,138,97.89,158.11,118,118l40.15-20.07Z"/>`]]);Mu.styles=ge`
903    :host {
904      display: contents;
905    }
906  `;Nv([z({type:String,reflect:!0})],Mu.prototype,"size",2);Nv([z({type:String,reflect:!0})],Mu.prototype,"weight",2);Nv([z({type:String,reflect:!0})],Mu.prototype,"color",2);Nv([z({type:Boolean,reflect:!0})],Mu.prototype,"mirrored",2);Mu=Nv([we("ph-compass")],Mu)});var nwe={};Ce(nwe,{PhCopy:()=>Hu});var JKe,QKe,Rv,Hu,owe=h(()=>{Ge();Je();tt();rt();nt();Ye();JKe=Object.defineProperty,QKe=Object.getOwnPropertyDescriptor,Rv
906=(e,t,r,n)=>{for(var o=n>1?void 0:n?QKe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&JKe(t,r,o),o},Hu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
907      xmlns="http://www.w3.org/2000/svg"
908      width="${this.size}"
909      height="${this.size}"
910      fill="${this.color}"
911      viewBox="0 0 256 256"
912      transform=${this.mirrored?"scale(-1, 1)":null}
913    >
914      ${Hu.weightsMap.get((e=this.weight)!=null?e:"regular")}
915    </svg>`}};Hu.weightsMap=new Map([["thin",H`<path d="M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"/>`],["light",H`<path d="M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"/>`],["regular",H`<path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/>`],["bold",H`<path d="M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"/>`],["fill",H`<path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"/>`],["duotone",H`<path d="M216,40V168H168V88H88V40Z" opacity="0.2"/><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/>`]]);Hu.styles=ge`
916    :host {
917      display: contents;
918    }
919  `;Rv([z({type:String,reflect:!0})],Hu.prototype,"size",2);Rv([z({type:String,reflect:!0})],Hu.prototype,"weight",2);Rv([z({type:String,reflect:!0})],Hu.prototype,"color",2);Rv([z({type:Boolean,reflect:!0})],Hu.prototype,"mirrored",2);Hu=Rv([we("ph-copy")],Hu)});var swe={};Ce(swe,{PhCreditCard:()=>$u});var XKe,eZe,Ov,$u,iwe=h(()=>{Ge();Je();tt();rt();nt();Ye();XKe=Object.defineProperty,eZe=Object.getOwnPropertyDescriptor,Ov=(e,t,r,n)=>{for(var o=n>1?void 0:n?eZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&XKe(t,r,o),o},$u=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
920      xmlns="http://www.w3.org/2000/svg"
921      width="${this.size}"
922      height="${this.size}"
923      fill="${this.color}"
924      viewBox="0 0 256 256"
925      transform=${this.mirrored?"scale(-1, 1)":null}
926    >
927      ${$u.weightsMap.get((e=this.weight)!=null?e:"regular")}
928    </svg>`}};$u.weightsMap=new Map([["thin",H`<path d="M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52ZM32,60H224a4,4,0,0,1,4,4V92H28V64A4,4,0,0,1,32,60ZM224,196H32a4,4,0,0,1-4-4V100H228v92A4,4,0,0,1,224,196Zm-20-28a4,4,0,0,1-4,4H168a4,4,0,0,1,0-8h32A4,4,0,0,1,204,168Zm-64,0a4,4,0,0,1-4,4H120a4,4,0,0,1,0-8h16A4,4,0,0,1,140,168Z"/>`],["light",H`<path d="M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50ZM32,62H224a2,2,0,0,1,2,2V90H30V64A2,2,0,0,1,32,62ZM224,194H32a2,2,0,0,1-2-2V102H226v90A2,2,0,0,1,224,194Zm-18-26a6,6,0,0,1-6,6H168a6,6,0,0,1,0-12h32A6,6,0,0,1,206,168Zm-64,0a6,6,0,0,1-6,6H120a6,6,0,0,1,0-12h16A6,6,0,0,1,142,168Z"/>`],["regular",H`<path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/>`],["bold",H`<path d="M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,24V88H36V68ZM36,188V112H220v76Zm172-24a12,12,0,0,1-12,12H164a12,12,0,0,1,0-24h32A12,12,0,0,1,208,164Zm-68,0a12,12,0,0,1-12,12H116a12,12,0,0,1,0-24h12A12,12,0,0,1,140,164Z"/>`],["fill",H`<path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM136,176H120a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm64,0H168a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16ZM32,88V64H224V88Z"/>`],["duotone",H`<path d="M232,96v96a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V96Z" opacity="0.2"/><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/>`]]);$u.styles=ge`
929    :host {
930      display: contents;
931    }
932  `;Ov([z({type:String,reflect:!0})],$u.prototype,"size",2);Ov([z({type:String,reflect:!0})],$u.prototype,"weight",2);Ov([z({type:String,reflect:!0})],$u.prototype,"color",2);Ov([z({type:Boolean,reflect:!0})],$u.prototype,"mirrored",2);$u=Ov([we("ph-credit-card")],$u)});var awe={};Ce(awe,{PhCurrencyDollar:()=>Fu});var tZe,rZe,Bv,Fu,cwe=h(()=>{Ge();Je();tt();rt();nt();Ye();tZe=Object.defineProperty,rZe=Object.getOwnPropertyDescriptor,Bv=(e,t,r,n)=>{for(var o=n>1?void 0:n?rZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&tZe(t,r,o),o},Fu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
933      xmlns="http://www.w3.org/2000/svg"
934      width="${this.size}"
935      height="${this.size}"
936      fill="${this.color}"
937      viewBox="0 0 256 256"
938      transform=${this.mirrored?"scale(-1, 1)":null}
939    >
940      ${Fu.weightsMap.get((e=this.weight)!=null?e:"regular")}
941    </svg>`}};Fu.weightsMap=new Map([["thin",H`<path d="M152,124H132V52h12a36,36,0,0,1,36,36,4,4,0,0,0,8,0,44.05,44.05,0,0,0-44-44H132V24a4,4,0,0,0-8,0V44H112a44,44,0,0,0,0,88h12v72H104a36,36,0,0,1-36-36,4,4,0,0,0-8,0,44.05,44.05,0,0,0,44,44h20v20a4,4,0,0,0,8,0V212h20a44,44,0,0,0,0-88Zm-40,0a36,36,0,0,1,0-72h12v72Zm40,80H132V132h20a36,36,0,0,1,0,72Z"/>`],["light",H`<path d="M152,122H134V54h10a34,34,0,0,1,34,34,6,6,0,0,0,12,0,46.06,46.06,0,0,0-46-46H134V24a6,6,0,0,0-12,0V42H112a46,46,0,0,0,0,92h10v68H104a34,34,0,0,1-34-34,6,6,0,0,0-12,0,46.06,46.06,0,0,0,46,46h18v18a6,6,0,0,0,12,0V214h18a46,46,0,0,0,0-92Zm-40,0a34,34,0,0,1,0-68h10v68Zm40,80H134V134h18a34,34,0,0,1,0,68Z"/>`],["regular",H`<path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/>`],["bold",H`<path d="M152,116H140V60h4a28,28,0,0,1,28,28,12,12,0,0,0,24,0,52.06,52.06,0,0,0-52-52h-4V24a12,12,0,0,0-24,0V36h-4a52,52,0,0,0,0,104h4v56H104a28,28,0,0,1-28-28,12,12,0,0,0-24,0,52.06,52.06,0,0,0,52,52h12v12a12,12,0,0,0,24,0V220h12a52,52,0,0,0,0-104Zm-40,0a28,28,0,0,1,0-56h4v56Zm40,80H140V140h12a28,28,0,0,1,0,56Z"/>`],["fill",H`<path d="M160,152a16,16,0,0,1-16,16h-8V136h8A16,16,0,0,1,160,152Zm72-24A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-56,24a32,32,0,0,0-32-32h-8V88h4a16,16,0,0,1,16,16,8,8,0,0,0,16,0,32,32,0,0,0-32-32h-4V64a8,8,0,0,0-16,0v8h-4a32,32,0,0,0,0,64h4v32h-8a16,16,0,0,1-16-16,8,8,0,0,0-16,0,32,32,0,0,0,32,32h8v8a8,8,0,0,0,16,0v-8h8A32,32,0,0,0,176,152Zm-76-48a16,16,0,0,0,16,16h4V88h-4A16,16,0,0,0,100,104Z"/>`],["duotone",H`<path d="M192,168a40,40,0,0,1-40,40H128V128h24A40,40,0,0,1,192,168ZM112,48a40,40,0,0,0,0,80h16V48Z" opacity="0.2"/><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/>`]]);Fu.styles=ge`
942    :host {
943      display: contents;
944    }
945  `;Bv([z({type:String,reflect:!0})],Fu.prototype,"size",2);Bv([z({type:String,reflect:!0})],Fu.prototype,"weight",2);Bv([z({type:String,reflect:!0})],Fu.prototype,"color",2);Bv([z({type:Boolean,reflect:!0})],Fu.prototype,"mirrored",2);Fu=Bv([we("ph-currency-dollar")],Fu)});var lwe={};Ce(lwe,{PhDesktop:()=>Vu});var nZe,oZe,kv,Vu,uwe=h(()=>{Ge();Je();tt();rt();nt();Ye();nZe=Object.defineProperty,oZe=Object.getOwnPropertyDescriptor,kv=(e,t,r,n)=>{for(var o=n>1?void 0:n?oZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&nZe(t,r,o),o},Vu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
946      xmlns="http://www.w3.org/2000/svg"
947      width="${this.size}"
948      height="${this.size}"
949      fill="${this.color}"
950      viewBox="0 0 256 256"
951      transform=${this.mirrored?"scale(-1, 1)":null}
952    >
953      ${Vu.weightsMap.get((e=this.weight)!=null?e:"regular")}
954    </svg>`}};Vu.weightsMap=new Map([["thin",H`<path d="M208,44H48A20,20,0,0,0,28,64V176a20,20,0,0,0,20,20h76v24H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8H132V196h76a20,20,0,0,0,20-20V64A20,20,0,0,0,208,44ZM48,52H208a12,12,0,0,1,12,12v84H36V64A12,12,0,0,1,48,52ZM208,188H48a12,12,0,0,1-12-12V156H220v20A12,12,0,0,1,208,188Z"/>`],["light",H`<path d="M208,42H48A22,22,0,0,0,26,64V176a22,22,0,0,0,22,22h74v20H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12H134V198h74a22,22,0,0,0,22-22V64A22,22,0,0,0,208,42ZM48,54H208a10,10,0,0,1,10,10v82H38V64A10,10,0,0,1,48,54ZM208,186H48a10,10,0,0,1-10-10V158H218v18A10,10,0,0,1,208,186Z"/>`],["regular",H`<path d="M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40ZM48,56H208a8,8,0,0,1,8,8v80H40V64A8,8,0,0,1,48,56ZM208,184H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z"/>`],["bold",H`<path d="M208,36H48A28,28,0,0,0,20,64V172a28,28,0,0,0,28,28h68v12H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24H140V200h68a28,28,0,0,0,28-28V64A28,28,0,0,0,208,36ZM48,60H208a4,4,0,0,1,4,4v72H44V64A4,4,0,0,1,48,60ZM208,176H48a4,4,0,0,1-4-4V160H212v12A4,4,0,0,1,208,176Z"/>
954`],["fill",H`<path d="M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40Zm0,144H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z"/>`],["duotone",H`<path d="M224,64v88H32V64A16,16,0,0,1,48,48H208A16,16,0,0,1,224,64Z" opacity="0.2"/><path d="M208,40H48A24,24,0,0,0,24,64V176a24,24,0,0,0,24,24h72v16H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V200h72a24,24,0,0,0,24-24V64A24,24,0,0,0,208,40ZM48,56H208a8,8,0,0,1,8,8v80H40V64A8,8,0,0,1,48,56ZM208,184H48a8,8,0,0,1-8-8V160H216v16A8,8,0,0,1,208,184Z"/>`]]);Vu.styles=ge`
955    :host {
956      display: contents;
957    }
958  `;kv([z({type:String,reflect:!0})],Vu.prototype,"size",2);kv([z({type:String,reflect:!0})],Vu.prototype,"weight",2);kv([z({type:String,reflect:!0})],Vu.prototype,"color",2);kv([z({type:Boolean,reflect:!0})],Vu.prototype,"mirrored",2);Vu=kv([we("ph-desktop")],Vu)});var dwe={};Ce(dwe,{PhDeviceMobile:()=>zu});var sZe,iZe,Dv,zu,pwe=h(()=>{Ge();Je();tt();rt();nt();Ye();sZe=Object.defineProperty,iZe=Object.getOwnPropertyDescriptor,Dv=(e,t,r,n)=>{for(var o=n>1?void 0:n?iZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&sZe(t,r,o),o},zu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
959      xmlns="http://www.w3.org/2000/svg"
960      width="${this.size}"
961      height="${this.size}"
962      fill="${this.color}"
963      viewBox="0 0 256 256"
964      transform=${this.mirrored?"scale(-1, 1)":null}
965    >
966      ${zu.weightsMap.get((e=this.weight)!=null?e:"regular")}
967    </svg>`}};zu.weightsMap=new Map([["thin",H`<path d="M176,20H80A20,20,0,0,0,60,40V216a20,20,0,0,0,20,20h96a20,20,0,0,0,20-20V40A20,20,0,0,0,176,20ZM68,60H188V196H68ZM80,28h96a12,12,0,0,1,12,12V52H68V40A12,12,0,0,1,80,28Zm96,200H80a12,12,0,0,1-12-12V204H188v12A12,12,0,0,1,176,228Z"/>`],["light",H`<path d="M176,18H80A22,22,0,0,0,58,40V216a22,22,0,0,0,22,22h96a22,22,0,0,0,22-22V40A22,22,0,0,0,176,18ZM70,62H186V194H70ZM80,30h96a10,10,0,0,1,10,10V50H70V40A10,10,0,0,1,80,30Zm96,196H80a10,10,0,0,1-10-10V206H186v10A10,10,0,0,1,176,226Z"/>`],["regular",H`<path d="M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"/>`],["bold",H`<path d="M176,12H80A28,28,0,0,0,52,40V216a28,28,0,0,0,28,28h96a28,28,0,0,0,28-28V40A28,28,0,0,0,176,12ZM76,76H180V180H76Zm4-40h96a4,4,0,0,1,4,4V52H76V40A4,4,0,0,1,80,36Zm96,184H80a4,4,0,0,1-4-4V204H180v12A4,4,0,0,1,176,220Z"/>`],["fill",H`<path d="M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM80,32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"/>`],["duotone",H`<path d="M192,56V200H64V56Z" opacity="0.2"/><path d="M176,16H80A24,24,0,0,0,56,40V216a24,24,0,0,0,24,24h96a24,24,0,0,0,24-24V40A24,24,0,0,0,176,16ZM72,64H184V192H72Zm8-32h96a8,8,0,0,1,8,8v8H72V40A8,8,0,0,1,80,32Zm96,192H80a8,8,0,0,1-8-8v-8H184v8A8,8,0,0,1,176,224Z"/>`]]);zu.styles=ge`
968    :host {
969      display: contents;
970    }
971  `;Dv([z({type:String,reflect:!0})],zu.prototype,"size",2);Dv([z({type:String,reflect:!0})],zu.prototype,"weight",2);Dv([z({type:String,reflect:!0})],zu.prototype,"color",2);Dv([z({type:Boolean,reflect:!0})],zu.prototype,"mirrored",2);zu=Dv([we("ph-device-mobile")],zu)});var fwe={};Ce(fwe,{PhDotsThree:()=>ju});var aZe,cZe,Uv,ju,hwe=h(()=>{Ge();Je();tt();rt();nt();Ye();aZe=Object.defineProperty,cZe=Object.getOwnPropertyDescriptor,Uv=(e,t,r,n)=>{for(var o=n>1?void 0:n?cZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&aZe(t,r,o),o},ju=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
972      xmlns="http://www.w3.org/2000/svg"
973      width="${this.size}"
974      height="${this.size}"
975      fill="${this.color}"
976      viewBox="0 0 256 256"
977      transform=${this.mirrored?"scale(-1, 1)":null}
978    >
979      ${ju.weightsMap.get((e=this.weight)!=null?e:"regular")}
980    </svg>`}};ju.weightsMap=new Map([["thin",H`<path d="M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z"/>`],["light",H`<path d="M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z"/>`],["regular",H`<path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/>`],["bold",H`<path d="M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z"/>`],["fill",H`<path d="M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z"/>`],["duotone",H`<path d="M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z" opacity="0.2"/><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/>`]]);ju.styles=ge`
981    :host {
982      display: contents;
983    }
984  `;Uv([z({type:String,reflect:!0})],ju.prototype,"size",2);Uv([z({type:String,reflect:!0})],ju.prototype,"weight",2);Uv([z({type:String,reflect:!0})],ju.prototype,"color",2);Uv([z({type:Boolean,reflect:!0})],ju.prototype,"mirrored",2);ju=Uv([we("ph-dots-three")],ju)});var mwe={};Ce(mwe,{PhVault:()=>qu});var lZe,uZe,Lv,qu,gwe=h(()=>{Ge();Je();tt();rt();nt();Ye();lZe=Object.defineProperty,uZe=Object.getOwnPropertyDescriptor,Lv=(e,t,r,n)=>{for(var o=n>1?void 0:n?uZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&lZe(t,r,o),o},qu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
985      xmlns="http://www.w3.org/2000/svg"
986      width="${this.size}"
987      height="${this.size}"
988      fill="${this.color}"
989      viewBox="0 0 256 256"
990      transform=${this.mirrored?"scale(-1, 1)":null}
991    >
992      ${qu.weightsMap.get((e=this.weight)!=null?e:"regular")}
993    </svg>`}};qu.weightsMap=new Map([["thin",H`<path d="M216,44H40A12,12,0,0,0,28,56V192a12,12,0,0,0,12,12H60v20a4,4,0,0,0,8,0V204H188v20a4,4,0,0,0,8,0V204h20a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44Zm0,152H40a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4v68H195.81a44,44,0,1,0,0,8H220v60A4,4,0,0,1,216,196Zm-52.7-72a12,12,0,1,0,0,8h24.47a36,36,0,1,1,0-8Z"/>`],["light",H`<path d="M216,42H40A14,14,0,0,0,26,56V192a14,14,0,0,0,14,14H58v18a6,6,0,0,0,12,0V206H186v18a6,6,0,0,0,12,0V206h18a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42Zm0,152H40a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2v66H197.6a46,46,0,1,0,0,12H218v58A2,2,0,0,1,216,194Zm-51.37-72a14,14,0,1,0,0,12h20.83a34,34,0,1,1,0-12Z"/>`],["regular",H`<path d="M216,40H40A16,16,0,0,0,24,56V192a16,16,0,0,0,16,16H56v16a8,8,0,0,0,16,0V208H184v16a8,8,0,0,0,16,0V208h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,152H40V56H216v64H199.32a48,48,0,1,0,0,16H216v56Zm-50.16-72a16,16,0,1,0,0,16H183a32,32,0,1,1,0-16Z"/>`],["bold",H`<path d="M216,36H40A20,20,0,0,0,20,56V192a20,20,0,0,0,20,20H52v12a12,12,0,0,0,24,0V212H180v12a12,12,0,0,0,24,0V212h12a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36ZM44,188V60H212v52H190.32a44,44,0,1,0,0,24H212v52Zm124-64a20,20,0,1,1-20-20A20,20,0,0,1,168,124Z"/>`],["fill",H`<path d="M216,40H40A16,16,0,0,0,24,56V192a16,16,0,0,0,16,16H56v16a8,8,0,0,0,16,0V208H184v16a8,8,0,0,0,16,0V208h16a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-8,96H179.09a36,36,0,1,1,0-16H208a8,8,0,0,1,0,16Zm-44-8a20,20,0,1,1-20-20A20,20,0,0,1,164,128Z"/>`],["duotone",H`<path d="M216,48H40a8,8,0,0,0-8,8V192a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V56A8,8,0,0,0,216,48ZM152,168a40,40,0,1,1,40-40A40,40,0,0,1,152,168Z" opacity="0.2"/><path d="M216,40H40A16,16,0,0,0,24,56V192a16,16,0,0,0,16,16H56v16a8,8,0,0,0,16,0V208H184v16a8,8,0,0,0,16,0V208h16a16,
99316,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,152H40V56H216v64H199.32a48,48,0,1,0,0,16H216v56Zm-50.16-72a16,16,0,1,0,0,16H183a32,32,0,1,1,0-16Z"/>`]]);qu.styles=ge`
994    :host {
995      display: contents;
996    }
997  `;Lv([z({type:String,reflect:!0})],qu.prototype,"size",2);Lv([z({type:String,reflect:!0})],qu.prototype,"weight",2);Lv([z({type:String,reflect:!0})],qu.prototype,"color",2);Lv([z({type:Boolean,reflect:!0})],qu.prototype,"mirrored",2);qu=Lv([we("ph-vault")],qu)});var ywe={};Ce(ywe,{PhEnvelope:()=>Wu});var dZe,pZe,Mv,Wu,wwe=h(()=>{Ge();Je();tt();rt();nt();Ye();dZe=Object.defineProperty,pZe=Object.getOwnPropertyDescriptor,Mv=(e,t,r,n)=>{for(var o=n>1?void 0:n?pZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&dZe(t,r,o),o},Wu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
998      xmlns="http://www.w3.org/2000/svg"
999      width="${this.size}"
1000      height="${this.size}"
1001      fill="${this.color}"
1002      viewBox="0 0 256 256"
1003      transform=${this.mirrored?"scale(-1, 1)":null}
1004    >
1005      ${Wu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1006    </svg>`}};Wu.weightsMap=new Map([["thin",H`<path d="M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52Zm-96,86.57L42.28,60H213.72ZM104.63,128,36,190.91V65.09Zm5.92,5.43L125.3,147a4,4,0,0,0,5.4,0l14.75-13.52L213.72,196H42.28ZM151.37,128,220,65.09V190.91Z"/>`],["light",H`<path d="M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50Zm-96,85.86L47.42,62H208.58ZM101.67,128,38,186.36V69.64Zm8.88,8.14L124,148.42a6,6,0,0,0,8.1,0l13.4-12.28L208.58,194H47.43ZM154.33,128,218,69.64V186.36Z"/>`],["regular",H`<path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-96,85.15L52.57,64H203.43ZM98.71,128,40,181.81V74.19Zm11.84,10.85,12,11.05a8,8,0,0,0,10.82,0l12-11.05,58,53.15H52.57ZM157.29,128,216,74.18V181.82Z"/>`],["bold",H`<path d="M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44Zm-96,83.72L62.85,68h130.3ZM92.79,128,44,172.72V83.28Zm17.76,16.28,9.34,8.57a12,12,0,0,0,16.22,0l9.34-8.57L193.15,188H62.85ZM163.21,128,212,83.28v89.44Z"/>`],["fill",H`<path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM98.71,128,40,181.81V74.19Zm11.84,10.85,12,11.05a8,8,0,0,0,10.82,0l12-11.05,58,53.15H52.57ZM157.29,128,216,74.18V181.82Z"/>`],["duotone",H`<path d="M224,56l-96,88L32,56Z" opacity="0.2"/><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-96,85.15L52.57,64H203.43ZM98.71,128,40,181.81V74.19Zm11.84,10.85,12,11.05a8,8,0,0,0,10.82,0l12-11.05,58,53.15H52.57ZM157.29,128,216,74.18V181.82Z"/>`]]);Wu.styles=ge`
1007    :host {
1008      display: contents;
1009    }
1010  `;Mv([z({type:String,reflect:!0})],Wu.prototype,"size",2);Mv([z({type:String,reflect:!0})],Wu.prototype,"weight",2);Mv([z({type:String,reflect:!0})],Wu.prototype,"color",2);Mv([z({type:Boolean,reflect:!0})],Wu.prototype,"mirrored",2);Wu=Mv([we("ph-envelope")],Wu)});var bwe={};Ce(bwe,{PhFunnelSimple:()=>Ku});var fZe,hZe,Hv,Ku,xwe=h(()=>{Ge();Je();tt();rt();nt();Ye();fZe=Object.defineProperty,hZe=Object.getOwnPropertyDescriptor,Hv=(e,t,r,n)=>{for(var o=n>1?void 0:n?hZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&fZe(t,r,o),o},Ku=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1011      xmlns="http://www.w3.org/2000/svg"
1012      width="${this.size}"
1013      height="${this.size}"
1014      fill="${this.color}"
1015      viewBox="0 0 256 256"
1016      transform=${this.mirrored?"scale(-1, 1)":null}
1017    >
1018      ${Ku.weightsMap.get((e=this.weight)!=null?e:"regular")}
1019    </svg>`}};Ku.weightsMap=new Map([["thin",H`<path d="M196,136a4,4,0,0,1-4,4H64a4,4,0,0,1,0-8H192A4,4,0,0,1,196,136Zm36-52H24a4,4,0,0,0,0,8H232a4,4,0,0,0,0-8Zm-80,96H104a4,4,0,0,0,0,8h48a4,4,0,0,0,0-8Z"/>`],["light",H`<path d="M198,136a6,6,0,0,1-6,6H64a6,6,0,0,1,0-12H192A6,6,0,0,1,198,136Zm34-54H24a6,6,0,0,0,0,12H232a6,6,0,0,0,0-12Zm-80,96H104a6,6,0,0,0,0,12h48a6,6,0,0,0,0-12Z"/>`],["regular",H`<path d="M200,136a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,136Zm32-56H24a8,8,0,0,0,0,16H232a8,8,0,0,0,0-16Zm-80,96H104a8,8,0,0,0,0,16h48a8,8,0,0,0,0-16Z"/>`],["bold",H`<path d="M204,136a12,12,0,0,1-12,12H64a12,12,0,0,1,0-24H192A12,12,0,0,1,204,136Zm28-60H24a12,12,0,0,0,0,24H232a12,12,0,0,0,0-24Zm-80,96H104a12,12,0,0,0,0,24h48a12,12,0,0,0,0-24Z"/>`],["fill",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM144,176H112a8,8,0,0,1,0-16h32a8,8,0,0,1,0,16Zm32-40H80a8,8,0,0,1,0-16h96a8,8,0,0,1,0,16Zm32-40H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z"/>`],["duotone",H`<path d="M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z" opacity="0.2"/><path d="M200,136a8,8,0,0,1-8,8H64a8,8,0,0,1,0-16H192A8,8,0,0,1,200,136Zm32-56H24a8,8,0,0,0,0,16H232a8,8,0,0,0,0-16Zm-80,96H104a8,8,0,0,0,0,16h48a8,8,0,0,0,0-16Z"/>`]]);Ku.styles=ge`
1020    :host {
1021      display: contents;
1022    }
1023  `;Hv([z({type:String,reflect:!0})],Ku.prototype,"size",2);Hv([z({type:String,reflect:!0})],Ku.prototype,"weight",2);Hv([z({type:String,reflect:!0})],Ku.prototype,"color",2);Hv([z({type:Boolean,reflect:!0})],Ku.prototype,"mirrored",2);Ku=Hv([we("ph-funnel-simple")],Ku)}
1023);var vwe={};Ce(vwe,{PhGlobe:()=>Zu});var mZe,gZe,$v,Zu,Ewe=h(()=>{Ge();Je();tt();rt();nt();Ye();mZe=Object.defineProperty,gZe=Object.getOwnPropertyDescriptor,$v=(e,t,r,n)=>{for(var o=n>1?void 0:n?gZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&mZe(t,r,o),o},Zu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1024      xmlns="http://www.w3.org/2000/svg"
1025      width="${this.size}"
1026      height="${this.size}"
1027      fill="${this.color}"
1028      viewBox="0 0 256 256"
1029      transform=${this.mirrored?"scale(-1, 1)":null}
1030    >
1031      ${Zu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1032    </svg>`}};Zu.weightsMap=new Map([["thin",H`<path d="M128,28h0A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,190.61c-6.33-6.09-23-24.41-31.27-54.61h62.54C151,194.2,134.33,212.52,128,218.61ZM94.82,156a140.42,140.42,0,0,1,0-56h66.36a140.42,140.42,0,0,1,0,56ZM128,37.39c6.33,6.09,23,24.41,31.27,54.61H96.73C105,61.8,121.67,43.48,128,37.39ZM169.41,100h46.23a92.09,92.09,0,0,1,0,56H169.41a152.65,152.65,0,0,0,0-56Zm43.25-8h-45a129.39,129.39,0,0,0-29.19-55.4A92.25,92.25,0,0,1,212.66,92ZM117.54,36.6A129.39,129.39,0,0,0,88.35,92h-45A92.25,92.25,0,0,1,117.54,36.6ZM40.36,100H86.59a152.65,152.65,0,0,0,0,56H40.36a92.09,92.09,0,0,1,0-56Zm3,64h45a129.39,129.39,0,0,0,29.19,55.4A92.25,92.25,0,0,1,43.34,164Zm95.12,55.4A129.39,129.39,0,0,0,167.65,164h45A92.25,92.25,0,0,1,138.46,219.4Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm81.57,64H169.19a132.58,132.58,0,0,0-25.73-50.67A90.29,90.29,0,0,1,209.57,90ZM218,128a89.7,89.7,0,0,1-3.83,26H171.81a155.43,155.43,0,0,0,0-52h42.36A89.7,89.7,0,0,1,218,128Zm-90,87.83a110,110,0,0,1-15.19-19.45A124.24,124.24,0,0,1,99.35,166h57.3a124.24,124.24,0,0,1-13.46,30.38A110,110,0,0,1,128,215.83ZM96.45,154a139.18,139.18,0,0,1,0-52h63.1a139.18,139.18,0,0,1,0,52ZM38,128a89.7,89.7,0,0,1,3.83-26H84.19a155.43,155.43,0,0,0,0,52H41.83A89.7,89.7,0,0,1,38,128Zm90-87.83a110,110,0,0,1,15.19,19.45A124.24,124.24,0,0,1,156.65,90H99.35a124.24,124.24,0,0,1,13.46-30.38A110,110,0,0,1,128,40.17Zm-15.46-.84A132.58,132.58,0,0,0,86.81,90H46.43A90.29,90.29,0,0,1,112.54,39.33ZM46.43,166H86.81a132.58,132.58,0,0,0,25.73,50.67A90.29,90.29,0,0,1,46.43,166Zm97,50.67A132.58,132.58,0,0,0,169.19,166h40.38A90.29,90.29,0,0,1,143.46,216.67Z"/>`],["regular",H`<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,187a113.4,113.4,0,0,1-20.39-35h40.82a116.94,116.94,0,0,1-10,20.77A108.61,108.61,0,0,1,128,207Zm-26.49-59a135.42,135.42,0,0,1,0-40h53a135.42,135.42,0,0,1,0,40ZM44,128a83.49,83.49,0,0,1,2.43-20H77.25a160.63,160.63,0,0,0,0,40H46.43A83.49,83.49,0,0,1,44,128Zm84-79a113.4,113.4,0,0,1,20.39,35H107.59a116.94,116.94,0,0,1,10-20.77A108.61,108.61,0,0,1,128,49Zm50.73,59h30.82a83.52,83.52,0,0,1,0,40H178.75a160.63,160.63,0,0,0,0-40Zm20.77-24H173.71a140.82,140.82,0,0,0-15.5-34.36A84.51,84.51,0,0,1,199.52,84ZM97.79,49.64A140.82,140.82,0,0,0,82.29,84H56.48A84.51,84.51,0,0,1,97.79,49.64ZM56.48,172H82.29a140.82,140.82,0,0,0,15.5,34.36A84.51,84.51,0,0,1,56.48,172Zm101.73,34.36A140.82,140.82,0,0,0,173.71,172h25.81A84.51,84.51,0,0,1,158.21,206.36Z"/>`],["fill",H`<path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm78.36,64H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM216,128a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM128,43a115.27,115.27,0,0,1,26,45H102A115.11,115.11,0,0,1,128,43ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48Zm50.35,61.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,10
10327.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/>`]]);Zu.styles=ge`
1033    :host {
1034      display: contents;
1035    }
1036  `;$v([z({type:String,reflect:!0})],Zu.prototype,"size",2);$v([z({type:String,reflect:!0})],Zu.prototype,"weight",2);$v([z({type:String,reflect:!0})],Zu.prototype,"color",2);$v([z({type:Boolean,reflect:!0})],Zu.prototype,"mirrored",2);Zu=$v([we("ph-globe")],Zu)});var Awe={};Ce(Awe,{PhIdentificationCard:()=>Gu});var yZe,wZe,Fv,Gu,Cwe=h(()=>{Ge();Je();tt();rt();nt();Ye();yZe=Object.defineProperty,wZe=Object.getOwnPropertyDescriptor,Fv=(e,t,r,n)=>{for(var o=n>1?void 0:n?wZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&yZe(t,r,o),o},Gu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1037      xmlns="http://www.w3.org/2000/svg"
1038      width="${this.size}"
1039      height="${this.size}"
1040      fill="${this.color}"
1041      viewBox="0 0 256 256"
1042      transform=${this.mirrored?"scale(-1, 1)":null}
1043    >
1044      ${Gu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1045    </svg>`}};Gu.weightsMap=new Map([["thin",H`<path d="M196,112a4,4,0,0,1-4,4H152a4,4,0,0,1,0-8h40A4,4,0,0,1,196,112Zm-4,28H152a4,4,0,0,0,0,8h40a4,4,0,0,0,0-8Zm36-84V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4ZM131.87,167a4,4,0,1,1-7.74,2C121.06,157,109,148,96,148s-25,9-28.13,21A4,4,0,0,1,64,172a3.87,3.87,0,0,1-1-.13A4,4,0,0,1,60.13,167a36.28,36.28,0,0,1,20.43-23.66,28,28,0,1,1,30.88,0A36.2,36.2,0,0,1,131.87,167ZM96,140a20,20,0,1,0-20-20A20,20,0,0,0,96,140Z"/>`],["light",H`<path d="M198,112a6,6,0,0,1-6,6H152a6,6,0,0,1,0-12h40A6,6,0,0,1,198,112Zm-6,26H152a6,6,0,0,0,0,12h40a6,6,0,0,0,0-12Zm38-82V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2ZM133.81,166.51a6,6,0,0,1-11.62,3C119.34,158.38,108.08,150,96,150s-23.33,8.38-26.19,19.5a6,6,0,0,1-11.62-3A38,38,0,0,1,76.78,143a30,30,0,1,1,38.45,0A38,38,0,0,1,133.81,166.51ZM96,138a18,18,0,1,0-18-18A18,18,0,0,0,96,138Z"/>`],["regular",H`<path d="M200,112a8,8,0,0,1-8,8H152a8,8,0,0,1,0-16h40A8,8,0,0,1,200,112Zm-8,24H152a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm40-80V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Zm-80.26-34a8,8,0,1,1-15.5,4c-2.63-10.26-13.06-18-24.25-18s-21.61,7.74-24.25,18a8,8,0,1,1-15.5-4,39.84,39.84,0,0,1,17.19-23.34,32,32,0,1,1,45.12,0A39.76,39.76,0,0,1,135.75,166ZM96,136a16,16,0,1,0-16-16A16,16,0,0,0,96,136Z"/>`],["bold",H`<path d="M148,108a12,12,0,0,1,12-12h28a12,12,0,0,1,0,24H160A12,12,0,0,1,148,108Zm40,28H168a12,12,0,0,0,0,24h20a12,12,0,0,0,0-24Zm48-80V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212ZM58.28,159.37A43.82,43.82,0,0,1,71.53,142a36,36,0,1,1,56.94,0,43.84,43.84,0,0,1,13.26,17.37,12,12,0,0,1-22.15,9.26C116.48,161.19,108.42,156,100,156s-16.47,5.2-19.59,12.63a12,12,0,1,1-22.13-9.26ZM88,120a12,12,0,1,0,12-12A12,12,0,0,0,88,120Z"/>`],["fill",H`<path d="M112,120a16,16,0,1,1-16-16A16,16,0,0,1,112,120ZM232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM135.75,166a39.76,39.76,0,0,0-17.19-23.34,32,32,0,1,0-45.12,0A39.84,39.84,0,0,0,56.25,166a8,8,0,0,0,15.5,4c2.64-10.25,13.06-18,24.25-18s21.62,7.73,24.25,18a8,8,0,1,0,15.5-4ZM200,144a8,8,0,0,0-8-8H152a8,8,0,0,0,0,16h40A8,8,0,0,0,200,144Zm0-32a8,8,0,0,0-8-8H152a8,8,0,0,0,0,16h40A8,8,0,0,0,200,112Z"/>`],["duotone",H`<path d="M216,48H40a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V56A8,8,0,0,0,216,48ZM96,144a24,24,0,1,1,24-24A24,24,0,0,1,96,144Z" opacity="0.2"/><path d="M200,112a8,8,0,0,1-8,8H152a8,8,0,0,1,0-16h40A8,8,0,0,1,200,112Zm-8,24H152a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm40-80V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Zm-80.26-34a8,8,0,1,1-15.5,4c-2.63-10.26-13.06-18-24.25-18s-21.61,7.74-24.25,18a8,8,0,1,1-15.5-4,39.84,39.84,0,0,1,17.19-23.34,32,32,0,1,1,45.12,0A39.76,39.76,0,0,1,135.75,166ZM96,136a16,16,0,1,0-16-16A16,16,0,0,0,96,136Z"/>`]]);Gu.styles=ge`
1046    :host {
1047      display: contents;
1048    }
1049  `;Fv([z({type:String,reflect:!0})],Gu.prototype,"size",2);Fv([z({type:String,reflect:!0})],Gu.prototype,"weight",2);Fv([z({type:String,reflect:!0})],Gu.prototype,"color",2);Fv([z({type:Boolean,reflect:!0})],Gu.prototype,"mirrored",2);Gu=Fv([we("ph-identification-card")],Gu)});var Swe={};Ce(Swe,{PhImage:()=>Yu});var bZe,xZe,Vv,Yu,Iwe=h(()=>{Ge();Je();tt();rt();nt();Ye();bZe=Object.defineProperty,xZe=Object.getOwnPropertyDescriptor,Vv=(e,t,r,n)=>{for(var o=n>1?void 0:n?xZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&bZe(t,r,o),o},Yu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1050      xmlns="http://www.w3.org/2000/svg"
1051      width="${this.size}"
1052      height="${this.size}"
1053      fill="${this.color}"
1054      viewBox="0 0 256 256"
1055      transform=${this.mirrored?"scale(-1, 1)":null}
1056    >
1057      ${Yu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1058    </svg>`}};Yu.weightsMap=new Map([["thin",H`<path d="M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"/>`],["light",H`<path d="M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"/>`],["regular",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/>`],["bold",H`<path d="M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"/>`],["fill",H`<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"/>`],["duotone",H`<path d="M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z" opacity="0.2"/><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/>`]]);Yu.styles=ge`
1059    :host {
1060      display: contents;
1061    }
1062  `;Vv([z({type:String,reflect:!0})],Yu.prototype,"size",2);Vv([z({type:String,reflect:!0})],Yu.prototype,"weight",2);Vv([z({type:String,reflect:!0})],Yu.prototype,"color",2);Vv([z({type:Boolean,reflect:!0})],Yu.prototype,"mirrored",2);Yu=Vv([we("ph-image")],Yu)});var Twe={};Ce(Twe,{PhInfo:()=>Ju});var vZe,EZe,zv,Ju,_we=h(()=>{Ge();Je();tt();rt();nt();Ye();vZe=Object.defineProperty,EZe=Object.getOwnPropertyDescriptor,zv=(e,t,r,n)=>{for(var o=n>1?void 0:n?EZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&vZe(t,r,o),o},Ju=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1063      xmlns="http://www.w3.org/2000/svg"
1064      width="${this.size}"
1065      height="${this.size}"
1066      fill="${this.color}"
1067      viewBox="0 0 256 256"
1068      transform=${this.mirrored?"scale(-1, 1)":null}
1069    >
1070      ${Ju.weightsMap.get((e=this.weight)!=null?e:"regular")}
1071    </svg>`}};Ju.weightsMap=new Map([["thin",H`<path d="M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"/>`],["light",H`<path d="M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/>`],["bold",H`<path d="M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"/>`]]);Ju.styles=ge`
1072    :host {
1073      display: contents;
1074    }
1075  `;zv([z({type:String,reflect:!0})],Ju.prototype,"size",2);zv([z({type:String,reflect:!0})],Ju.prototype,"weight",2);zv([z({type:String,reflect:!0})],Ju.prototype,"color",2);zv([z({type:Boolean,reflect:!0})],Ju.prototype,"mirrored",2);Ju=zv([we("ph-info")],Ju)});var Pwe={};Ce(Pwe,{PhLightbulb:()=>Qu});
1075var AZe,CZe,jv,Qu,Nwe=h(()=>{Ge();Je();tt();rt();nt();Ye();AZe=Object.defineProperty,CZe=Object.getOwnPropertyDescriptor,jv=(e,t,r,n)=>{for(var o=n>1?void 0:n?CZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&AZe(t,r,o),o},Qu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1076      xmlns="http://www.w3.org/2000/svg"
1077      width="${this.size}"
1078      height="${this.size}"
1079      fill="${this.color}"
1080      viewBox="0 0 256 256"
1081      transform=${this.mirrored?"scale(-1, 1)":null}
1082    >
1083      ${Qu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1084    </svg>`}};Qu.weightsMap=new Map([["thin",H`<path d="M172,232a4,4,0,0,1-4,4H88a4,4,0,0,1,0-8h80A4,4,0,0,1,172,232Zm40-128a83.59,83.59,0,0,1-32.11,66.06A20.2,20.2,0,0,0,172,186v6a12,12,0,0,1-12,12H96a12,12,0,0,1-12-12v-6a20,20,0,0,0-7.76-15.81A83.58,83.58,0,0,1,44,104.47C43.75,59,80.52,21.09,126,20a84,84,0,0,1,86,84Zm-8,0a76,76,0,0,0-77.83-76C85,29,51.77,63.27,52,104.43a75.62,75.62,0,0,0,29.17,59.43A28,28,0,0,1,92,186v6a4,4,0,0,0,4,4h64a4,4,0,0,0,4-4v-6a28.14,28.14,0,0,1,10.94-22.2A75.62,75.62,0,0,0,204,104ZM136.66,52.06a4,4,0,0,0-1.32,7.88C153.53,63,169,78.45,172.06,96.67A4,4,0,0,0,176,100a3.88,3.88,0,0,0,.67-.06,4,4,0,0,0,3.27-4.61A53.51,53.51,0,0,0,136.66,52.06Z"/>`],["light",H`<path d="M174,232a6,6,0,0,1-6,6H88a6,6,0,0,1,0-12h80A6,6,0,0,1,174,232Zm40-128a85.56,85.56,0,0,1-32.88,67.64A18.23,18.23,0,0,0,174,186v6a14,14,0,0,1-14,14H96a14,14,0,0,1-14-14v-6a18,18,0,0,0-7-14.23h0a85.59,85.59,0,0,1-33-67.24C41.74,57.91,79.39,19.12,125.93,18A86,86,0,0,1,214,104Zm-12,0a74,74,0,0,0-75.79-74C86.17,31,53.78,64.34,54,104.42a73.67,73.67,0,0,0,28.4,57.87A29.92,29.92,0,0,1,94,186v6a2,2,0,0,0,2,2h64a2,2,0,0,0,2-2v-6a30.18,30.18,0,0,1,11.7-23.78A73.59,73.59,0,0,0,202,104Zm-20.08-9A55.58,55.58,0,0,0,137,50.08a6,6,0,1,0-2,11.84C152.38,64.84,167.13,79.6,170.08,97a6,6,0,0,0,5.91,5,6.87,6.87,0,0,0,1-.08A6,6,0,0,0,181.92,95Z"/>`],["regular",H`<path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"/>`],["bold",H`<path d="M180,232a12,12,0,0,1-12,12H88a12,12,0,0,1,0-24h80A12,12,0,0,1,180,232Zm40-128a91.51,91.51,0,0,1-35.17,72.35A12.26,12.26,0,0,0,180,186v2a20,20,0,0,1-20,20H96a20,20,0,0,1-20-20v-2a12,12,0,0,0-4.7-9.51A91.57,91.57,0,0,1,36,104.52C35.73,54.69,76,13.2,125.79,12A92,92,0,0,1,220,104Zm-24,0a68,68,0,0,0-69.65-68C89.56,36.88,59.8,67.55,60,104.38a67.71,67.71,0,0,0,26.1,53.19A35.87,35.87,0,0,1,100,184h56.1A36.13,36.13,0,0,1,170,157.49,67.68,67.68,0,0,0,196,104Zm-20.07-5.32a48.5,48.5,0,0,0-31.91-40,12,12,0,0,0-8,22.62,24.31,24.31,0,0,1,16.09,20,12,12,0,0,0,23.86-2.64Z"/>`],["fill",H`<path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-32.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"/>`],["duotone",H`<path d="M208,104a79.86,79.86,0,0,1-30.59,62.92A24.29,24.29,0,0,0,168,186v6a8,8,0,0,1-8,8H96a8,8,0,0,1-8-8v-6a24.11,24.11,0,0,0-9.3-19A79.87,79.87,0,0,1,48,104.45C47.76,61.09,82.72,25,126.07,24A80,80,0,0,1,208,104Z" opacity="0.2"/><path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z"/>`]]);Qu.styles=ge`
1085    :host {
1086      display: contents;
1087    }
1088  `;jv([z({type:String,reflect:!0})],Qu.prototype,"size",2);jv([z({type:String,reflect:!0})],Qu.prototype,"weight",2);jv([z({type:String,reflect:!0})],Qu.prototype,"color",2);jv([z({type:Boolean,reflect:!0})],Qu.prototype,"mirrored",2);Qu=jv([we("ph-lightbulb")],Qu)});var Rwe={};Ce(Rwe,{PhMagnifyingGlass:()=>Xu});var SZe,IZe,qv,Xu,Owe=h(()=>{Ge();Je();tt();rt();nt();Ye();SZe=Object.defineProperty,IZe=Object.getOwnPropertyDescriptor,qv=(e,t,r,n)=>{for(var o=n>1?void 0:n?IZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&SZe(t,r,o),o},Xu=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1089      xmlns="http://www.w3.org/2000/svg"
1090      width="${this.size}"
1091      height="${this.size}"
1092      fill="${this.color}"
1093      viewBox="0 0 256 256"
1094      transform=${this.mirrored?"scale(-1, 1)":null}
1095    >
1096      ${Xu.weightsMap.get((e=this.weight)!=null?e:"regular")}
1097    </svg>`}};Xu.weightsMap=new Map([["thin",H`<path d="M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"/>`],["light",H`<path d="M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"/>`],["regular",H`<path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/>`],["bold",H`<path d="M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"/>`],["fill",H`<path d="M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"/>`],["duotone",H`<path d="M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z" opacity="0.2"/><path d="M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/>`]]);Xu.styles=ge`
1098    :host {
1099      display: contents;
1100    }
1101  `;qv([z({type:String,reflect:!0})],Xu.prototype,"size",2);qv([z({type:String,reflect:!0})],Xu.prototype,"weight",2);qv([z({type:String,reflect:!0})],Xu.prototype,"color",2);qv([z({type:Boolean,reflect:!0})],Xu.prototype,"mirrored",2);Xu=qv([we("ph-magnifying-glass")],Xu)});var Bwe={};Ce(Bwe,{PhPaperPlaneRight:()=>ed});var TZe,_Ze,Wv,ed,kwe=h(()=>{Ge();Je();tt();rt();nt();Ye();TZe=Object.defineProperty,_Ze=Object.getOwnPropertyDescriptor,Wv=(e,t,r,n)=>{for(var o=n>1?void 0:n?_Ze(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&TZe(t,r,o),o},ed=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1102      xmlns="http://www.w3.org/2000/svg"
1103      width="${this.size}"
1104      height="${this.size}"
1105      fill="${this.color}"
1106      viewBox="0 0 256 256"
1107      transform=${this.mirrored?"scale(-1, 1)":null}
1108    >
1109      ${ed.weightsMap.get((e=this.weight)!=null?e:"regular")}
1110    </svg>`}};ed.weightsMap=new Map([["thin",H`<path d="M229.89,117.43l-168-95.88A12,12,0,0,0,44.7,36l31.08,92L44.71,220A12,12,0,0,0,56,236a12.13,12.13,0,0,0,5.93-1.57l167.94-96.08a12,12,0,0,0,0-20.92Zm-4,14L58,227.47a4,4,0,0,1-5.72-4.83l0-.07L82.87,132H144a4,4,0,0,0,0-8H82.87L52.26,33.37A3.89,3.89,0,0,1,53.44,29,4.13,4.13,0,0,1,56,28a3.88,3.88,0,0,1,1.93.54l168,95.87a4,4,0,0,1,0,7Z"/>`],["light",H`<path d="M230.88,115.69l-168-95.88a14,14,0,0,0-20,16.87L73.66,128,42.81,219.33A14,14,0,0,0,56,238a14.15,14.15,0,0,0,6.93-1.83L230.84,140.1a14,14,0,0,0,0-24.41Zm-5.95,14L57,225.73a2,2,0,0,1-2.86-2.42.42.42,0,0,0,0-.1L84.3,134H144a6,6,0,0,0,0-12H84.3L54.17,32.8a.3.3,0,0,0,0-.1,1.87,1.87,0,0,1,.6-2.2A1.85,1.85,0,0,1,57,30.25l168,95.89a1.93,1.93,0,0,1,1,1.74A2,2,0,0,1,224.93,129.66Z"/>`],["regular",H`<path d="M231.87,114l-168-95.89A16,16,0,0,0,40.92,37.34L71.55,128,40.92,218.67A16,16,0,0,0,56,240a16.15,16.15,0,0,0,7.93-2.1l167.92-96.05a16,16,0,0,0,.05-27.89ZM56,224a.56.56,0,0,0,0-.12L85.74,136H144a8,8,0,0,0,0-16H85.74L56.06,32.16A.46.46,0,0,0,56,32l168,95.83Z"/>`],["bold",H`<path d="M233.86,110.48,65.8,14.58A20,20,0,0,0,37.15,38.64L67.33,128,37.15,217.36A20,20,0,0,0,56,244a20.1,20.1,0,0,0,9.81-2.58l.09-.06,168-96.07a20,20,0,0,0,0-34.81ZM63.19,215.26,88.61,140H144a12,12,0,0,0,0-24H88.61L63.18,40.72l152.76,87.17Z"/>`],["fill",H`<path d="M240,127.89a16,16,0,0,1-8.18,14L63.9,237.9A16.15,16.15,0,0,1,56,240a16,16,0,0,1-15-21.33l27-79.95A4,4,0,0,1,71.72,136H144a8,8,0,0,0,8-8.53,8.19,8.19,0,0,0-8.26-7.47h-72a4,4,0,0,1-3.79-2.72l-27-79.94A16,16,0,0,1,63.84,18.07l168,95.89A16,16,0,0,1,240,127.89Z"/>`],["duotone",H`<path d="M227.91,134.86,59.93,231a8,8,0,0,1-11.44-9.67L80,128,48.49,34.72a8,8,0,0,1,11.44-9.67l168,95.85A8,8,0,0,1,227.9
11101,134.86Z" opacity="0.2"/><path d="M231.87,114l-168-95.89A16,16,0,0,0,40.92,37.34L71.55,128,40.92,218.67A16,16,0,0,0,56,240a16.15,16.15,0,0,0,7.93-2.1l167.92-96.05a16,16,0,0,0,.05-27.89ZM56,224a.56.56,0,0,0,0-.12L85.74,136H144a8,8,0,0,0,0-16H85.74L56.06,32.16A.46.46,0,0,0,56,32l168,95.83Z"/>`]]);ed.styles=ge`
1111    :host {
1112      display: contents;
1113    }
1114  `;Wv([z({type:String,reflect:!0})],ed.prototype,"size",2);Wv([z({type:String,reflect:!0})],ed.prototype,"weight",2);Wv([z({type:String,reflect:!0})],ed.prototype,"color",2);Wv([z({type:Boolean,reflect:!0})],ed.prototype,"mirrored",2);ed=Wv([we("ph-paper-plane-right")],ed)});var Dwe={};Ce(Dwe,{PhPlus:()=>td});var PZe,NZe,Kv,td,Uwe=h(()=>{Ge();Je();tt();rt();nt();Ye();PZe=Object.defineProperty,NZe=Object.getOwnPropertyDescriptor,Kv=(e,t,r,n)=>{for(var o=n>1?void 0:n?NZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&PZe(t,r,o),o},td=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1115      xmlns="http://www.w3.org/2000/svg"
1116      width="${this.size}"
1117      height="${this.size}"
1118      fill="${this.color}"
1119      viewBox="0 0 256 256"
1120      transform=${this.mirrored?"scale(-1, 1)":null}
1121    >
1122      ${td.weightsMap.get((e=this.weight)!=null?e:"regular")}
1123    </svg>`}};td.weightsMap=new Map([["thin",H`<path d="M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"/>`],["light",H`<path d="M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"/>`],["regular",H`<path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/>`],["bold",H`<path d="M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"/>`],["fill",H`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"/>`],["duotone",H`<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"/><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/>`]]);td.styles=ge`
1124    :host {
1125      display: contents;
1126    }
1127  `;Kv([z({type:String,reflect:!0})],td.prototype,"size",2);Kv([z({type:String,reflect:!0})],td.prototype,"weight",2);Kv([z({type:String,reflect:!0})],td.prototype,"color",2);Kv([z({type:Boolean,reflect:!0})],td.prototype,"mirrored",2);td=Kv([we("ph-plus")],td)});var Lwe={};Ce(Lwe,{PhPower:()=>rd});var RZe,OZe,Zv,rd,Mwe=h(()=>{Ge();Je();tt();rt();nt();Ye();RZe=Object.defineProperty,OZe=Object.getOwnPropertyDescriptor,Zv=(e,t,r,n)=>{for(var o=n>1?void 0:n?OZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&RZe(t,r,o),o},rd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1128      xmlns="http://www.w3.org/2000/svg"
1129      width="${this.size}"
1130      height="${this.size}"
1131      fill="${this.color}"
1132      viewBox="0 0 256 256"
1133      transform=${this.mirrored?"scale(-1, 1)":null}
1134    >
1135      ${rd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1136    </svg>`}};rd.weightsMap=new Map([["thin",H`<path d="M124,128V48a4,4,0,0,1,8,0v80a4,4,0,0,1-8,0Zm54.18-75.35a4,4,0,1,0-4.36,6.7C198.08,75.17,212,100.2,212,128a84,84,0,0,1-168,0c0-27.8,13.92-52.83,38.18-68.65a4,4,0,0,0-4.36-6.7C51.24,70,36,97.44,36,128a92,92,0,0,0,184,0C220,97.44,204.76,70,178.18,52.65Z"/>`],["light",H`<path d="M122,128V48a6,6,0,0,1,12,0v80a6,6,0,0,1-12,0Zm57.28-77A6,6,0,0,0,172.72,61C196.41,76.47,210,100.88,210,128a82,82,0,0,1-164,0c0-27.12,13.59-51.53,37.28-67A6,6,0,0,0,76.72,51C49.57,68.68,34,96.75,34,128a94,94,0,0,0,188,0C222,96.75,206.43,68.68,179.28,51Z"/>`],["regular",H`<path d="M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,3
11366.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"/>`],["bold",H`<path d="M116,128V48a12,12,0,0,1,24,0v80a12,12,0,0,1-24,0Zm66.55-82a12,12,0,0,0-13.1,20.1C191.41,80.37,204,103,204,128a76,76,0,0,1-152,0c0-25,12.59-47.63,34.55-61.95A12,12,0,0,0,73.45,46C44.56,64.78,28,94.69,28,128a100,100,0,0,0,200,0C228,94.69,211.44,64.78,182.55,46Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104,104,0,0,0,128,24Zm-8,40a8,8,0,0,1,16,0v64a8,8,0,0,1-16,0Zm8,144A80,80,0,0,1,83.55,61.48a8,8,0,1,1,8.9,13.29,64,64,0,1,0,71.1,0,8,8,0,1,1,8.9-13.29A80,80,0,0,1,128,208Z"/>`],["duotone",H`<path d="M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z" opacity="0.2"/><path d="M120,128V48a8,8,0,0,1,16,0v80a8,8,0,0,1-16,0Zm60.37-78.7a8,8,0,0,0-8.74,13.4C194.74,77.77,208,101.57,208,128a80,80,0,0,1-160,0c0-26.43,13.26-50.23,36.37-65.3a8,8,0,0,0-8.74-13.4C47.9,67.38,32,96.06,32,128a96,96,0,0,0,192,0C224,96.06,208.1,67.38,180.37,49.3Z"/>`]]);rd.styles=ge`
1137    :host {
1138      display: contents;
1139    }
1140  `;Zv([z({type:String,reflect:!0})],rd.prototype,"size",2);Zv([z({type:String,reflect:!0})],rd.prototype,"weight",2);Zv([z({type:String,reflect:!0})],rd.prototype,"color",2);Zv([z({type:Boolean,reflect:!0})],rd.prototype,"mirrored",2);rd=Zv([we("ph-power")],rd)});var Hwe={};Ce(Hwe,{PhPuzzlePiece:()=>nd});var BZe,kZe,Gv,nd,$we=h(()=>{Ge();Je();tt();rt();nt();Ye();BZe=Object.defineProperty,kZe=Object.getOwnPropertyDescriptor,Gv=(e,t,r,n)=>{for(var o=n>1?void 0:n?kZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&BZe(t,r,o),o},nd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1141      xmlns="http://www.w3.org/2000/svg"
1142      width="${this.size}"
1143      height="${this.size}"
1144      fill="${this.color}"
1145      viewBox="0 0 256 256"
1146      transform=${this.mirrored?"scale(-1, 1)":null}
1147    >
1148      ${nd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1149    </svg>`}};nd.weightsMap=new Map([["thin",H`<path d="M218.14,161.93a4,4,0,0,0-3.86-.24,24,24,0,0,1-34.23-23.25,24,24,0,0,1,34.23-20.13A4,4,0,0,0,220,114.7V72a12,12,0,0,0-12-12H167a32,32,0,1,0-62.91-10.33A32.57,32.57,0,0,0,105,60H64A12,12,0,0,0,52,72v37a32,32,0,1,0-10.33,62.91A32.28,32.28,0,0,0,52,171v37a12,12,0,0,0,12,12H208a12,12,0,0,0,12-12V165.31A4,4,0,0,0,218.14,161.93ZM212,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V165.31a4,4,0,0,0-1.86-3.38,4,4,0,0,0-3.85-.24,24,24,0,0,1-34.24-20.13,24,24,0,0,1,34.24-23.25A4,4,0,0,0,60,114.7V72a4,4,0,0,1,4-4h46.69a4,4,0,0,0,3.62-5.71,24,24,0,0,1,20.13-34.24,24,24,0,0,1,23.25,34.24A4,4,0,0,0,161.31,68H208a4,4,0,0,1,4,4v37a32.57,32.57,0,0,0-10.33-.94A32,32,0,1,0,212,171Z"/>`],["light",H`<path d="M219.21,160.24a6,6,0,0,0-5.78-.35,22,22,0,1,1-11.05-41.83,22.15,22.15,0,0,1,11.05,2.06A6,6,0,0,0,222,114.7V72a14,14,0,0,0-14-14H169.48a35,35,0,0,0,.52-6,34.1,34.1,0,0,0-10.73-24.78,33.64,33.64,0,0,0-25.45-9.15A34,34,0,0,0,102.54,58H64A14,14,0,0,0,50,72v34.53a34,34,0,0,0-30.79,10.2,34,34,0,0,0,22.31,57.18,34.34,34.34,0,0,0,8.48-.44V208a14,14,0,0,0,14,14H208a14,14,0,0,0,14-14V165.31A6,6,0,0,0,219.21,160.24ZM210,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V165.31a6,6,0,0,0-6-6,5.92,5.92,0,0,0-2.57.58,22,22,0,0,1-31.38-18.46,22,22,0,0,1,31.38-21.31A6,6,0,0,0,62,114.7V72a2,2,0,0,1,2-2h46.69a6,6,0,0,0,5.42-8.57,22.25,22.25,0,0,1-2-11,22,22,0,1,1,41.83,11A6,6,0,0,0,161.3,70H208a2,2,0,0,1,2,2v34.54a34,34,0,0,0-39.93,31.28,33.71,33.71,0,0,0,9.14,25.45A34.15,34.15,0,0,0,210,173.48Z"/>`],["regular",H`<path d="M220.27,158.54a8,8,0,0,0-7.7-.46,20,20,0,1,1,0-36.16A8,8,0,0,0,224,114.69V72a16,16,0,0,0-16-16H171.78a35.36,35.36,0,0,0,.22-4,36.11,36.11,0,0,0-11.36-26.24,36,36,0,0,0-60.55,23.62,36.56,36.56,0,0,0,.14,6.62H64A16,16,0,0,0,48,72v32.22a35.36,35.36,0,0,0-4-.22,36.12,36.12,0,0,0-26.24,11.36,35.7,35.7,0,0,0-9.69,27,36.08,36.08,0,0,0,33.31,33.6,35.68,35.68,0,0,0,6.62-.14V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V165.31A8,8,0,0,0,220.27,158.54ZM208,208H64V165.31a8,8,0,0,0-11.43-7.23,20,20,0,1,1,0-36.16A8,8,0,0,0,64,114.69V72h46.69a8,8,0,0,0,7.23-11.43,20,20,0,1,1,36.16,0A8,8,0,0,0,161.31,72H208v32.23a35.68,35.68,0,0,0-6.62-.14A36,36,0,0,0,204,176a35.36,35.36,0,0,0,4-.22Z"/>`],["bold",H`<path d="M222.41,155.16a12,12,0,0,0-11.56-.69A16,16,0,0,1,188,139,16.2,16.2,0,0,1,202.8,124a15.83,15.83,0,0,1,8,1.5A12,12,0,0,0,228,114.7V72a20,20,0,0,0-20-20H176a40.15,40.15,0,0,0-12.62-29.16,39.67,39.67,0,0,0-29.94-10.76,40.08,40.08,0,0,0-37.34,37C96,50.07,96,51,96,52H64A20,20,0,0,0,44,72v28a40.15,40.15,0,0,0-29.16,12.62A40,40,0,0,0,41.1,179.9a28.3,28.3,0,0,0,2.9.1v28a20,20,0,0,0,20,20H208a20,20,0,0,0,20-20V165.31A12,12,0,0,0,222.41,155.16ZM204,204H68V165.31a12,12,0,0,0-17.15-10.84A15.9,15.9,0,0,1,42.8,156,16.2,16.2,0,0,1,28,141.06a16,16,0,0,1,22.82-15.52A12,12,0,0,0,68,114.7V76h42.7a12,12,0,0,0,10.83-17.15A15.9,15.9,0,0,1,120,50.8,16.19,16.19,0,0,1,134.94,36a16,16,0,0,1,15.53,22.81A12,12,0,0,0,161.31,76H204v24c-1,0-1.93,0-2.9.11A40,40,0,0,0,204,180h0Z"/>`],["fill",H`<path d="M165.78,224H208a16,16,0,0,0,16-16V170.35A8,8,0,0,0,212.94,163a23.37,23.37,0,0,1-8.94,1.77c-13.23,0-24-11.1-24-24.73s10.77-24.73,24-24.73a23.37,23.37,0,0,1,8.94,1.77A8,8,0,0,0,224,109.65V72a16,16,0,0,0-16-16H171.78a35.36,35.36,0,0,0,.22-4,36,36,0,0,0-72,0,35.36,35.36,0,0,0,.22,4H64A16,16,0,0,0,48,72v32.22a35.36,35.36,0,0,0-4-.22,36,36,0,0,0,0,72,35.36,35.36,0,0,0,4-.22V208a16,16,0,0,0,16,16h42.22"/>`],["duotone",H`<path d="M204,168a28,28,0,0,0,12-2.69V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V165.31a28,28,0,1,1,0-50.62V72a8,8,0,0,1,8-8h46.69a28,28,0,1,1,50.61,0H208a8,8,0,0,1,8,8v42.69A28,28,0,1,0,204,168Z" opacity="0.2"/><path d="M220.27,158.54a8,8,0,0,0-7.7-.46,20,20,0,1,1,0-36.16A8,8,0,0,0,224,114.69V72a16,16,0,0,0-16-16H171.78a35.36,35.36,0,0,0,.22-4,36.15,36.15,0,0,0-11.36-26.25,36,36,0,0,0-60.55,23.63,36.56,36.56,0,0,0,.14,6.62H64A16,16,0,0,0,48,72v32.22a35.36,35.36,0,0,0-4-.22,36.12,36.12,0,0,0-26.24,11.36,35.7,35.7,0,0,0-9.69,27,36.08,36.08,0,0,0,33.31,33.6,36.56,36.56,0,0,0,6.62-.14V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V165.31A8,8,0,0,0,220.27,
1149158.54ZM208,208H64V165.31a8,8,0,0,0-11.43-7.23,20,20,0,1,1,0-36.16A8,8,0,0,0,64,114.69V72h46.69a8,8,0,0,0,7.23-11.43,20,20,0,1,1,36.16,0A8,8,0,0,0,161.31,72H208v32.23a35.68,35.68,0,0,0-6.62-.14A36,36,0,0,0,204,176a35.36,35.36,0,0,0,4-.22Z"/>`]]);nd.styles=ge`
1150    :host {
1151      display: contents;
1152    }
1153  `;Gv([z({type:String,reflect:!0})],nd.prototype,"size",2);Gv([z({type:String,reflect:!0})],nd.prototype,"weight",2);Gv([z({type:String,reflect:!0})],nd.prototype,"color",2);Gv([z({type:Boolean,reflect:!0})],nd.prototype,"mirrored",2);nd=Gv([we("ph-puzzle-piece")],nd)});var Fwe={};Ce(Fwe,{PhQrCode:()=>od});var DZe,UZe,Yv,od,Vwe=h(()=>{Ge();Je();tt();rt();nt();Ye();DZe=Object.defineProperty,UZe=Object.getOwnPropertyDescriptor,Yv=(e,t,r,n)=>{for(var o=n>1?void 0:n?UZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&DZe(t,r,o),o},od=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1154      xmlns="http://www.w3.org/2000/svg"
1155      width="${this.size}"
1156      height="${this.size}"
1157      fill="${this.color}"
1158      viewBox="0 0 256 256"
1159      transform=${this.mirrored?"scale(-1, 1)":null}
1160    >
1161      ${od.weightsMap.get((e=this.weight)!=null?e:"regular")}
1162    </svg>`}};od.weightsMap=new Map([["thin",H`<path d="M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm-4,36H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM200,44H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm-64,72V144a4,4,0,0,1,8,0v32a4,4,0,0,1-8,0Zm72-16a4,4,0,0,1-4,4H180v44a4,4,0,0,1-4,4H144a4,4,0,0,1,0-8h28V144a4,4,0,0,1,8,0v12h28A4,4,0,0,1,212,160Zm0,32v16a4,4,0,0,1-8,0V192a4,4,0,0,1,8,0Z"/>`],["light",H`<path d="M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-2,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2ZM200,42H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-64,72V144a6,6,0,0,1,12,0v32a6,6,0,0,1-12,0Zm76-16a6,6,0,0,1-6,6H182v42a6,6,0,0,1-6,6H144a6,6,0,0,1,0-12h26V144a6,6,0,0,1,12,0v10h26A6,6,0,0,1,214,160Zm0,32v16a6,6,0,0,1-12,0V192a6,6,0,0,1,12,0Z"/>`],["regular",H`<path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm0,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48ZM200,40H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-64,72V144a8,8,0,0,1,16,0v32a8,8,0,0,1-16,0Zm80-16a8,8,0,0,1-8,8H184v40a8,8,0,0,1-8,8H144a8,8,0,0,1,0-16h24V144a8,8,0,0,1,16,0v8h24A8,8,0,0,1,216,160Zm0,32v16a8,8,0,0,1-16,0V192a8,8,0,0,1,16,0Z"/>`],["bold",H`<path d="M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96Zm4,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-60,76V148a12,12,0,0,1,24,0v24a12,12,0,0,1-24,0Zm84-8a12,12,0,0,1-12,12H196v32a12,12,0,0,1-12,12H148a12,12,0,0,1,0-24h24V148a12,12,0,0,1,24,0v4h12A12,12,0,0,1,220,164Z"/>`],["fill",H`<path d="M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm-16,80H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96-96H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM144,184a8,8,0,0,0,8-8V144a8,8,0,0,0-16,0v32A8,8,0,0,0,144,184Zm64-32H184v-8a8,8,0,0,0-16,0v56H144a8,8,0,0,0,0,16h32a8,8,0,0,0,8-8V168h24a8,8,0,0,0,0-16Zm0,32a8,8,0,0,0-8,8v16a8,8,0,0,0,16,0V192A8,8,0,0,0,208,184Z"/>`],["duotone",H`<path d="M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm-8,88H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96-96H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Z" opacity="0.2"/><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm0,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48ZM200,40H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-64,72V144a8,8,0,0,1,16,0v32a8,8,0,0,1-16,0Zm80-16a8,8,0,0,1-8,8H184v40a8,8,0,0,1-8,8H144a8,8,0,0,1,0-16h24V144a8,8,0,0,1,16,0v8h24A8,8,0,0,1,216,160Zm0,32v16a8,8,0,0,1-16,0V192a8,8,0,0,1,16,0Z"/>`]]);od.styles=ge`
1163    :host {
1164      display: contents;
1165    }
1166  `;Yv([z({type:String,reflect:!0})],od.prototype,"size",2);Yv([z({type:String,reflect:!0})],od.prototype,"weight",2);Yv([z({type:String,reflect:!0})],od.prototype,"color",2);Yv([z({type:Boolean,reflect:!0})],od.prototype,"mirrored",2);od=Yv([we("ph-qr-code")],od)});var zwe={};Ce(zwe,{PhQuestion:()=>sd});var LZe,MZe,Jv,sd,jwe=h(()=>{Ge();Je();tt();rt();nt();Ye();LZe=Object.defineProperty,MZe=Object.getOwnPropertyDescriptor,Jv=(e,t,r,n)=>{for(var o=n>1?void 0:n?MZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&LZe(t,r,o),o},sd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1167      xmlns="http://www.w3.org/2000/svg"
1168      width="${this.size}"
1169      height="${this.size}"
1170      fill="${this.color}"
1171      viewBox="0 0 256 256"
1172      transform=${this.mirrored?"scale(-1, 1)":null}
1173    >
1174      ${sd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1175    </svg>`}};sd.weightsMap=new Map([["thin",H`<path d="M136,180a8,8,0,1,1-8-8A8,8,0,0,1,136,180ZM128,76c-19.85,0-36,14.36-36,32v4a4,4,0,0,0,8,0v-4c0-13.23,12.56-24,28-24s28,10.77,28,24-12.56,24-28,24a4,4,0,0,0-4,4v8a4,4,0,0,0,8,0v-4.2c18-1.77,32-15.36,32-31.8C164,90.36,147.85,76,128,76Zm100,52A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"/>`],["light",H`<path d="M138,180a10,10,0,1,1-10-10A10,10,0,0,1,138,180ZM128,74c-21,0-38,15.25-38,34v4a6,6,0,0,0,12,0v-4c0-12.13,11.66-22,26-22s26,9.87,26,22-11.66,22-26,22a6,6,0,0,0-6,6v8a6,6,0,0,0,12,0v-2.42c18.11-2.58,32-16.66,32-33.58C166,89.25,149,74,128,74Zm102,54A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"/>`],["regular",H`<path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/>`],["bold",H`<path d="M144,180a16,16,0,1,1-16-16A16,16,0,0,1,144,180Zm92-52A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128ZM128,64c-24.26,0-44,17.94-44,40v4a12,12,0,0,0,24,0v-4c0-8.82,9-16,20-16s20,7.18,20,16-9,16-20,16a12,12,0,0,0-12,12v8a12,12,0,0,0,23.73,2.56C158.31,137.88,172,122.37,172,104,172,81.94,152.26,64,128,64Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,168a12,12,0,1,1,12-12A12,12,0,0,1,128,192Zm8-48.72V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.24,139.93,136,143.28Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/>`]]);sd.styles=ge`
1176    :host {
1177      display: contents;
1178    }
1179  `;Jv([z({type:String,reflect:!0})],sd.prototype,"size",2);Jv([z({type:String,reflect:!0})],sd.prototype,"weight",2);Jv([z({type:String,reflect:!0})],sd.prototype,"color",2);Jv([z({type:Boolean,reflect:!0})],sd.prototype,"mirrored",2);sd=Jv([we("ph-question")],sd)});var qwe={};Ce(qwe,{PhQuestionMark:()=>id});var HZe,$Ze,Qv,id,Wwe=h(()=>{Ge();Je();tt();rt();nt();Ye();HZe=Object.defineProperty,$Ze=Object.getOwnPropertyDescriptor,Qv=(e,t,r,n)=>{for(var o=n>1?void 0:n?$Ze(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&HZe(t,r,o),o},id=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1180      xmlns="http://www.w3.org/2000/svg"
1181      width="${this.size}"
1182      height="${this.size}"
1183      fill="${this.color}"
1184      viewBox="0 0 256 256"
1185      transform=${this.mirrored?"scale(-1, 1)":null}
1186    >
1187      ${id.weightsMap.get((e=this.weight)!=null?e:"regular")}
1188    </svg>`}};id.weightsMap=new Map([["thin",H`<path d="M188,96c0,27.51-24.77,50.09-56,51.89V160a4,4,0,0,1-8,0V144a4,4,0,0,1,4-4c28.67,0,52-19.74,52-44s-23.33-44-52-44S76,71.74,76,96a4,4,0,0,1-8,0c0-28.67,26.92-52,60-52S188,67.33,188,96ZM128,196a12,12,0,1,0,12,12A12,12,0,0,0,128,196Z"/>`],["light",H`<path d="M190,96c0,28-24.62,51.11-56,53.75V160a6,6,0,0,1-12,0V144a6,6,0,0,1,6-6c27.57,0,50-18.84,50-42s-22.43-42-50-42S78,72.84,78,96a6,6,0,0,1-12,0c0-29.78,27.81-54,62-54S190,66.22,190,96Zm-62,98a14,14,0,1,0,14,14A14,14,0,0,0,128,194Z"/>`],["regular",H`<path d="M192,96c0,28.51-24.47,52.11-56,55.56V160a8,8,0,0,1-16,0V144a8,8,0,0,1,8-8c26.47,0,48-17.94,48-40s-21.53-40-48-40S80,73.94,80,96a8,8,0,0,1-16,0c0-30.88,28.71-56,64-56S192,65.12,192,96Zm-64,96a16,16,0,1,0,16,16A16,16,0,0,0,128,192Z"/>`],["bold",H`<path d="M196,96c0,29.47-24.21,54.05-56,59.06V156a12,12,0,0,1-24,0V144a12,12,0,0,1,12-12c24.26,0,44-16.15,44-36s-19.74-36-44-36S84,76.15,84,96a12,12,0,0,1-24,0c0-33.08,30.5-60,68-60S196,62.92,196,96Zm-68,92a20,20,0,1,0,20,20A20,20,0,0,0,128,188Z"/>`],["fill",H`<path d="M200,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V40A16,16,0,0,0,200,24ZM136,143.28V144a8,8,0,0,1-16,0v-8a8,8,0,0,1,8-8c13.23,0,24
1188-9,24-20s-10.77-20-24-20-24,9-24,20v4a8,8,0,0,1-16,0v-4c0-19.85,17.94-36,40-36s40,16.15,40,36C168,125.38,154.23,139.93,136,143.28ZM140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/>`],["duotone",H`<path d="M216,40V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V40A16,16,0,0,1,56,24H200A16,16,0,0,1,216,40Z" opacity="0.2"/><path d="M192,96c0,28.51-24.47,52.11-56,55.56V160a8,8,0,0,1-16,0V144a8,8,0,0,1,8-8c26.47,0,48-17.94,48-40s-21.53-40-48-40S80,73.94,80,96a8,8,0,0,1-16,0c0-30.88,28.71-56,64-56S192,65.12,192,96Zm-64,96a16,16,0,1,0,16,16A16,16,0,0,0,128,192Z"/>`]]);id.styles=ge`
1189    :host {
1190      display: contents;
1191    }
1192  `;Qv([z({type:String,reflect:!0})],id.prototype,"size",2);Qv([z({type:String,reflect:!0})],id.prototype,"weight",2);Qv([z({type:String,reflect:!0})],id.prototype,"color",2);Qv([z({type:Boolean,reflect:!0})],id.prototype,"mirrored",2);id=Qv([we("ph-question-mark")],id)});var Kwe={};Ce(Kwe,{PhSealCheck:()=>ad});var FZe,VZe,Xv,ad,Zwe=h(()=>{Ge();Je();tt();rt();nt();Ye();FZe=Object.defineProperty,VZe=Object.getOwnPropertyDescriptor,Xv=(e,t,r,n)=>{for(var o=n>1?void 0:n?VZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&FZe(t,r,o),o},ad=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1193      xmlns="http://www.w3.org/2000/svg"
1194      width="${this.size}"
1195      height="${this.size}"
1196      fill="${this.color}"
1197      viewBox="0 0 256 256"
1198      transform=${this.mirrored?"scale(-1, 1)":null}
1199    >
1200      ${ad.weightsMap.get((e=this.weight)!=null?e:"regular")}
1201    </svg>`}};ad.weightsMap=new Map([["thin",H`<path d="M223,105.58c-4-4.2-8.2-8.54-10-12.8-1.65-4-1.73-9.53-1.82-15.41-.14-9-.29-19.19-6.83-25.74s-16.74-6.69-25.74-6.83c-5.88-.09-11.43-.17-15.41-1.82-4.26-1.76-8.6-5.93-12.8-9.95-6.68-6.41-13.59-13-22.42-13s-15.74,6.62-22.42,13c-4.2,4-8.54,8.2-12.8,10-4,1.65-9.53,1.73-15.41,1.82-9,.14-19.19.29-25.74,6.83S44.94,68.37,44.8,77.37c-.09,5.88-.17,11.43-1.82,15.41-1.76,4.26-5.93,8.6-9.95,12.8-6.41,6.68-13,13.59-13,22.42s6.62,15.74,13,22.42c4,4.2,8.2,8.54,10,12.8,1.65,4,1.73,9.53,1.82,15.41.14,9,.29,19.19,6.83,25.74s16.74,6.69,25.74,6.83c5.88.09,11.43.17,15.41,1.82,4.26,1.76,8.6,5.93,12.8,9.95,6.68,6.41,13.59,13,22.42,13s15.74-6.62,22.42-13c4.2-4,8.54-8.2,12.8-10,4-1.65,9.53-1.73,15.41-1.82,9-.14,19.19-.29,25.74-6.83s6.69-16.74,6.83-25.74c.09-5.88.17-11.43,1.82-15.41,1.76-4.26,5.93-8.6,9.95-12.8,6.41-6.68,13-13.59,13-22.42S229.38,112.26,223,105.58Zm-5.78,39.3c-4.54,4.73-9.24,9.63-11.57,15.28-2.23,5.39-2.33,12-2.43,18.35-.12,8.2-.24,16-4.49,20.2s-12,4.37-20.2,4.49c-6.37.1-13,.2-18.35,2.43-5.65,2.33-10.55,7-15.28,11.57C139.09,222.75,133.62,228,128,228s-11.09-5.25-16.88-10.8c-4.73-4.54-9.63-9.24-15.28-11.57-5.39-2.23-12-2.33-18.35-2.43-8.2-.12-15.95-.24-20.2-4.49s-4.37-12-4.49-20.2c-.1-6.37-.2-13-2.43-18.35-2.33-5.65-7-10.55-11.57-15.28C33.25,139.09,28,133.62,28,128s5.25-11.09,10.8-16.88c4.54-4.73,9.24-9.63,11.57-15.28,2.23-5.39,2.33-12,2.43-18.35.12-8.2.24-15.95,4.49-20.2s12-4.37,20.2-4.49c6.37-.1,13-.2,18.35-2.43,5.65-2.33,10.55-7,15.28-11.57C116.91,33.25,122.38,28,128,28s11.09,5.25,16.88,10.8c4.73,4.54,9.63,9.24,15.28,11.57,5.39,2.23,12,2.33,18.35,2.43,8.2.12,16,.24,20.2,4.49s4.37,12,4.49,20.2c.1,6.37.2,13,2.43,18.35,2.33,5.65,7,10.55,11.57,15.28,5.55,5.79,10.8,11.26,10.8,16.88S222.75,139.09,217.2,144.88Zm-46.37-43.71a4,4,0,0,1,0,5.66l-56,56a4,4,0,0,1-5.66,0l-24-24a4,4,0,0,1,5.66-5.66L112,154.34l53.17-53.17A4,4,0,0,1,170.83,101.17Z"/>`],["light",H`<path d="M224.42,104.2c-3.9-4.07-7.93-8.27-9.55-12.18-1.5-3.63-1.58-9-1.67-14.68-.14-9.38-.3-20-7.42-27.12S188,42.94,178.66,42.8c-5.68-.09-11-.17-14.68-1.67-3.91-1.62-8.11-5.65-12.18-9.55C145.16,25.22,137.64,18,128,18s-17.16,7.22-23.8,13.58c-4.07,3.9-8.27,7.93-12.18,9.55-3.63,1.5-9,1.58-14.68,1.67-9.38.14-20,.3-27.12,7.42S42.94,68,42.8,77.34c-.09,5.68-.17,11-1.67,14.68-1.62,3.91-5.65,8.11-9.55,12.18C25.22,110.84,18,118.36,18,128s7.22,17.16,13.58,23.8c3.9,4.07,7.93,8.27,9.55,12.18,1.5,3.63,1.58,9,1.67,14.68.14,9.38.3,20,7.42,27.12S68,213.06,77.34,213.2c5.68.09,11,.17,14.68,1.67,3.91,1.62,8.11,5.65,12.18,9.55C110.84,230.78,118.36,238,128,238s17.16-7.22,23.8-13.58c4.07-3.9,8.27-7.93,12.18-9.55,3.63-1.5,9-1.58,14.68-1.67,9.38-.14,20-.3,27.12-7.42s7.28-17.74,7.42-27.12c.09-5.68.17-11,1.67-14.68,1.62-3.91,5.65-8.11,9.55-12.18C230.78,145.16,238,137.64,238,128S230.78,110.84,224.42,104.2Zm-8.66,39.3c-4.67,4.86-9.5,9.9-12,15.9-2.38,5.74-2.48,12.52-2.58,19.08-.11,7.44-.23,15.14-3.9,18.82s-11.38,3.79-18.82,3.9c-6.56.1-13.34.2-19.08,2.58-6,2.48-11,7.31-15.91,12-5.25,5-10.68,10.24-15.49,10.24s-10.24-5.21-15.5-10.24c-4.86-4.67-9.9-9.5-15.9-12-5.74-2.38-12.52-2.48-19.08-2.58-7.44-.11-15.14-.23-18.82-3.9s-3.79-11.38-3.9-18.82c-.1-6.56-.2-13.34-2.58-19.08-2.48-6-7.31-11-12-15.91C35.21,138.24,30,132.81,30,128s5.21-10.24,10.24-15.5c4.67-4.86,9.5-9.9,12-15.9,2.38-5.74,2.48-12.52,2.58-19.08.11-7.44.23-15.14,3.9-18.82s11.38-3.79,18.82-3.9c6.56-.1,13.34-.2,19.08-2.58,6-2.48,11-7.31,15.91-12C117.76,35.21,123.19,30,128,30s10.24,5.21,15.5,10.24c4.86,4.67,9.9,9.5,15.9,12,5.74,2.38,12.52,2.48,19.08,2.58,7.44.11,15.14.23,18.82,3.9s3.79,11.38,3.9,18.82c.1,6.56.2,13.34,2.58,19.08,2.48,6,7.31,11,12,15.91,5,5.25,10.24,10.68,10.24,15.49S220.79,138.24,215.76,143.5ZM172.24,99.76a6,6,0,0,1,0,8.48l-56,56a6,6,0,0,1-8.48,0l-24-24a6,6,0,0,1,8.48-8.48L112,151.51l51.76-51.75A6,6,0,0,1,172.24,99.76Z"/>`],["regular",H`<path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.
120118,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-11.55,39.29c-4.79,5-9.75,10.17-12.38,16.52-2.52,6.1-2.63,13.07-2.73,19.82-.1,7-.21,14.33-3.32,17.43s-10.39,3.22-17.43,3.32c-6.75.1-13.72.21-19.82,2.73-6.35,2.63-11.52,7.59-16.52,12.38S132,224,128,224s-9.15-4.92-14.11-9.69-10.17-9.75-16.52-12.38c-6.1-2.52-13.07-2.63-19.82-2.73-7-.1-14.33-.21-17.43-3.32s-3.22-10.39-3.32-17.43c-.1-6.75-.21-13.72-2.73-19.82-2.63-6.35-7.59-11.52-12.38-16.52S32,132,32,128s4.92-9.15,9.69-14.11,9.75-10.17,12.38-16.52c2.52-6.1,2.63-13.07,2.73-19.82.1-7,.21-14.33,3.32-17.43S70.51,56.9,77.55,56.8c6.75-.1,13.72-.21,19.82-2.73,6.35-2.63,11.52-7.59,16.52-12.38S124,32,128,32s9.15,4.92,14.11,9.69,10.17,9.75,16.52,12.38c6.1,2.52,13.07,2.63,19.82,2.73,7,.1,14.33.21,17.43,3.32s3.22,10.39,3.32,17.43c.1,6.75.21,13.72,2.73,19.82,2.63,6.35,7.59,11.52,12.38,16.52S224,124,224,128,219.08,137.15,214.31,142.11ZM173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34Z"/>`],["bold",H`<path d="M228.75,100.05c-3.52-3.67-7.15-7.46-8.34-10.33-1.06-2.56-1.14-7.83-1.21-12.47-.15-10-.34-22.44-9.18-31.27s-21.27-9-31.27-9.18c-4.64-.07-9.91-.15-12.47-1.21-2.87-1.19-6.66-4.82-10.33-8.34C148.87,20.46,140.05,12,128,12s-20.87,8.46-27.95,15.25c-3.67,3.52-7.46,7.15-10.33,8.34-2.56,1.06-7.83,1.14-12.47,1.21C67.25,37,54.81,37.14,46,46S37,67.25,36.8,77.25c-.07,4.64-.15,9.91-1.21,12.47-1.19,2.87-4.82,6.66-8.34,10.33C20.46,107.13,12,116,12,128S20.46,148.87,27.25,156c3.52,3.67,7.15,7.46,8.34,10.33,1.06,2.56,1.14,7.83,1.21,12.47.15,10,.34,22.44,9.18,31.27s21.27,9,31.27,9.18c4.64.07,9.91.15,12.47,1.21,2.87,1.19,6.66,4.82,10.33,8.34C107.13,235.54,116,244,128,244s20.87-8.46,27.95-15.25c3.67-3.52,7.46-7.15,10.33-8.34,2.56-1.06,7.83-1.14,12.47-1.21,10-.15,22.44-.34,31.27-9.18s9-21.27,9.18-31.27c.07-4.64.15-9.91,1.21-12.47,1.19-2.87,4.82-6.66,8.34-10.33C235.54,148.87,244,140.05,244,128S235.54,107.13,228.75,100.05Zm-17.32,39.29c-4.82,5-10.28,10.72-13.19,17.76-2.82,6.8-2.93,14.16-3,21.29-.08,5.36-.19,12.71-2.15,14.66s-9.3,2.07-14.66,2.15c-7.13.11-14.49.22-21.29,3-7,2.91-12.73,8.37-17.76,13.19C135.78,214.84,130.4,220,128,220s-7.78-5.16-11.34-8.57c-5-4.82-10.72-10.28-17.76-13.19-6.8-2.82-14.16-2.93-21.29-3-5.36-.08-12.71-.19-14.66-2.15s-2.07-9.3-2.15-14.66c-.11-7.13-.22-14.49-3-21.29-2.91-7-8.37-12.73-13.19-17.76C41.16,135.78,36,130.4,36,128s5.16-7.78,8.57-11.34c4.82-5,10.28-10.72,13.19-17.76,2.82-6.8,2.93-14.16,3-21.29C60.88,72.25,61,64.9,63,63s9.3-2.07,14.66-2.15c7.13-.11,14.49-.22,21.29-3,7-2.91,12.73-8.37,17.76-13.19C120.22,41.16,125.6,36,128,36s7.78,5.16,11.34,8.57c5,4.82,10.72,10.28,17.76,13.19,6.8,2.82,14.16,2.93,21.29,3,5.36.08,12.71.19,14.66,2.15s2.07,9.3,2.15,14.66c.11,7.13.22,14.49,3,21.29,2.91,7,8.37,12.73,13.19,17.76,3.41,3.56,8.57,8.94,8.57,11.34S214.84,135.78,211.43,139.34ZM176.49,95.51a12,12,0,0,1,0,17l-56,56a12,12,0,0,1-17,0l-24-24a12,12,0,1,1,17-17L112,143l47.51-47.52A12,12,0,0,1,176.49,95.51Z"/>`],["fill",H`<path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.18,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-52.2,6.84-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"/>`],["duotone",H`<path d="M232,128c0,12.51-17.82,21.95-22.68,33.69-4.68,11.32,1.42,30.65-7.78,39.85s-28.53,3.1-39.85,7.78C150,214.18,140.5,232,128,232s-22-17.82-33.69-22.68c-11.32-4.68-30.65,1.42-39.85-7.78s-3.1-28.53-7.78-39.85C41.82,150,24,140.5,24,128s17.82-22,22.68-33.69C51.36,83,45.26,63.66,54.46,54.46S83,51.36,94.31,46.68C106.05,41.82,115.5,24,128,24S150,41.82,161.69,46.68c11.32,4.68,30.65-1.42,39.85,7.78s3.1,28.53,7.78,39.85C214.18,106.05,232,115.5,232,128Z" opacity="0.2"/><path d="M225.86,102.82c-3.77-3.94-7.67-8-9.14-11.57-1.36-3.27-1.44-8.69-1.52-13.94-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52-3.56-1.47-7.63-5.37-11.57-9.14C146.28,23.51,138.44,16,128,16s-18.27,7.51-25.
120118,14.14c-3.94,3.77-8,7.67-11.57,9.14C88,40.64,82.56,40.72,77.31,40.8c-9.76.15-20.82.31-28.51,8S41,67.55,40.8,77.31c-.08,5.25-.16,10.67-1.52,13.94-1.47,3.56-5.37,7.63-9.14,11.57C23.51,109.72,16,117.56,16,128s7.51,18.27,14.14,25.18c3.77,3.94,7.67,8,9.14,11.57,1.36,3.27,1.44,8.69,1.52,13.94.15,9.76.31,20.82,8,28.51s18.75,7.85,28.51,8c5.25.08,10.67.16,13.94,1.52,3.56,1.47,7.63,5.37,11.57,9.14C109.72,232.49,117.56,240,128,240s18.27-7.51,25.18-14.14c3.94-3.77,8-7.67,11.57-9.14,3.27-1.36,8.69-1.44,13.94-1.52,9.76-.15,20.82-.31,28.51-8s7.85-18.75,8-28.51c.08-5.25.16-10.67,1.52-13.94,1.47-3.56,5.37-7.63,9.14-11.57C232.49,146.28,240,138.44,240,128S232.49,109.73,225.86,102.82Zm-11.55,39.29c-4.79,5-9.75,10.17-12.38,16.52-2.52,6.1-2.63,13.07-2.73,19.82-.1,7-.21,14.33-3.32,17.43s-10.39,3.22-17.43,3.32c-6.75.1-13.72.21-19.82,2.73-6.35,2.63-11.52,7.59-16.52,12.38S132,224,128,224s-9.15-4.92-14.11-9.69-10.17-9.75-16.52-12.38c-6.1-2.52-13.07-2.63-19.82-2.73-7-.1-14.33-.21-17.43-3.32s-3.22-10.39-3.32-17.43c-.1-6.75-.21-13.72-2.73-19.82-2.63-6.35-7.59-11.52-12.38-16.52S32,132,32,128s4.92-9.15,9.69-14.11,9.75-10.17,12.38-16.52c2.52-6.1,2.63-13.07,2.73-19.82.1-7,.21-14.33,3.32-17.43S70.51,56.9,77.55,56.8c6.75-.1,13.72-.21,19.82-2.73,6.35-2.63,11.52-7.59,16.52-12.38S124,32,128,32s9.15,4.92,14.11,9.69,10.17,9.75,16.52,12.38c6.1,2.52,13.07,2.63,19.82,2.73,7,.1,14.33.21,17.43,3.32s3.22,10.39,3.32,17.43c.1,6.75.21,13.72,2.73,19.82,2.63,6.35,7.59,11.52,12.38,16.52S224,124,224,128,219.08,137.15,214.31,142.11ZM173.66,98.34a8,8,0,0,1,0,11.32l-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35A8,8,0,0,1,173.66,98.34Z"/>`]]);ad.styles=ge`
1202    :host {
1203      display: contents;
1204    }
1205  `;Xv([z({type:String,reflect:!0})],ad.prototype,"size",2);Xv([z({type:String,reflect:!0})],ad.prototype,"weight",2);Xv([z({type:String,reflect:!0})],ad.prototype,"color",2);Xv([z({type:Boolean,reflect:!0})],ad.prototype,"mirrored",2);ad=Xv([we("ph-seal-check")],ad)});var Gwe={};Ce(Gwe,{PhSignOut:()=>cd});var zZe,jZe,e5,cd,Ywe=h(()=>{Ge();Je();tt();rt();nt();Ye();zZe=Object.defineProperty,jZe=Object.getOwnPropertyDescriptor,e5=(e,t,r,n)=>{for(var o=n>1?void 0:n?jZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&zZe(t,r,o),o},cd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1206      xmlns="http://www.w3.org/2000/svg"
1207      width="${this.size}"
1208      height="${this.size}"
1209      fill="${this.color}"
1210      viewBox="0 0 256 256"
1211      transform=${this.mirrored?"scale(-1, 1)":null}
1212    >
1213      ${cd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1214    </svg>`}};cd.weightsMap=new Map([["thin",H`<path d="M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z"/>`],["light",H`<path d="M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z"/>`],["regular",H`<path d="M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"/>`],["bold",H`<path d="M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z"/>`],["fill",H`<path d="M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z"/>`],["duotone",H`<path d="M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z" opacity="0.2"/><path d="M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z"/>`]]);cd.styles=ge`
1215    :host {
1216      display: contents;
1217    }
1218  `;e5([z({type:String,reflect:!0})],cd.prototype,"size",2);e5([z({type:String,reflect:!0})],cd.prototype,"weight",2);e5([z({type:String,reflect:!0})],cd.prototype,"color",2);e5([z({type:Boolean,reflect:!0})],cd.prototype,"mirrored",2);cd=e5([we("ph-sign-out")],cd)});var Jwe={};Ce(Jwe,{PhSpinner:()=>ld});var qZe,WZe,t5,ld,Qwe=h(()=>{Ge();Je();tt();rt();nt();Ye();qZe=Object.defineProperty,WZe=Object.getOwnPropertyDescriptor,t5=(e,t,r,n)=>{for(var o=n>1?void 0:n?WZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&qZe(t,r,o),o},ld=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1219      xmlns="http://www.w3.org/2000/svg"
1220      width="${this.size}"
1221      height="${this.size}"
1222      fill="${this.color}"
1223      viewBox="0 0 256 256"
1224      transform=${this.mirrored?"scale(-1, 1)":null}
1225    >
1226      ${ld.weightsMap.get((e=this.weight)!=null?e:"regular")}
1227    </svg>`}};ld.weightsMap=new Map([["thin",H`<path d="M132,32V64a4,4,0,0,1-8,0V32a4,4,0,0,1,8,0Zm41.25,54.75a4,4,0,0,0,2.83-1.18L198.71,63a4,4,0,0,0-5.66-5.66L170.43,79.92a4,4,0,0,0,2.82,6.83ZM224,124H192a4,4,0,0,0,0,8h32a4,4,0,0,0,0-8Zm-47.92,46.43a4,4,0,1,0-5.65,5.65l22.62,22.63a4,4,0,0,0,5.66-5.66ZM128,188a4,4,0,0,0-4,4v32a4,4,0,0,0,8,0V192A4,4,0,0,0,128,188ZM79.92,170.43,57.29,193.05A4,4,0,0,0,63,198.71l22.62-22.63a4,4,0,1,0-5.65-5.65ZM68,128a4,4,0,0,0-4-4H32a4,4,0,0,0,0,8H64A4,4,0,0,0,68,128ZM63,57.29A4,4,0,0,0,57.29,63L79.92,85.57a4,4,0,1,0,5.65-5.65Z"/>`],["light",H`<path d="M134,32V64a6,6,0,0,1-12,0V32a6,6,0,0,1,12,0Zm39.25,56.75A6,6,0,0,0,177.5,87l22.62-22.63a6,6,0,0,0-8.48-8.48L169,78.5a6,6,0,0,0,4.24,10.25ZM224,122H192a6,6,0,0,0,0,12h32a6,6,0,0,0,0-12Zm-46.5,47A6,6,0,0,0,169,177.5l22.63,22.62a6,6,0,0,0,8.48-8.48ZM128,186a6,6,0,0,0-6,6v32a6,6,0,0,0,12,0V192A6,6,0,0,0,128,186ZM78.5,169,55.88,191.64a6,6,0,1,0,8.48,8.48L87,177.5A6,6,0,1,0,78.5,169ZM70,128a6,6,0,0,0-6-6H32a6,6,0,0,0,0,12H64A6,6,0,0,0,70,128ZM64.36,55.88a6,6,0,0,0-8.48,8.48L78.5,87A6,6,0,1,0,87,78.5Z"/>`],["regular",H`<path d="M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"/>`],["bold",H`<path d="M140,32V64a12,12,0,0,1-24,0V32a12,12,0,0,1,24,0Zm33.25,62.75a12,12,0,0,0,8.49-3.52L204.37,68.6a12,12,0,0,0-17-17L164.77,74.26a12,12,0,0,0,8.48,20.49ZM224,116H192a12,12,0,0,0,0,24h32a12,12,0,0,0,0-24Zm-42.26,48.77a12,12,0,1,0-17,17l22.63,22.63a12,12,0,0,0,17-17ZM128,180a12,12,0,0,0-12,12v32a12,12,0,0,0,24,0V192A12,12,0,0,0,128,180ZM74.26,164.77,51.63,187.4a12,12,0,0,0,17,17l22.63-22.63a12,12,0,1,0-17-17ZM76,128a12,12,0,0,0-12-12H32a12,12,0,0,0,0,24H64A12,12,0,0,0,76,128ZM68.6,51.63a12,12,0,1,0-17,17L74.26,91.23a12,12,0,0,0,17-17Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm33.94,58.75,17-17a8,8,0,0,1,11.32,11.32l-17,17a8,8,0,0,1-11.31-11.31ZM48,136a8,8,0,0,1,0-16H72a8,8,0,0,1,0,16Zm46.06,37.25-17,17a8,8,0,0,1-11.32-11.32l17-17a8,8,0,0,1,11.31,11.31Zm0-79.19a8,8,0,0,1-11.31,0l-17-17A8,8,0,0,1,77.09,65.77l17,17A8,8,0,0,1,94.06,94.06ZM136,208a8,8,0,0,1-16,0V184a8,8,0,0,1,16,0Zm0-136a8,8,0,0,1-16,0V48a8,8,0,0,1,16,0Zm54.23,118.23a8,8,0,0,1-11.32,0l-17-17a8,8,0,0,1,11.31-11.31l17,17A8,8,0,0,1,190.23,190.23ZM208,136H184a8,8,0,0,1,0-16h24a8,8,0,0,1,0,16Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M136,32V64a8,8,0,0,1-16,0V32a8,8,0,0,1,16,0Zm37.25,58.75a8,8,0,0,0,5.66-2.35l22.63-22.62a8,8,0,0,0-11.32-11.32L167.6,77.09a8,8,0,0,0,5.65,13.66ZM224,120H192a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16Zm-45.09,47.6a8,8,0,0,0-11.31,11.31l22.62,22.63a8,8,0,0,0,11.32-11.32ZM128,184a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V192A8,8,0,0,0,128,184ZM77.09,167.6,54.46,190.22a8,8,0,0,0,11.32,11.32L88.4,178.91A8,8,0,0,0,77.09,167.6ZM72,128a8,8,0,0,0-8-8H32a8,8,0,0,0,0,16H64A8,8,0,0,0,72,128ZM65.78,54.46A8,8,0,0,0,54.46,65.78L77.09,88.4A8,8,0,0,0,88.4,77.09Z"/>`]]);ld.styles=ge`
1228    :host {
1229      display: contents;
1230    }
1231  `;t5([z({type:String,reflect:!0})],ld.prototype,"size",2);t5([z({type:String,reflect:!0})],ld.prototype,"weight",2);t5([z({type:String,reflect:!0})],ld.prototype,"color",2);t5([z({type:Boolean,reflect:!0})],ld.prototype,"mirrored",2);ld=t5([we("ph-spinner")],ld)});var Xwe={};Ce(Xwe,{PhTrash:()=>ud});var KZe,ZZe,r5,ud,ebe=h(()=>{Ge();Je();tt();rt();nt();Ye();KZe=Object.defineProperty,ZZe=Object.getOwnPropertyDescriptor,r5=(e,t,r,n)=>{for(var o=n>1?void 0:n?ZZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&KZe(t,r,o),o},ud=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1232      xmlns="http://www.w3.org/2000/svg"
1233      width="${this.size}"
1234      height="${this.size}"
1235      fill="${this.color}"
1236      viewBox="0 0 256 256"
1237      transform=${this.mirrored?"scale(-1, 1)":null}
1238    >
1239      ${ud.weightsMap.get((e=this.weight)!=null?e:"regular")}
1240    </svg>`}};ud.weightsMap=new Map([["thin",H`<path d="M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z"/>`],["light",H`<path d="M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z"/>`],["regular",H`<path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/>`],["bold",H`<path d="M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z"/>`],["fill",H`<path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z"/>`],["duotone",H`<path d="M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z" opacity="0.2"/><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/>`]]);ud.styles=ge`
1241    :host {
1242      display: contents;
1243    }
1244  `;r5([z({type:String,reflect:!0})],ud.prototype,"size",2);r5([z({type:String,reflect:!0})],ud.prototype,"weight",2);r5([z({type:String,reflect:!0})],ud.prototype,"color",2);r5([z({type:Boolean,reflect:!0})],ud.prototype,"mirrored",2);ud=r5([we("ph-trash")],ud)});var tbe={};Ce(tbe,{PhUser:()=>dd});var GZe,YZe,n5,dd,rbe=h(()=>{Ge();Je();tt();rt();nt();Ye();GZe=Object.defineProperty,YZe=Object.getOwnPropertyDescriptor,n5=(e,t,r,n)=>{for(var o=n>1?void 0:n?YZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&GZe(t,r,o),o},dd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1245      xmlns="http://www.w3.org/2000/svg"
1246      width="${this.size}"
1247      height="${this.size}"
1248      fill="${this.color}"
1249      viewBox="0 0 256 256"
1250      transform=${this.mirrored?"scale(-1, 1)":null}
1251    >
1252      ${dd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1253    </svg>`}};dd.weightsMap=new Map([["thin",H`<path d="M227.46,214c-16.52-28.56-43-48.06-73.68-55.09a68,68,0,1,0-51.56,0c-30.64,7-57.16,26.53-73.68,55.09a4,4,0,0,0,6.92,4C55,184.19,89.62,164,128,164s73,20.19,92.54,54a4,4,0,0,0,3.46,2,3.93,3.93,0,0,0,2-.54A4,4,0,0,0,227.46,214ZM68,96a60,60,0,1,1,60,60A60.07,60.07,0,0,1,68,96Z"/>`],["light",H`<path d="M229.19,213c-15.81-27.32-40.63-46.49-69.47-54.62a70,70,0,1,0-63.44,0C67.44,166.5,42.62,185.67,26.81,213a6,6,0,1,0,10.38,6C56.4,185.81,90.34,166,128,166s71.6,19.81,90.81,53a6,6,0,1,0,10.38-6ZM70,96a58,58,0,1,1,58,58A58.07,58.07,0,0,1,70,96Z"/>`],["regular",H`<path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/>`],["bold",H`<path d="M234.38,210a123.36,123.36,0,0,0-60.78-53.23,76,76,0,1,0-91.2,0A123.3
12536,123.36,0,0,0,21.62,210a12,12,0,1,0,20.77,12c18.12-31.32,50.12-50,85.61-50s67.49,18.69,85.61,50a12,12,0,0,0,20.77-12ZM76,96a52,52,0,1,1,52,52A52.06,52.06,0,0,1,76,96Z"/>`],["fill",H`<path d="M230.93,220a8,8,0,0,1-6.93,4H32a8,8,0,0,1-6.92-12c15.23-26.33,38.7-45.21,66.09-54.16a72,72,0,1,1,73.66,0c27.39,8.95,50.86,27.83,66.09,54.16A8,8,0,0,1,230.93,220Z"/>`],["duotone",H`<path d="M192,96a64,64,0,1,1-64-64A64,64,0,0,1,192,96Z" opacity="0.2"/><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/>`]]);dd.styles=ge`
1254    :host {
1255      display: contents;
1256    }
1257  `;n5([z({type:String,reflect:!0})],dd.prototype,"size",2);n5([z({type:String,reflect:!0})],dd.prototype,"weight",2);n5([z({type:String,reflect:!0})],dd.prototype,"color",2);n5([z({type:Boolean,reflect:!0})],dd.prototype,"mirrored",2);dd=n5([we("ph-user")],dd)});var nbe={};Ce(nbe,{PhWallet:()=>pd});var JZe,QZe,o5,pd,obe=h(()=>{Ge();Je();tt();rt();nt();Ye();JZe=Object.defineProperty,QZe=Object.getOwnPropertyDescriptor,o5=(e,t,r,n)=>{for(var o=n>1?void 0:n?QZe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&JZe(t,r,o),o},pd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1258      xmlns="http://www.w3.org/2000/svg"
1259      width="${this.size}"
1260      height="${this.size}"
1261      fill="${this.color}"
1262      viewBox="0 0 256 256"
1263      transform=${this.mirrored?"scale(-1, 1)":null}
1264    >
1265      ${pd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1266    </svg>`}};pd.weightsMap=new Map([["thin",H`<path d="M216,68H56a12,12,0,0,1,0-24H192a4,4,0,0,0,0-8H56A20,20,0,0,0,36,56V184a20,20,0,0,0,20,20H216a12,12,0,0,0,12-12V80A12,12,0,0,0,216,68Zm4,124a4,4,0,0,1-4,4H56a12,12,0,0,1-12-12V72a19.86,19.86,0,0,0,12,4H216a4,4,0,0,1,4,4Zm-32-60a8,8,0,1,1-8-8A8,8,0,0,1,188,132Z"/>`],["light",H`<path d="M216,66H56a10,10,0,0,1,0-20H192a6,6,0,0,0,0-12H56A22,22,0,0,0,34,56V184a22,22,0,0,0,22,22H216a14,14,0,0,0,14-14V80A14,14,0,0,0,216,66Zm2,126a2,2,0,0,1-2,2H56a10,10,0,0,1-10-10V75.59A21.84,21.84,0,0,0,56,78H216a2,2,0,0,1,2,2Zm-28-60a10,10,0,1,1-10-10A10,10,0,0,1,190,132Z"/>`],["regular",H`<path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/>`],["bold",H`<path d="M196,136a16,16,0,1,1-16-16A16,16,0,0,1,196,136Zm40-36v80a32,32,0,0,1-32,32H60a32,32,0,0,1-32-32V60.92A32,32,0,0,1,60,28H192a12,12,0,0,1,0,24H60a8,8,0,0,0-8,8.26v.08A8.32,8.32,0,0,0,60.48,68H204A32,32,0,0,1,236,100Zm-24,0a8,8,0,0,0-8-8H60.48A33.72,33.72,0,0,1,52,90.92V180a8,8,0,0,0,8,8H204a8,8,0,0,0,8-8Z"/>`],["fill",H`<path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm-36,80a12,12,0,1,1,12-12A12,12,0,0,1,180,144Z"/>`],["duotone",H`<path d="M224,80V192a8,8,0,0,1-8,8H56a16,16,0,0,1-16-16V56A16,16,0,0,0,56,72H216A8,8,0,0,1,224,80Z" opacity="0.2"/><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/>`]]);pd.styles=ge`
1267    :host {
1268      display: contents;
1269    }
1270  `;o5([z({type:String,reflect:!0})],pd.prototype,"size",2);o5([z({type:String,reflect:!0})],pd.prototype,"weight",2);o5([z({type:String,reflect:!0})],pd.prototype,"color",2);o5([z({type:Boolean,reflect:!0})],pd.prototype,"mirrored",2);pd=o5([we("ph-wallet")],pd)});var sbe={};Ce(sbe,{PhWarning:()=>fd});var XZe,eGe,s5,fd,ibe=h(()=>{Ge();Je();tt();rt();nt();Ye();XZe=Object.defineProperty,eGe=Object.getOwnPropertyDescriptor,s5=(e,t,r,n)=>{for(var o=n>1?void 0:n?eGe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&XZe(t,r,o),o},fd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1271      xmlns="http://www.w3.org/2000/svg"
1272      width="${this.size}"
1273      height="${this.size}"
1274      fill="${this.color}"
1275      viewBox="0 0 256 256"
1276      transform=${this.mirrored?"scale(-1, 1)":null}
1277    >
1278      ${fd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1279    </svg>`}};fd.weightsMap=new Map([["thin",H`<path d="M233.34,190.09,145.88,38.22h0a20.75,20.75,0,0,0-35.76,0L22.66,190.09a19.52,19.52,0,0,0,0,19.71A20.36,20.36,0,0,0,40.54,220H215.46a20.36,20.36,0,0,0,17.86-10.2A19.52,19.52,0,0,0,233.34,190.09ZM226.4,205.8a12.47,12.47,0,0,1-10.94,6.2H40.54a12.47,12.47,0,0,1-10.94-6.2,11.45,11.45,0,0,1,0-11.72L117.05,42.21a12.76,12.76,0,0,1,21.9,0L226.4,194.08A11.45,11.45,0,0,1,226.4,205.8ZM124,144V104a4,4,0,0,1,8,0v40a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,180Z"/>`],["light",H`<path d="M235.07,189.09,147.61,37.22h0a22.75,22.75,0,0,0-39.22,0L20.93,189.09a21.53,21.53,0,0,0,0,21.72A22.35,22.35,0,0,0,40.55,222h174.9a22.35,22.35,0,0,0,19.6-11.19A21.53,21.53,0,0,0,235.07,189.09ZM224.66,204.8a10.46,10.46,0,0,1-9.21,5.2H40.55a10.46,10.46,0,0,1-9.21-5.2,9.51,9.51,0,0,1,0-9.72L118.79,43.21a10.75,10.75,0,0,1,18.42,0l87.46,151.87A9.51,9.51,0,0,1,224.66,204.8ZM122,144V104a6,6,0,0,1,12,0v40a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,180Z"/>`],["regular",H`<path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/>`],["bold",H`<path d="M240.26,186.1,152.81,34.23h0a28.74,28.74,0,0,0-49.62,0L15.74,186.1a27.45,27.45,0,0,0,0,27.71A28.31,28.31,0,0,0,40.55,228h174.9a28.31,28.31,0,0,0,24.79-14.19A27.45,27.45,0,0,0,240.26,186.1Zm-20.8,15.7a4.46,4.46,0,0,1-4,2.2H40.55a4.46,4.46,0,0,1-4-2.2,3.56,3.56,0,0,1,0-3.73L124,46.2a4.77,4.77,0,0,1,8,0l87.44,151.87A3.56,3.56,0,0,1,219.46,201.8ZM116,136V104a12,12,0,0,1,24,0v32a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,176Z"/>`],["fill",H`<path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"/>`],["duotone",H`<path d="M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z" opacity="0.2"/><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/>`]]);fd.styles=ge`
1280    :host {
1281      display: contents;
1282    }
1283  `;s5([z({type:String,reflect:!0})],fd.prototype,"size",2);s5([z({type:String,reflect:!0})],fd.prototype,"weight",2);s5([z({type:String,reflect:!0})],fd.prototype,"color",2);s5([z({type:Boolean,reflect:!0})],fd.prototype,"mirrored",2);fd=s5([we("ph-warning")],fd)});var abe={};Ce(abe,{PhWarningCircle:()=>hd});var tGe,rGe,i5,hd,cbe=h(()=>{Ge();Je();tt();rt();nt();Ye();tGe=Object.defineProperty,rGe=Object.getOwnPropertyDescriptor,i5=(e,t,r,n)=>{for(var o=n>1?void 0:n?rGe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&tGe(t,r,o),o},hd=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1284      xmlns="http://www.w3.org/2000/svg"
1285      width="${this.size}"
1286      height="${this.size}"
1287      fill="${this.color}"
1288      viewBox="0 0 256 256"
1289      transform=${this.mirrored?"scale(-1, 1)":null}
1290    >
1291      ${hd.weightsMap.get((e=this.weight)!=null?e:"regular")}
1292    </svg>`}};hd.weightsMap=new Map([["thin",H`<path d="M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"/>`],["light",H`<path d="M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"/>`],["regular",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"/>`],["bold",H`<path d="M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"/>`],["fill",H`<path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"/>`],["duotone",H`<path d="M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z" opacity="0.2"/><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"/>`]]);hd.styles=ge`
1293    :host {
1294      display: contents;
1295    }
1296  `;i5([z({type:String,reflect:!0})],hd.prototype,"size",2);i5([z({type:String,reflect:!0})],hd.prototype,"weight",2);i5([z({type:String,reflect:!0})],hd.prototype,"color",2);i5([z({type:Boolean,reflect:!0})],hd.prototype,"mirrored",2);hd=i5([we("ph-warning-circle")],hd)});var lbe={};Ce(lbe,{PhX:()=>md});var nGe,oGe,a5,md,ube=h(()=>{Ge();Je();tt();rt();nt();Ye();nGe=Object.defineProperty,oGe=Object.getOwnPropertyDescriptor,a5=(e,t,r,n)=>{for(var o=n>1?void 0:n?oGe(t,r):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(n?i(t,r,o):i(o))||o);return n&&o&&nGe(t,r,o),o},md=class extends fe{constructor(){super(...arguments),this.size="1em",this.weight="regular",this.color="currentColor",this.mirrored=!1}render(){var e;return ye`<svg
1297      xmlns="http://www.w3.org/2000/svg"
1298      width="${this.size}"
1299      height="${this.size}"
1300      fill="${this.color}"
1301      viewBox="0 0 256 256"
1302      transform=${this.mirrored?"scale(-1, 1)":null}
1303    >
1304      ${md.weightsMap.get((e=this.weight)!=null?e:"regular")}
1305    </svg>`}};md.weightsMap=new Map([["thin",H`<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"/>`],["light",H`<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"/>`],["regular",H`<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/>`],["bold",H`<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"/>`],["fill",H`<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/>`],["duotone",H`<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"/><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/>`]]);md.styles=ge`
1306    :host {
1307      display: contents;
1308    }
1309  `;a5([z({type:String,reflect:!0})],md.prototype,"size",2);a5([z({type:String,reflect:!0})],md.prototype,"weight",2);a5([z({type:String,reflect:!0})],md.prototype,"color",2);a5([z({type:Boolean,reflect:!0})],md.prototype,"mirrored",2);md=a5([we("ph-x")],md)});var c5,sGe,iGe,aGe,cGe,Xg,Jn=h(()=>{le();Ue();Hge();Fge();zge();qge();Kge();Gge();Jge();Xge();t2e();n2e();s2e();a2e();l2e();d2e();f2e();m2e();y2e();b2e();v2e();A2e();S2e();T2e();P2e();R2e();B2e();M2e();H2e();Tt();kt();Pt();F2e();c5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},sGe={add:"ph-plus",allWallets:"ph-dots-three",arrowBottom:"ph-arrow-down",arrowBottomCircle:"ph-arrow-circle-down",arrowClockWise:"ph-arrow-clockwise",arrowLeft:"ph-arrow-left",arrowRight:"ph-arrow-right",arrowTop:"ph-arrow-up",arrowTopRight:"ph-arrow-up-right",bank:"ph-bank",bin:"ph-trash",browser:"ph-browser",card:"ph-credit-card",checkmarkBold:"ph-check",chevronBottom:"ph-caret-down",chevronLeft:"ph-caret-left",chevronRight:"ph-caret-right",chevronTop:"ph-caret-up",clock:"ph-clock",close:"ph-x",coinPlaceholder:"ph-circle-half",compass:"ph-compass",copy:"ph-copy",desktop:"ph-desktop",dollar:"ph-currency-dollar",download:"ph-vault",exclamationCircle:"ph-warning-circle",extension:"ph-puzzle-piece",externalLink:"ph-arrow-square-out",filters:"ph-funnel-simple",helpCircle:"ph-question",id:"ph-identification-card",image:"ph-image",info:"ph-info",lightbulb:"ph-lightbulb",mail:"ph-envelope",mobile:"ph-device-mobile",more:"ph-dots-three",networkPlaceholder:"ph-globe",nftPlaceholder:"ph-image",plus:"ph-plus",power:"ph-power",qrCode:"ph-qr-code",questionMark:"ph-question",refresh:"ph-arrow-clockwise",recycleHorizontal:"ph-arrows-clockwise",search:"ph-magnifying-glass",sealCheck:"ph-seal-check",send:"ph-paper-plane-right",signOut:"ph-sign-out",spinner:"ph-spinner",swapHorizontal:"ph-arrows-left-right",swapVertical:"ph-arrows-down-up",threeDots:"ph-dots-three",user:"ph-user",verify:"ph-seal-check",verifyFilled:"ph-seal-check",wallet:"ph-wallet",warning:"ph-warning",warningCircle:"ph-warning-circle",appStore:"",apple:"",bitcoin:"",coins:"",chromeStore:"",cursor:"",discord:"",ethereum:"",etherscan:"",facebook:"",farcaster:"",g
1309ithub:"",google:"",playStore:"",paperPlaneTitle:"",reown:"",solana:"",ton:"",tron:"",telegram:"",twitch:"",twitterIcon:"",twitter:"",walletConnect:"",walletConnectBrown:"",walletConnectLightBrown:"",x:"",infoSeal:"",checkmark:""},iGe={"ph-arrow-circle-down":()=>Promise.resolve().then(()=>(gye(),mye)),"ph-arrow-clockwise":()=>Promise.resolve().then(()=>(wye(),yye)),"ph-arrow-down":()=>Promise.resolve().then(()=>(xye(),bye)),"ph-arrow-left":()=>Promise.resolve().then(()=>(Eye(),vye)),"ph-arrow-right":()=>Promise.resolve().then(()=>(Cye(),Aye)),"ph-arrow-square-out":()=>Promise.resolve().then(()=>(Iye(),Sye)),"ph-arrows-down-up":()=>Promise.resolve().then(()=>(_ye(),Tye)),"ph-arrows-left-right":()=>Promise.resolve().then(()=>(Nye(),Pye)),"ph-arrow-up":()=>Promise.resolve().then(()=>(Oye(),Rye)),"ph-arrow-up-right":()=>Promise.resolve().then(()=>(kye(),Bye)),"ph-arrows-clockwise":()=>Promise.resolve().then(()=>(Uye(),Dye)),"ph-bank":()=>Promise.resolve().then(()=>(Mye(),Lye)),"ph-browser":()=>Promise.resolve().then(()=>($ye(),Hye)),"ph-caret-down":()=>Promise.resolve().then(()=>(Vye(),Fye)),"ph-caret-left":()=>Promise.resolve().then(()=>(jye(),zye)),"ph-caret-right":()=>Promise.resolve().then(()=>(Wye(),qye)),"ph-caret-up":()=>Promise.resolve().then(()=>(Zye(),Kye)),"ph-check":()=>Promise.resolve().then(()=>(Yye(),Gye)),"ph-circle-half":()=>Promise.resolve().then(()=>(Qye(),Jye)),"ph-clock":()=>Promise.resolve().then(()=>(ewe(),Xye)),"ph-compass":()=>Promise.resolve().then(()=>(rwe(),twe)),"ph-copy":()=>Promise.resolve().then(()=>(owe(),nwe)),"ph-credit-card":()=>Promise.resolve().then(()=>(iwe(),swe)),"ph-currency-dollar":()=>Promise.resolve().then(()=>(cwe(),awe)),"ph-desktop":()=>Promise.resolve().then(()=>(uwe(),lwe)),"ph-device-mobile":()=>Promise.resolve().then(()=>(pwe(),dwe)),"ph-dots-three":()=>Promise.resolve().then(()=>(hwe(),fwe)),"ph-vault":()=>Promise.resolve().then(()=>(gwe(),mwe)),"ph-envelope":()=>Promise.resolve().then(()=>(wwe(),ywe)),"ph-funnel-simple":()=>Promise.resolve().then(()=>(xwe(),bwe)),"ph-globe":()=>Promise.resolve().then(()=>(Ewe(),vwe)),"ph-identification-card":()=>Promise.resolve().then(()=>(Cwe(),Awe)),"ph-image":()=>Promise.resolve().then(()=>(Iwe(),Swe)),"ph-info":()=>Promise.resolve().then(()=>(_we(),Twe)),"ph-lightbulb":()=>Promise.resolve().then(()=>(Nwe(),Pwe)),"ph-magnifying-glass":()=>Promise.resolve().then(()=>(Owe(),Rwe)),"ph-paper-plane-right":()=>Promise.resolve().then(()=>(kwe(),Bwe)),"ph-plus":()=>Promise.resolve().then(()=>(Uwe(),Dwe)),"ph-power":()=>Promise.resolve().then(()=>(Mwe(),Lwe)),"ph-puzzle-piece":()=>Promise.resolve().then(()=>($we(),Hwe)),"ph-qr-code":()=>Promise.resolve().then(()=>(Vwe(),Fwe)),"ph-question":()=>Promise.resolve().then(()=>(jwe(),zwe)),"ph-question-circle":()=>Promise.resolve().then(()=>(Wwe(),qwe)),"ph-seal-check":()=>Promise.resolve().then(()=>(Zwe(),Kwe)),"ph-sign-out":()=>Promise.resolve().then(()=>(Ywe(),Gwe)),"ph-spinner":()=>Promise.resolve().then(()=>(Qwe(),Jwe)),"ph-trash":()=>Promise.resolve().then(()=>(ebe(),Xwe)),"ph-user":()=>Promise.resolve().then(()=>(rbe(),tbe)),"ph-wallet":()=>Promise.resolve().then(()=>(obe(),nbe)),"ph-warning":()=>Promise.resolve().then(()=>(ibe(),sbe)),"ph-warning-circle":()=>Promise.resolve().then(()=>(cbe(),abe)),"ph-x":()=>Promise.resolve().then(()=>(ube(),lbe))},aGe={appStore:$ge,apple:Vge,bitcoin:jge,coins:Yge,chromeStore:Zge,cursor:Qge,discord:e2e,ethereum:r2e,etherscan:o2e,facebook:i2e,farcaster:c2e,github:u2e,google:p2e,playStore:w2e,paperPlaneTitle:g2e,reown:x2e,solana:E2e,ton:I2e,tron:_2e,telegram:C2e,twitch:N2e,twitter:yV,twitterIcon:O2e,walletConnect:k2e,walletConnectInvert:D2e,walletConnectBrown:L2e,walletConnectLightBrown:U2e,x:yV,infoSeal:h2e,checkmark:Wge},cGe={"accent-primary":Ut.tokens.core.iconAccentPrimary,"accent-certified":Ut.tokens.core.iconAccentCertified,"foreground-secondary":Ut.tokens.theme.foregroundSecondary,default:Ut.tokens.theme.iconDefault,success:Ut.tokens.core.iconSuccess,error:Ut.tokens.core.iconError,warning:Ut.tokens.core.iconWarning,inverse:Ut.tokens.theme.iconInverse},Xg=class extends ne{constructor(){super(...arguments),this.size="md",this.name="copy",this.weight="bold",this.color="inherit"}render(){let t={xxs:"2",xs:"3",sm:"3",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7",inherit:"inherit"};this.style.cssText=`
1310      --local-width: ${this.size==="inherit"?"inherit":`var(--apkt-spacing-${t[this.size]})`};
1311      --local-color: ${this.color==="inherit"?"inherit":cGe[this.color]}
1312    `;let r=sGe[this.name];if(r&&r!==""){let n=iGe[r];n&&n();let o=Lge(r);return gV`<${o} size=${{xxs:"0.5em",xs:"0.75em",sm:"0.75em",md:"1em",mdl:"1.25em",lg:"1.25em",xl:"1.5em",xxl:"1.75em"}[this.size]} weight="${this.weight}"></${o}>`}return aGe[this.name]||gV``}};Xg.styles=[ke,$2e];c5([V()],Xg.prototype,"size",void 0);c5([V()],Xg.prototype,"name",void 0);c5([V()],Xg.prototype,"weight",void 0);c5([V()],Xg.prototype,"color",void 0);Xg=c5([te("wui-icon")],Xg)});var g7,l5,P6,u5=h(()=>{g7={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},l5=e=>(...t)=>({_$litDirective$:e,values:t}),P6=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this._$Ct=t,this._$AM=r,this._$Ci=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}}});var N6,dbe=h(()=>{uf();u5();N6=l5(class extends P6{constructor(e){if(super(e),e.type!==g7.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}
1312update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(let n in t)t[n]&&!this.nt?.has(n)&&this.st.add(n);return this.render(t)}let r=e.element.classList;for(let n of this.st)n in t||(r.remove(n),this.st.delete(n));for(let n in t){let o=!!t[n];o===this.st.has(n)||this.nt?.has(n)||(o?(r.add(n),this.st.add(n)):(r.remove(n),this.st.delete(n)))}return lf}})});var y7=h(()=>{dbe()});var pbe,fbe=h(()=>{Tt();pbe=ce`
1313  slot {
1314    width: 100%;
1315    display: inline-block;
1316    font-style: normal;
1317    overflow: inherit;
1318    text-overflow: inherit;
1319    text-align: var(--local-align);
1320    color: var(--local-color);
1321  }
1322
1323  .wui-line-clamp-1 {
1324    overflow: hidden;
1325    display: -webkit-box;
1326    -webkit-box-orient: vertical;
1327    -webkit-line-clamp: 1;
1328  }
1329
1330  .wui-line-clamp-2 {
1331    overflow: hidden;
1332    display: -webkit-box;
1333    -webkit-box-orient: vertical;
1334    -webkit-line-clamp: 2;
1335  }
1336
1337  /* -- Headings --------------------------------------------------- */
1338  .wui-font-h1-regular-mono {
1339    font-size: ${({textSize:e})=>e.h1};
1340    line-height: ${({typography:e})=>e["h1-regular-mono"].lineHeight};
1341    letter-spacing: ${({typography:e})=>e["h1-regular-mono"].letterSpacing};
1342    font-weight: ${({fontWeight:e})=>e.regular};
1343    font-family: ${({fontFamily:e})=>e.mono};
1344  }
1345
1346  .wui-font-h1-regular {
1347    font-size: ${({textSize:e})=>e.h1};
1348    line-height: ${({typography:e})=>e["h1-regular"].lineHeight};
1349    letter-spacing: ${({typography:e})=>e["h1-regular"].letterSpacing};
1350    font-weight: ${({fontWeight:e})=>e.regular};
1351    font-family: ${({fontFamily:e})=>e.regular};
1352    font-feature-settings:
1353      'liga' off,
1354      'clig' off;
1355  }
1356
1357  .wui-font-h1-medium {
1358    font-size: ${({textSize:e})=>e.h1};
1359    line-height: ${({typography:e})=>e["h1-medium"].lineHeight};
1360    letter-spacing: ${({typography:e})=>e["h1-medium"].letterSpacing};
1361    font-weight: ${({fontWeight:e})=>e.medium};
1362    font-family: ${({fontFamily:e})=>e.regular};
1363    font-feature-settings:
1364      'liga' off,
1365      'clig' off;
1366  }
1367
1368  .wui-font-h2-regular-mono {
1369    font-size: ${({textSize:e})=>e.h2};
1370    line-height: ${({typography:e})=>e["h2-regular-mono"].lineHeight};
1371    letter-spacing: ${({typography:e})=>e["h2-regular-mono"].letterSpacing};
1372    font-weight: ${({fontWeight:e})=>e.regular};
1373    font-family: ${({fontFamily:e})=>e.mono};
1374  }
1375
1376  .wui-font-h2-regular {
1377    font-size: ${({textSize:e})=>e.h2};
1378    line-height: ${({typography:e})=>e["h2-regular"].lineHeight};
1379    letter-spacing: ${({typography:e})=>e["h2-regular"].letterSpacing};
1380    font-weight: ${({fontWeight:e})=>e.regular};
1381    font-family: ${({fontFamily:e})=>e.regular};
1382    font-feature-settings:
1383      'liga' off,
1384      'clig' off;
1385  }
1386
1387  .wui-font-h2-medium {
1388    font-size: ${({textSize:e})=>e.h2};
1389    line-height: ${({typography:e})=>e["h2-medium"].lineHeight};
1390    letter-spacing: ${({typography:e})=>e["h2-medium"].letterSpacing};
1391    font-weight: ${({fontWeight:e})=>e.medium};
1392    font-family: ${({fontFamily:e})=>e.regular};
1393    font-feature-settings:
1394      'liga' off,
1395      'clig' off;
1396  }
1397
1398  .wui-font-h3-regular-mono {
1399    font-size: ${({textSize:e})=>e.h3};
1400    line-height: ${({typography:e})=>e["h3-regular-mono"].lineHeight};
1401    letter-spacing: ${({typography:e})=>e["h3-regular-mono"].letterSpacing};
1402    font-weight: ${({fontWeight:e})=>e.regular};
1403    font-family: ${({fontFamily:e})=>e.mono};
1404  }
1405
1406  .wui-font-h3-regular {
1407    font-size: ${({textSize:e})=>e.h3};
1408    line-height: ${({typography:e})=>e["h3-regular"].lineHeight};
1409    letter-spacing: ${({typography:e})=>e["h3-regular"].letterSpacing};
1410    font-weight: ${({fontWeight:e})=>e.regular};
1411    font-family: ${({fontFamily:e})=>e.regular};
1412    font-feature-settings:
1413      'liga' off,
1414      'clig' off;
1415  }
1416
1417  .wui-font-h3-medium {
1418    font-size: ${({textSize:e})=>e.h3};
1419    line-height: ${({typography:e})=>e["h3-medium"].lineHeight};
1420    letter-spacing: ${({typography:e})=>e["h3-medium"].letterSpacing};
1421    font-weight: ${({fontWeight:e})=>e.medium};
1422    font-family: ${({fontFamily:e})=>e.regular};
1423    font-feature-settings:
1424      'liga' off,
1425      'clig' off;
1426  }
1427
1428  .wui-font-h4-regular-mono {
1429    font-size: ${({textSize:e})=>e.h4};
1430    line-height: ${({typography:e})=>e["h4-regular-mono"].lineHeight};
1431    letter-spacing: ${({typography:e})=>e["h4-regular-mono"].letterSpacing};
1432    font-weight: ${({fontWeight:e})=>e.regular};
1433    font-family: ${({fontFamily:e})=>e.mono};
1434  }
1435
1436  .wui-font-h4-regular {
1437    font-size: ${({textSize:e})=>e.h4};
1438    line-height: ${({typography:e})=>e["h4-regular"].lineHeight};
1439    letter-spacing: ${({typography:e})=>e["h4-regular"].letterSpacing};
1440    font-weight: ${({fontWeight:e})=>e.regular};
1441    font-family: ${({fontFamily:e})=>e.regular};
1442    font-feature-settings:
1443      'liga' off,
1444      'clig' off;
1445  }
1446
1447  .wui-font-h4-medium {
1448    font-size: ${({textSize:e})=>e.h4};
1449    line-height: ${({typography:e})=>e["h4-medium"].lineHeight};
1450    letter-spacing: ${({typography:e})=>e["h4-medium"].letterSpacing};
1451    font-weight: ${({fontWeight:e})=>e.medium};
1452    font-family: ${({fontFamily:e})=>e.regular};
1453    font-feature-settings:
1454      'liga' off,
1455      'clig' off;
1456  }
1457
1458  .wui-font-h5-regular-mono {
1459    font-size: ${({textSize:e})=>e.h5};
1460    line-height: ${({typography:e})=>e["h5-regular-mono"].lineHeight};
1461    letter-spacing: ${({typography:e})=>e["h5-regular-mono"].letterSpacing};
1462    font-weight: ${({fontWeight:e})=>e.regular};
1463    font-family: ${({fontFamily:e})=>e.mono};
1464  }
1465
1466  .wui-font-h5-regular {
1467    font-size: ${({textSize:e})=>e.h5};
1468    line-height: ${({typography:e})=>e["h5-regular"].lineHeight};
1469    letter-spacing: ${({typography:e})=>e["h5-regular"].letterSpacing};
1470    font-weight: ${({fontWeight:e})=>e.regular};
1471    font-family: ${({fontFamily:e})=>e.regular};
1472    font-feature-settings:
1473      'liga' off,
1474      'clig' off;
1475  }
1476
1477  .wui-font-h5-medium {
1478    font-size: ${({textSize:e})=>e.h5};
1479    line-height: ${({typography:e})=>e["h5-medium"].lineHeight};
1480    letter-spacing: ${({typography:e})=>e["h5-medium"].letterSpacing};
1481    font-weight: ${({fontWeight:e})=>e.medium};
1482    font-family: ${({fontFamily:e})=>e.regular};
1483    font-feature-settings:
1484      'liga' off,
1485      'clig' off;
1486  }
1487
1488  .wui-font-h6-regular-mono {
1489    font-size: ${({textSize:e})=>e.h6};
1490    line-height: ${({typography:e})=>e["h6-regular-mono"].lineHeight};
1491    letter-spacing: ${({typography:e})=>e["h6-regular-mono"].letterSpacing};
1492    font-weight: ${({fontWeight:e})=>e.regular};
1493    font-family: ${({fontFamily:e})=>e.mono};
1494  }
1495
1496  .wui-font-h6-regular {
1497    font-size: ${({textSize:e})=>e.h6};
1498    line-height: ${({typography:e})=>e["h6-regular"].lineHeight};
1499    letter-spacing: ${({typography:e})=>e["h6-regular"].letterSpacing};
1500    font-weight: ${({fontWeight:e})=>e.regular};
1501    font-family: ${({fontFamily:e})=>e.regular};
1502    font-feature-settings:
1503      'liga' off,
1504      'clig' off;
1505  }
1506
1507  .wui-font-h6-medium {
1508    font-size: ${({textSize:e})=>e.h6};
1509    line-height: ${({typography:e})=>e["h6-medium"].lineHeight};
1510    letter-spacing: ${({typography:e})=>e["h6-medium"].letterSpacing};
1511    font-weight: ${({fontWeight:e})=>e.medium};
1512    font-family: ${({fontFamily:e})=>e.regular};
1513    font-feature-settings:
1514      'liga' off,
1515      'clig' off;
1516  }
1517
1518  .wui-font-lg-regular-mono {
1519    font-size: ${({textSize:e})=>e.large};
1520    line-height: ${({typography:e})=>e["lg-regular-mono"].lineHeight};
1521    letter-spacing: ${({typography:e})=>e["lg-regular-mono"].letterSpacing};
1522    font-weight: ${({fontWeight:e})=>e.regular};
1523    font-family: ${({fontFamily:e})=>e.mono};
1524  }
1525
1526  .wui-font-lg-regular {
1527    font-size: ${({textSize:e})=>e.large};
1528    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
1529    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
1530    font-weight: ${({fontWeight:e})=>e.regular};
1531    font-family: ${({fontFamily:e})=>e.regular};
1532    font-feature-settings:
1533      'liga' off,
1534      'clig' off;
1535  }
1536
1537  .wui-font-lg-medium {
1538    font-size: ${({textSize:e})=>e.large};
1539    line-height: ${({typography:e})=>e["lg-medium"].lineHeight};
1540    letter-spacing: ${({typography:e})=>e["lg-medium"].letterSpacing};
1541    font-weight: ${({fontWeight:e})=>e.medium};
1542    font-family: ${({fontFamily:e})=>e.regular};
1543    font-feature-settings:
1544      'liga' off,
1545      'clig' off;
1546  }
1547
1548  .wui-font-md-regular-mono {
1549    font-size: ${({textSize:e})=>e.medium};
1550    line-height: ${({typography:e})=>e["md-regular-mono"].lineHeight};
1551    letter-spacing: ${({typography:e})=>e["md-regular-mono"].letterSpacing};
1552    font-weight: ${({fontWeight:e})=>e.regular};
1553    font-family: ${({fontFamily:e})=>e.mono};
1554  }
1555
1556  .wui-font-md-regular {
1557    font-size: ${({textSize:e})=>e.medium};
1558    line-height: ${({typography:e})=>e["md-regular"].lineHeight};
1559    letter-spacing: ${({typography:e})=>e["md-regular"].letterSpacing};
1560    font-weight: ${({fontWeight:e})=>e.regular};
1561    font-family: ${({fontFamily:e})=>e.regular};
1562    font-feature-settings:
1563      'liga' off,
1564      'clig' off;
1565  }
1566
1567  .wui-font-md-medium {
1568    font-size: ${({textSize:e})=>e.medium};
1569    line-height: ${({typography:e})=>e["md-medium"].lineHeight};
1570    letter-spacing: ${({typography:e})=>e["md-medium"].letterSpacing};
1571    font-weight: ${({fontWeight:e})=>e.medium};
1572    font-family: ${({fontFamily:e})=>e.regular};
1573    font-feature-settings:
1574      'liga' off,
1575      'clig' off;
1576  }
1577
1578  .wui-font-sm-regular-mono {
1579    font-size: ${({textSize:e})=>e.small};
1580    line-height: ${({typography:e})=>e["sm-regular-mono"].lineHeight};
1581    letter-spacing: ${({typography:e})=>e["sm-regular-mono"].letterSpacing};
1582    font-weight: ${({fontWeight:e})=>e.regular};
1583    font-family: ${({fontFamily:e})=>e.mono};
1584  }
1585
1586  .wui-font-sm-regular {
1587    font-size: ${({textSize:e})=>e.small};
1588    line-height: ${({typography:e})=>e["sm-regular"].lineHeight};
1589    letter-spacing: ${({typography:e})=>e["sm-regular"].letterSpacing};
1590    font-weight: ${({fontWeight:e})=>e.regular};
1591    font-family: ${({fontFamily:e})=>e.regular};
1592    font-feature-settings:
1593      'liga' off,
1594      'clig' off;
1595  }
1596
1597  .wui-font-sm-medium {
1598    font-size: ${({textSize:e})=>e.small};
1599    line-height: ${({typography:e})=>e["sm-medium"].lineHeight};
1600    letter-spacing: ${({typography:e})=>e["sm-medium"].letterSpacing};
1601    font-weight: ${({fontWeight:e})=>e.medium};
1602    font-family: ${({fontFamily:e})=>e.regular};
1603    font-feature-settings:
1604      'liga' off,
1605      'clig' off;
1606  }
1607`});var R6,lGe,dm,xs=h(()=>{le();Ue();y7();Tt();kt();Pt();fbe();R6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},lGe={primary:Ut.tokens.theme.textPrimary,secondary:Ut.tokens.theme.textSecondary,tertiary:Ut.tokens.theme.textTertiary,invert:Ut.tokens.theme.textInvert,error:Ut.tokens.core.textError,success:Ut.tokens.core.textSuccess,warning:Ut.tokens.core.textWarning,"accent-primary":Ut.tokens.core.textAccentPrimary},dm=class extends ne{constructor(){super(...arguments),this.variant="md-regular",this.color="inherit",this.align="left",this.lineClamp=void 0,this.display="inline-flex"}render(){let t={[`wui-font-${this.variant}
1607`]:!0,[`wui-line-clamp-${this.lineClamp}`]:!!this.lineClamp};return this.style.cssText=`
1608      display: ${this.display};
1609      --local-align: ${this.align};
1610      --local-color: ${this.color==="inherit"?"inherit":lGe[this.color??"primary"]};
1611      `,$`<slot class=${N6(t)}></slot>`}};dm.styles=[ke,pbe];R6([V()],dm.prototype,"variant",void 0);R6([V()],dm.prototype,"color",void 0);R6([V()],dm.prototype,"align",void 0);R6([V()],dm.prototype,"lineClamp",void 0);R6([V()],dm.prototype,"display",void 0);dm=R6([te("wui-text")],dm)});var hbe,mbe=h(()=>{Tt();hbe=ce`
1612  :host {
1613    display: inline-flex;
1614    justify-content: center;
1615    align-items: center;
1616    border-radius: ${({borderRadius:e})=>e[2]};
1617    padding: ${({spacing:e})=>e[1]} !important;
1618    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
1619    position: relative;
1620  }
1621
1622  :host([data-padding='2']) {
1623    padding: ${({spacing:e})=>e[2]} !important;
1624  }
1625
1626  :host:after {
1627    content: '';
1628    position: absolute;
1629    top: 0;
1630    left: 0;
1631    width: 100%;
1632    height: 100%;
1633    border-radius: ${({borderRadius:e})=>e[2]};
1634  }
1635
1636  :host > wui-icon {
1637    z-index: 10;
1638  }
1639
1640  /* -- Colors --------------------------------------------------- */
1641  :host([data-color='accent-primary']) {
1642    color: ${({tokens:e})=>e.core.iconAccentPrimary};
1643  }
1644
1645  :host([data-color='accent-primary']):after {
1646    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
1647  }
1648
1649  :host([data-color='default']),
1650  :host([data-color='secondary']) {
1651    color: ${({tokens:e})=>e.theme.iconDefault};
1652  }
1653
1654  :host([data-color='default']):after {
1655    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1656  }
1657
1658  :host([data-color='secondary']):after {
1659    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1660  }
1661
1662  :host([data-color='success']) {
1663    color: ${({tokens:e})=>e.core.iconSuccess};
1664  }
1665
1666  :host([data-color='success']):after {
1667    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
1668  }
1669
1670  :host([data-color='error']) {
1671    color: ${({tokens:e})=>e.core.iconError};
1672  }
1673
1674  :host([data-color='error']):after {
1675    background-color: ${({tokens:e})=>e.core.backgroundError};
1676  }
1677
1678  :host([data-color='warning']) {
1679    color: ${({tokens:e})=>e.core.iconWarning};
1680  }
1681
1682  :host([data-color='warning']):after {
1683    background-color: ${({tokens:e})=>e.core.backgroundWarning};
1684  }
1685
1686  :host([data-color='inverse']) {
1687    color: ${({tokens:e})=>e.theme.iconInverse};
1688  }
1689
1690  :host([data-color='inverse']):after {
1691    background-color: transparent;
1692  }
1693`});var d5,e2,O6=h(()=>{le();Ue();Pr();Jn();kt();Pt();mbe();d5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},e2=class extends ne{constructor(){super(...arguments),this.icon="copy",this.size="md",this.padding="1",this.color="default"}render(){return this.dataset.padding=this.padding,this.dataset.color=this.color,$`
1694      <wui-icon size=${ve(this.size)} name=${this.icon} color="inherit"></wui-icon>
1695    `}};e2.styles=[ke,Zt,hbe];d5([V()],e2.prototype,"icon",void 0);d5([V()],e2.prototype,"size",void 0);d5([V()],e2.prototype,"padding",void 0);d5([V()],e2.prototype,"color",void 0);e2=d5([te("wui-icon-box")],e2)});var gbe,ybe=h(()=>{Tt();gbe=ce`
1696  :host {
1697    display: block;
1698    width: var(--local-width);
1699    height: var(--local-height);
1700  }
1701
1702  img {
1703    display: block;
1704    width: 100%;
1705    height: 100%;
1706    object-fit: cover;
1707    object-position: center center;
1708    border-radius: inherit;
1709    user-select: none;
1710    user-drag: none;
1711    -webkit-user-drag: none;
1712    -khtml-user-drag: none;
1713    -moz-user-drag: none;
1714    -o-user-drag: none;
1715  }
1716
1717  :host([data-boxed='true']) {
1718    width: 40px;
1719    height: 40px;
1720    display: flex;
1721    align-items: center;
1722    justify-content: center;
1723    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1724    border-radius: ${({borderRadius:e})=>e[2]};
1725  }
1726
1727  :host([data-boxed='true']) img {
1728    width: 20px;
1729    height: 20px;
1730    border-radius: ${({borderRadius:e})=>e[16]};
1731  }
1732
1733  :host([data-full='true']) img {
1734    width: 100%;
1735    height: 100%;
1736  }
1737
1738  :host([data-boxed='true']) wui-icon {
1739    width: 20px;
1740    height: 20px;
1741  }
1742
1743  :host([data-icon='error']) {
1744    background-color: ${({tokens:e})=>e.core.backgroundError};
1745  }
1746
1747  :host([data-rounded='true']) {
1748    border-radius: ${({borderRadius:e})=>e[16]};
1749  }
1750`});var gd,uc,t2=h(()=>{le();Ue();Pr();kt();Pt();ybe();gd=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},uc=class extends ne{constructor(){super(...arguments),this.src="./path/to/image.jpg",this.alt="Image",this.size=void 0,this.boxed=!1,this.rounded=!1,this.fullSize=!1}render(){let t={inherit:"inherit",xxs:"2",xs:"3",sm:"4",md:"4",mdl:"5",lg:"5",xl:"6",xxl:"7","3xl":"8","4xl":"9","5xl":"10"};return this.style.cssText=`
1751      --local-width: ${this.size?`var(--apkt-spacing-${t[this.size]});`:"100%"};
1752      --local-height: ${this.size?`var(--apkt-spacing-${t[this.size]});`:"100%"};
1753      `,this.dataset.boxed=this.boxed?"true":"false",this.dataset.rounded=this.rounded?"true":"false",this.dataset.full=this.fullSize?"true":"false",this.dataset.icon=this.iconColor||"inherit",this.icon?$`<wui-icon
1754        color=${this.iconColor||"inherit"}
1755        name=${this.icon}
1756        size="lg"
1757      ></wui-icon> `:this.logo?$`<wui-icon size="lg" color="inherit" name=${this.logo}></wui-icon> `:$`<img src=${ve(this.src)} alt=${this.alt} @error=${this.handleImageError} />`}handleImageError(){this.dispatchEvent(new CustomEvent("onLoadError",{bubbles:!0,composed:!0}))}};uc.styles=[ke,gbe];gd([V()],uc.prototype,"src",void 0);gd([V()],uc.prototype,"logo",void 0);gd([V()],uc.prototype,"icon",void 0);gd([V()],uc.prototype,"iconColor",void 0);gd([V()],uc.prototype,"alt",void 0);gd([V()],uc.prototype,"size",void 0);gd([V({type:Boolean})],uc.prototype,"boxed",void 0);gd([V({type:Boolean})],uc.prototype,"rounded",void 0);gd([V({type:Boolean})],uc.prototype,"fullSize",void 0);uc=gd([te("wui-image")],uc)});var wbe,bbe=h(()=>{Tt();wbe=ce`
1758  :host {
1759    position: relative;
1760    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
1761    display: flex;
1762    justify-content: center;
1763    align-items: center;
1764    border-radius: inherit;
1765    border-radius: var(--local-border-radius);
1766  }
1767
1768  :host([data-image='true']) {
1769    background-color: transparent;
1770  }
1771
1772  :host > wui-flex {
1773    overflow: hidden;
1774    border-radius: inherit;
1775    border-radius: var(--local-border-radius);
1776  }
1777
1778  :host([data-size='sm']) {
1779    width: 32px;
1780    height: 32px;
1781  }
1782
1783  :host([data-size='md']) {
1784    width: 40px;
1785    height: 40px;
1786  }
1787
1788  :host([data-size='lg']) {
1789    width: 56px;
1790    height: 56px;
1791  }
1792
1793  :host([name='Extension'])::after {
1794    border: 1px solid ${({colors:e})=>e.accent010};
1795  }
1796
1797  :host([data-wallet-icon='allWallets'])::after {
1798    border: 1px solid ${({colors:e})=>e.accent010};
1799  }
1800
1801  wui-icon[data-parent-size='inherit'] {
1802    width: 75%;
1803    height: 75%;
1804    align-items: center;
1805  }
1806
1807  wui-icon {
1808    color: ${({tokens:e})=>e.theme.iconDefault};
1809  }
1810
1811  wui-icon[data-parent-size='sm'] {
1812    width: 24px;
1813    height: 24px;
1814  }
1815
1816  wui-icon[data-parent-size='md'] {
1817    width: 32px;
1818    height: 32px;
1819  }
1820
1821  :host > wui-icon-box {
1822    position: absolute;
1823    overflow: hidden;
1824    right: -1px;
1825    bottom: -2px;
1826    z-index: 1;
1827    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
1828    padding: 1px;
1829  }
1830`});var r2,ff,w7=h(()=>{le();Ue();Jn();t2();kt();Pt();O6();bbe();r2=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},ff=class extends ne{constructor(){super(...arguments),this.size="md",this.name="",this.installed=!1,this.badgeSize="xs"}render(){let t="1";return this.size==="lg"?t="4":this.size==="md"?t="2":this.size==="sm"&&(t="1"),this.style.cssText=`
1831       --local-border-radius: var(--apkt-borderRadius-${t});
1832   `,this.dataset.size=this.size,this.imageSrc&&(this.dataset.image="true"),this.walletIcon&&(this.dataset.walletIcon=this.walletIcon),$`
1833      <wui-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wui-flex>
1834    `}templateVisual(){return this.imageSrc?$`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:this.walletIcon?$`<wui-icon size="md" color="default" name=${this.walletIcon}></wui-icon>`:$`<wui-icon
1835      data-parent-size=${this.size}
1836      size="inherit"
1837      color="inherit"
1838      name="wallet"
1839    ></wui-icon>`}};ff.styles=[ke,wbe];r2([V()],ff.prototype,"size",void 0);r2([V()],ff.prototype,"name",void 0);r2([V()],ff.prototype,"imageSrc",void 0);r2([V()],ff.prototype,"walletIcon",void 0);r2([V({type:Boolean})],ff.prototype,"installed",void 0);r2([V()],ff.prototype,"badgeSize",void 0);ff=r2([te("wui-wallet-image")],ff)});var xbe,vbe=h(()=>{Tt();xbe=ce`
1840  :host {
1841    position: relative;
1842    border-radius: ${({borderRadius:e})=>e[2]};
1843    width: 40px;
1844    height: 40px;
1845    overflow: hidden;
1846    background: ${({tokens:e})=>e.theme.foregroundPrimary};
1847    display: flex;
1848    justify-content: center;
1849    align-items: center;
1850    flex-wrap: wrap;
1851    column-gap: ${({spacing:e})=>e[1]};
1852    padding: ${({spacing:e})=>e[1]};
1853  }
1854
1855  :host > wui-wallet-image {
1856    width: 14px;
1857    height: 14px;
1858    border-radius: 2px;
1859  }
1860`});var Ebe,IV,b7,Abe=h(()=>{le();Ue();Pr();kt();Pt();O6();w7();vbe();Ebe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},IV=4,b7=class extends ne{constructor(){super(...arguments),this.walletImages=[]}render(){let t=this.walletImages.length<IV;return $`${this.walletImages.slice(0,IV).map(({src:r,walletName:n})=>$`
1861          <wui-wallet-image
1862            size="sm"
1863            imageSrc=${r}
1864            name=${ve(n)}
1865          ></wui-wallet-image>
1866        `)}
1867    ${t?[...Array(IV-this.walletImages.length)].map(()=>$` <wui-wallet-image size="sm" name=""></wui-wallet-image>`):null} `}};b7.styles=[ke,xbe];Ebe([V({type:Array})],b7.prototype,"walletImages",void 0);b7=Ebe([te("wui-all-wallets-image")],b7)});var Cbe,Sbe=h(()=>{Tt();Cbe=ce`
1868  :host {
1869    display: flex;
1870    justify-content: center;
1871    align-items: center;
1872    gap: ${({spacing:e})=>e[1]};
1873    text-transform: uppercase;
1874    white-space: nowrap;
1875  }
1876
1877  :host([data-variant='accent']) {
1878    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
1879    color: ${({tokens:e})=>e.core.textAccentPrimary};
1880  }
1881
1882  :host([data-variant='info']) {
1883    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1884    color: ${({tokens:e})=>e.theme.textSecondary};
1885  }
1886
1887  :host([data-variant='success']) {
1888    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
1889    color: ${({tokens:e})=>e.core.textSuccess};
1890  }
1891
1892  :host([data-variant='warning']) {
1893    background-color: ${({tokens:e})=>e.core.backgroundWarning};
1894    color: ${({tokens:e})=>e.core.textWarning};
1895  }
1896
1897  :host([data-variant='error']) {
1898    background-color: ${({tokens:e})=>e.core.backgroundError};
1899    color: ${({tokens:e})=>e.core.textError};
1900  }
1901
1902  :host([data-variant='certified']) {
1903    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1904    color: ${({tokens:e})=>e.theme.textSecondary};
1905  }
1906
1907  :host([data-size='md']) {
1908    height: 30px;
1909    padding: 0 ${({spacing:e})=>e[2]};
1910    border-radius: ${({borderRadius:e})=>e[2]};
1911  }
1912
1913  :host([data-size='sm']) {
1914    height: 20px;
1915    padding: 0 ${({spacing:e})=>e[1]};
1916    border-radius: ${({borderRadius:e})=>e[1]};
1917  }
1918`});var x7,B6,TV=h(()=>{le();Ue();Jn();xs();kt();Pt();Sbe();x7=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},B6=class extends ne{constructor(){super(...arguments),this.variant="accent",this.size="md",this.icon=void 0}render(){this.dataset.variant=this.variant,this.dataset.size=this.size;let t=this.size==="md"?"md-medium":"sm-medium",r=this.size==="md"?"md":"sm";return $`
1919      ${this.icon?$`<wui-icon size=${r} name=${this.icon}></wui-icon>`:null}
1920      <wui-text
1921        display="inline"
1922        data-variant=${this.variant}
1923        variant=${t}
1924        color="inherit"
1925      >
1926        <slot></slot>
1927      </wui-text>
1928    `}};B6.styles=[ke,Cbe];x7([V()],B6.prototype,"variant",void 0);x7([V()],B6.prototype,"size",void 0);x7([V()],B6.prototype,"icon",void 0);B6=x7([te("wui-tag")],B6)});var Ibe,Tbe=h(()=>{Tt();Ibe=ce`
1929  :host {
1930    width: 100%;
1931  }
1932
1933  button {
1934    column-gap: ${({spacing:e})=>e[2]};
1935    padding: ${({spacing:e})=>e[3]};
1936    width: 100%;
1937    background-color: transparent;
1938    border-radius: ${({borderRadius:e})=>e[4]};
1939    color: ${({tokens:e})=>e.theme.textPrimary};
1940  }
1941
1942  button > wui-wallet-image {
1943    background: ${({tokens:e})=>e.theme.foregroundSecondary};
1944  }
1945
1946  button > wui-text:nth-child(2) {
1947    display: flex;
1948    flex: 1;
1949  }
1950
1951  button:hover:enabled {
1952    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1953  }
1954
1955  button[data-all-wallets='true'] {
1956    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1957  }
1958
1959  button[data-all-wallets='true']:hover:enabled {
1960    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1961  }
1962
1963  button:focus-visible:enabled {
1964    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1965    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
1966  }
1967
1968  button:disabled {
1969    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
1970    opacity: 0.5;
1971    cursor: not-allowed;
1972  }
1973
1974  button:disabled > wui-tag {
1975    background-color: ${({tokens:e})=>e.core.glass010};
1976    color: ${({tokens:e})=>e.theme.foregroundTertiary};
1977  }
1978
1979  wui-flex.namespace-icon {
1980    width: 16px;
1981    height: 16px;
1982    border-radius: ${({borderRadius:e})=>e.round};
1983    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
1984    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.backgroundPrimary};
1985    transition: box-shadow var(--apkt-durations-lg) var(--apkt-easings-ease-out-power-2);
1986  }
1987
1988  button:hover:enabled wui-flex.namespace-icon {
1989    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
1990  }
1991
1992  wui-flex.namespace-icon > wui-icon {
1993    width: 10px;
1994    height: 10px;
1995  }
1996
1997  wui-flex.namespace-icon:not(:first-child) {
1998    margin-left: -4px;
1999  }
2000`});var Ui,uGe,vs,_be=h(()=>{le();Ue();Pr();Jn();xs();O6();kt();Pt();Abe();TV();w7();Tbe();Ui=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},uGe={eip155:"ethereum",solana:"solana",bip122:"bitcoin",polkadot:void 0,cosmos:void 0,sui:void 0,stacks:void 0,ton:"ton",tron:"tron"},vs=class extends ne{constructor(){super(...arguments),this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.namespaces=[],this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100"}render(){return this.dataset.size=this.size,$`
2001      <button
2002        ?disabled=${this.disabled}
2003        data-all-wallets=${this.showAllWallets}
2004        tabindex=${ve(this.tabIdx)}
2005      >
2006        ${this.templateAllWallets()} ${this.templateWalletImage()}
2007        <wui-flex flexDirection="column" justifyContent="center" alignItems="flex-start" gap="1">
2008          <wui-text variant="lg-regular" color="inherit">${this.name}</wui-text>
2009          ${this.templateNamespaces()}
2010        </wui-flex>
2011        ${this.templateStatus()}
2012        <wui-icon name="chevronRight" size="lg" color="default"></wui-icon>
2013      </button>
2014    `}templateNamespaces(){return this.namespaces?.length?$`<wui-flex alignItems="center" gap="0">
2015        ${this.namespaces.map((t,r)=>$`<wui-flex
2016              alignItems="center"
2017              justifyContent="center"
2018              zIndex=${(this.namespaces?.length??0)*2-r}
2019              class="namespace-icon"
2020            >
2021              <wui-icon
2022                name=${ve(uGe[t])}
2023                size="sm"
2024                color="default"
2025              ></wui-icon>
2026            </wui-flex>`)}
2027      </wui-flex>`:null}templateAllWallets(){return this.showAllWallets&&this.imageSrc?$` <wui-all-wallets-image .imageeSrc=${this.imageSrc}> </wui-all-wallets-image> `:this.showAllWallets&&this.walletIcon?$` <wui-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wui-wallet-image> `:null}templateWalletImage(){return!this.showAllWallets&&this.imageSrc?$`<wui-wallet-image
2028        size=${ve(this.size==="sm"?"sm":"md")}
2029        imageSrc=${this.imageSrc}
2030        name=${this.name}
2031      ></wui-wallet-image>`:!this.showAllWallets&&!this.imageSrc?$`<wui-wallet-image size="sm" name=${this.name}></wui-wallet-image>`:null}templateStatus(){return this.loading?$`<wui-loading-spinner size="lg" color="accent-primary"></wui-loading-spinner>`:this.tagLabel&&this.tagVariant?$`<wui-tag size="sm" variant=${this.tagVariant}>${this.tagLabel}</wui-tag>`:null}};vs.styles=[ke,Zt,Ibe];Ui([V({type:Array})],vs.prototype,"walletImages",void 0);Ui([V()],vs.prototype,"imageSrc",void 0);Ui([V()],vs.prototype,"name",void 0);Ui([V()],vs.prototype,"size",void 0);Ui([V()],vs.prototype,"tagLabel",void 0);Ui([V()],vs.prototype,"tagVariant",void 0);Ui([V()],vs.prototype,"walletIcon",void 0);Ui([V()],vs.prototype,"tabIdx",void 0);Ui([V({type:Array})],vs.prototype,"namespaces",void 0);Ui([V({type:Boolean})],vs.prototype,"disabled",void 0);Ui([V({type:Boolean})],vs.prototype,"showAllWallets",void 0);Ui([V({type:Boolean})],vs.prototype,"loading",void 0);Ui([V({type:String})],vs.prototype,"loadingSpinnerColor",void 0);vs=Ui([te("wui-list-wallet")],vs)});var _V=h(()=>{_be()});var k6,n2,Pbe=h(()=>{le();Ue();Pr();it();st();He();_V();k6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},n2=class extends ne{constructor(){super(),this.unsubscribe=[],this.tabIdx=void 0,this.connectors=X.state.connectors,this.count=de.state.count,this.filteredCount=de.state.filteredWallets.length,this.isFetchingRecommendedWallets=de.state.isFetchingRecommendedWallets,this.unsubscribe.push(X.subscribeKey("connectors",t=>this.connectors=t),de.subscribeKey("count",t=>this.count=t),de.subscribeKey("filteredWallets",t=>this.filteredCount=t.length),de.subscribeKey("isFetchingRecommendedWallets",t=>this.isFetchingRecommendedWallets=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.connectors.find(l=>l.id==="walletConnect"),{allWallets:r}=W.state;if(!t||r==="HIDE"||r==="ONLY_MOBILE"&&!ee.isMobile())return null;let n=de.state.featured.length,o=this.count+n,s=o<10?o:Math.floor(o/10)*10,i=this.filteredCount>0?this.filteredCount:s,a=`${i}`;this.filteredCount>0?a=`${this.filteredCount}`:i<o&&(a=`${i}+`);let c=J.hasAnyConnection(j.CONNECTOR_ID.WALLET_CONNECT);return $`
2032      <wui-list-wallet
2033        name="Search Wallet"
2034        walletIcon="search"
2035        showAllWallets
2036        @click=${this.onAllWallets.bind(this)}
2037        tagLabel=${a}
2038        tagVariant="info"
2039        data-testid="all-wallets"
2040        tabIdx=${ve(this.tabIdx)}
2041        .loading=${this.isFetchingRecommendedWallets}
2042        ?disabled=${c}
2043        size="sm"
2044      ></wui-list-wallet>
2045    `}onAllWallets(){xe.sendEvent({type:"track",event:"CLICK_ALL_WALLETS"}),Z.push("AllWallets",{redirectView:Z.state.data?.redirectView})}};k6([V()],n2.prototype,"tabIdx",void 0);k6([ie()],n2.prototype,"connectors",void 0);k6([ie()],n2.prototype,"count",void 0);k6([ie()],n2.prototype,"filteredCount",void 0);k6([ie()],n2.prototype,"isFetchingRecommendedWallets",void 0);n2=k6([te("w3m-all-wallets-widget")],n2)});var Nbe,Rbe=h(()=>{He();Nbe=ce`
2046  :host {
2047    margin-top: ${({spacing:e})=>e[1]};
2048  }
2049  wui-separator {
2050    margin: ${({spacing:e})=>e[3]} calc(${({spacing:e})=>e[3]} * -1)
2051      ${({spacing:e})=>e[2]} calc(${({spacing:e})=>e[3]} * -1);
2052    width: calc(100% + ${({spacing:e})=>e[3]} * 2);
2053  }
2054`});var D6,pm,Obe=h(()=>{le();Ue();Pr();it();st();He();Mr();ul();Rbe();D6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},pm=class extends ne{constructor(){super(),this.unsubscribe=[],this.explorerWallets=de.state.explorerWallets,this.connections=J.state.connections,this.connectorImages=Dn.state.connectorImages,this.loadingTelegram=!1,this.unsubscribe.push(J.subscribeKey("connections",t=>this.connections=t),Dn.subscribeKey("connectorImages",t=>this.connectorImages=t),de.subscribeKey("explorerFilteredWallets",t=>{this.explorerWallets=t?.length?t:de.state.explorerWallets}),de.subscribeKey("explorerWallets",t=>{this.explorerWallets?.length||(this.explorerWallets=t)}
2054)),ee.isTelegram()&&ee.isIos()&&(this.loadingTelegram=!J.state.wcUri,this.unsubscribe.push(J.subscribeKey("wcUri",t=>this.loadingTelegram=!t)))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return $`
2055      <wui-flex flexDirection="column" gap="2"> ${this.connectorListTemplate()} </wui-flex>
2056    `}connectorListTemplate(){return Tn.connectorList().map((t,r)=>t.kind==="connector"?this.renderConnector(t,r):this.renderWallet(t,r))}getConnectorNamespaces(t){return t.subtype==="walletConnect"?[]:t.subtype==="multiChain"?t.connector.connectors?.map(r=>r.chain)||[]:[t.connector.chain]}renderConnector(t,r){let n=t.connector,o=vt.getConnectorImage(n)||this.connectorImages[n?.imageId??""],i=(this.connections.get(n.chain)??[]).some(d=>Qr.isLowerCaseMatch(d.connectorId,n.id)),a,c;t.subtype==="walletConnect"?(a="qr code",c="accent"):t.subtype==="injected"||t.subtype==="announced"?(a=i?"connected":"installed",c=i?"info":"success"):(a=void 0,c=void 0);let l=J.hasAnyConnection(j.CONNECTOR_ID.WALLET_CONNECT),u=t.subtype==="walletConnect"||t.subtype==="external"?l:!1;return $`
2057      <w3m-list-wallet
2058        displayIndex=${r}
2059        imageSrc=${ve(o)}
2060        .installed=${!0}
2061        name=${n.name??"Unknown"}
2062        .tagVariant=${c}
2063        tagLabel=${ve(a)}
2064        data-testid=${`wallet-selector-${n.id.toLowerCase()}`}
2065        size="sm"
2066        @click=${()=>this.onClickConnector(t)}
2067        tabIdx=${ve(this.tabIdx)}
2068        ?disabled=${u}
2069        rdnsId=${ve(n.explorerWallet?.rdns||void 0)}
2070        walletRank=${ve(n.explorerWallet?.order)}
2071        .namespaces=${this.getConnectorNamespaces(t)}
2072      >
2073      </w3m-list-wallet>
2074    `}onClickConnector(t){let r=Z.state.data?.redirectView;if(t.subtype==="walletConnect"){X.setActiveConnector(t.connector),ee.isMobile()?Z.push("AllWallets"):Z.push("ConnectingWalletConnect",{redirectView:r});return}if(t.subtype==="multiChain"){X.setActiveConnector(t.connector),Z.push("ConnectingMultiChain",{redirectView:r});return}if(t.subtype==="injected"){X.setActiveConnector(t.connector),Z.push("ConnectingExternal",{connector:t.connector,redirectView:r,wallet:t.connector.explorerWallet});return}if(t.subtype==="announced"){if(t.connector.id==="walletConnect"){ee.isMobile()?Z.push("AllWallets"):Z.push("ConnectingWalletConnect",{redirectView:r});return}Z.push("ConnectingExternal",{connector:t.connector,redirectView:r,wallet:t.connector.explorerWallet});return}Z.push("ConnectingExternal",{connector:t.connector,redirectView:r})}renderWallet(t,r){let n=t.wallet,o=vt.getWalletImage(n),i=J.hasAnyConnection(j.CONNECTOR_ID.WALLET_CONNECT),a=this.loadingTelegram,c=t.subtype==="recent"?"recent":void 0,l=t.subtype==="recent"?"info":void 0;return $`
2075      <w3m-list-wallet
2076        displayIndex=${r}
2077        imageSrc=${ve(o)}
2078        name=${n.name??"Unknown"}
2079        @click=${()=>this.onClickWallet(t)}
2080        size="sm"
2081        data-testid=${`wallet-selector-${n.id}`}
2082        tabIdx=${ve(this.tabIdx)}
2083        ?loading=${a}
2084        ?disabled=${i}
2085        rdnsId=${ve(n.rdns||void 0)}
2086        walletRank=${ve(n.order)}
2087        tagLabel=${ve(c)}
2088        .tagVariant=${l}
2089      >
2090      </w3m-list-wallet>
2091    `}onClickWallet(t){let r=Z.state.data?.redirectView,n=k.state.activeChain;if(t.subtype==="featured"){X.selectWalletConnector(t.wallet);return}if(t.subtype==="recent"){if(this.loadingTelegram)return;X.selectWalletConnector(t.wallet);return}if(t.subtype==="custom"){if(this.loadingTelegram)return;Z.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:r});return}if(this.loadingTelegram)return;let o=n?X.getConnector({id:t.wallet.id,namespace:n}):void 0;o?Z.push("ConnectingExternal",{connector:o,redirectView:r}):Z.push("ConnectingWalletConnect",{wallet:t.wallet,redirectView:r})}};pm.styles=Nbe;D6([V({type:Number})],pm.prototype,"tabIdx",void 0);D6([ie()],pm.prototype,"explorerWallets",void 0);D6([ie()],pm.prototype,"connections",void 0);D6([ie()],pm.prototype,"connectorImages",void 0);D6([ie()],pm.prototype,"loadingTelegram",void 0);pm=D6([te("w3m-connector-list")],pm)});var Bbe,kbe=h(()=>{Tt();Bbe=ce`
2092  :host {
2093    flex: 1;
2094    height: 100%;
2095  }
2096
2097  button {
2098    width: 100%;
2099    height: 100%;
2100    display: inline-flex;
2101    align-items: center;
2102    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
2103    column-gap: ${({spacing:e})=>e[1]};
2104    color: ${({tokens:e})=>e.theme.textSecondary};
2105    border-radius: ${({borderRadius:e})=>e[20]};
2106    background-color: transparent;
2107    transition: background-color ${({durations:e})=>e.lg}
2108      ${({easings:e})=>e["ease-out-power-2"]};
2109    will-change: background-color;
2110  }
2111
2112  /* -- Hover & Active states ----------------------------------------------------------- */
2113  button[data-active='true'] {
2114    color: ${({tokens:e})=>e.theme.textPrimary};
2115    background-color: ${({tokens:e})=>e.theme.foregroundTertiary};
2116  }
2117
2118  button:hover:enabled:not([data-active='true']),
2119  button:active:enabled:not([data-active='true']) {
2120    wui-text,
2121    wui-icon {
2122      color: ${({tokens:e})=>e.theme.textPrimary};
2123    }
2124  }
2125`});var p5,dGe,pGe,o2,Dbe=h(()=>{le();Ue();Jn();xs();kt();Pt();kbe();p5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},dGe={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},pGe={lg:"md",md:"sm",sm:"sm"},o2=class extends ne{constructor(){super(...arguments),this.icon="mobile",this.size="md",this.label="",this.active=!1}render(){return $`
2126      <button data-active=${this.active}>
2127        ${this.icon?$`<wui-icon size=${pGe[this.size]} name=${this.icon}></wui-icon>`:""}
2128        <wui-text variant=${dGe[this.size]}> ${this.label} </wui-text>
2129      </button>
2130    `}};o2.styles=[ke,Zt,Bbe];p5([V()],o2.prototype,"icon",void 0);p5([V()],o2.prototype,"size",void 0);p5([V()],o2.prototype,"label",void 0);p5([V({type:Boolean})],o2.prototype,"active",void 0);o2=p5([te("wui-tab-item")],o2)});var Ube,Lbe=h(()=>{Tt();Ube=ce`
2131  :host {
2132    display: inline-flex;
2133    align-items: center;
2134    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2135    border-radius: ${({borderRadius:e})=>e[32]};
2136    padding: ${({spacing:e})=>e["01"]};
2137    box-sizing: border-box;
2138  }
2139
2140  :host([data-size='sm']) {
2141    height: 26px;
2142  }
2143
2144  :host([data-size='md']) {
2145    height: 36px;
2146  }
2147`});var f5,s2,Mbe=h(()=>{le();Ue();kt();Pt();Dbe();Lbe();f5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},s2=class extends ne{constructor(){super(...arguments),this.tabs=[],this.onTabChange=()=>null,this.size="md",this.activeTab=0}render(){return this.dataset.size=this.size,this.tabs.map((t,r)=>{let n=r===this.activeTab;return $`
2148        <wui-tab-item
2149          @click=${()=>this.onTabClick(r)}
2150          icon=${t.icon}
2151          size=${this.size}
2152          label=${t.label}
2153          ?active=${n}
2154          data-active=${n}
2155          data-testid="tab-${t.label?.toLowerCase()}"
2156        ></wui-tab-item>
2157      `})}onTabClick(t){this.activeTab=t,this.onTabChange(t)}};s2.styles=[ke,Zt,Ube];f5([V({type:Array})],s2.prototype,"tabs",void 0);f5([V()],s2.prototype,"onTabChange",void 0);f5([V()],s2.prototype,"size",void 0);f5([ie()],s2.prototype,"activeTab",void 0);s2=f5([te("wui-tabs")],s2)});var Hbe=h(()=>{Mbe()});var PV,v7,$be=h(()=>{le();Ue();He();Mr();Hbe();PV=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},v7=class extends ne{constructor(){super(...arguments),this.platformTabs=[],this.unsubscribe=[],this.platforms=[],this.onSelectPlatfrom=void 0}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=this.generateTabs();return $`
2158      <wui-flex justifyContent="center" .padding=${["0","0","4","0"]}>
2159        <wui-tabs .tabs=${t} .onTabChange=${this.onTabChange.bind(this)}></wui-tabs>
2160      </wui-flex>
2161    `}generateTabs(){let t=this.platforms.map(r=>r==="browser"?{label:"Browser",icon:"extension",platform:"browser"}:r==="mobile"?{label:"Mobile",icon:"mobile",platform:"mobile"}:r==="qrcode"?{label:"Mobile",icon:"mobile",platform:"qrcode"}:r==="web"?{label:"Webapp",icon:"browser",platform:"web"}:r==="desktop"?{label:"Desktop",icon:"desktop",platform:"desktop"}:{label:"Browser",icon:"extension",platform:"unsupported"});return this.platformTabs=t.map(({platform:r})=>r),t}onTabChange(t){let r=this.platformTabs[t];r&&this.onSelectPlatfrom?.(r)}};PV([V({type:Array})],v7.prototype,"platforms",void 0);PV([V()],v7.prototype,"onSelectPlatfrom",void 0);v7=PV([te("w3m-connecting-header")],v7)});var Fbe,Vbe=h(()=>{le();Fbe=yr`
2162  :host {
2163    display: flex;
2164  }
2165
2166  :host([data-size='sm']) > svg {
2167    width: 12px;
2168    height: 12px;
2169  }
2170
2171  :host([data-size='md']) > svg {
2172    width: 16px;
2173    height: 16px;
2174  }
2175
2176  :host([data-size='lg']) > svg {
2177    width: 24px;
2178    height: 24px;
2179  }
2180
2181  :host([data-size='xl']) > svg {
2182    width: 32px;
2183    height: 32px;
2184  }
2185
2186  svg {
2187    animation: rotate 1.4s linear infinite;
2188    color: var(--local-color);
2189  }
2190
2191  :host([data-size='md']) > svg > circle {
2192    stroke-width: 6px;
2193  }
2194
2195  :host([data-size='sm']) > svg > circle {
2196    stroke-width: 8px;
2197  }
2198
2199  @keyframes rotate {
2200    100% {
2201      transform: rotate(360deg);
2202    }
2203  }
2204`});var NV,h5,m5=h(()=>{le();Ue();Tt();kt();Pt();Vbe();NV=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},h5=class extends ne{constructor(){super(...arguments),this.color="primary",this.size="lg"}render(){let t={primary:Ut.tokens.theme.textPrimary,secondary:Ut.tokens.theme.textSecondary,tertiary:Ut.tokens.theme.textTertiary,invert:Ut.tokens.theme.textInvert,error:Ut.tokens.core.textError,warning:Ut.tokens.core.textWarning,"accent-primary":Ut.tokens.core.textAccentPrimary};return this.style.cssText=`
2205      --local-color: ${this.color==="inherit"?"inherit":t[this.color]};
2206      `,this.dataset.size=this.size,$`<svg viewBox="0 0 16 17" fill="none">
2207      <path
2208        d="M8.75 2.65625V4.65625C8.75 4.85516 8.67098 5.04593 8.53033 5.18658C8.38968 5.32723 8.19891 5.40625 8 5.40625C7.80109 5.40625 7.61032 5.32723 7.46967 5.18658C7.32902 5.04593 7.25 4.85516 7.25 4.65625V2.65625C7.25 2.45734 7.32902 2.26657 7.46967 2.12592C7.61032 1.98527 7.80109 1.90625 8 1.90625C8.19891 1.90625 8.38968 1.98527 8.53033 2.12592C8.67098 2.26657 8.75 2.45734 8.75 2.65625ZM14 7.90625H12C11.8011 7.90625 11.6103 7.98527 11.4697 8.12592C11.329 8.26657 11.25 8.45734 11.25 8.65625C11.25 8.85516 11.329 9.04593 11.4697 9.18658C11.6103 9.32723 11.8011 9.40625 12 9.40625H14C14.1989 9.40625 14.3897 9.32723 14.5303 9.18658C14.671 9.04593 14.75 8.85516 14.75 8.65625C14.75 8.45734 14.671 8.26657 14.5303 8.12592C14.3897 7.98527 14.1989 7.90625 14 7.90625ZM11.3588 10.9544C11.289 10.8846 11.2062 10.8293 11.115 10.7915C11.0239 10.7538 10.9262 10.7343 10.8275 10.7343C10.7288 10.7343 10.6311 10.7538 10.54 10.7915C10.4488 10.8293 10.366 10.8846 10.2963 10.9544C10.2265 11.0241 10.1711 11.107 10.1334 11.1981C10.0956 11.2893 10.0762 11.387 10.0762 11.4856C10.0762 11.5843 10.0956 11.682 10.1334 11.7731C10.1711 11.8643 10.2265 11.9471 10.2963 12.0169L11.7106 13.4312C11.8515 13.5721 12.0426 13.6513 12.2419 13.6513C12.4411 13.6513 12.6322 13.5721 12.7731 13.4312C12.914 13.2904 12.9932 13.0993 12.9932 12.9C12.9932 12.7007 12.914 12.5096 12.7731 12.3687L11.3588 10.9544ZM8 11.9062C7.80109 11.9062 7.61032 11.9853 7.46967 12.1259C7.32902 12.2666 7.25 12.4573 7.25 12.6562V14.6562C7.25 14.8552 7.32902 15.0459 7.46967 15.1866C7.61032 15.3272 7.80109 15.4062 8 15.4062C8.19891 15.4062 8.38968 15.3272 8.53033 15.1866C8.67098 15.0459 8.75 14.8552 8.75 14.6562V12.6562C8.75 12.4573 8.67098 12.2666 8.53033 12.1259C8.38968 11.9853 8.19891 11.9062 8 11.9062ZM4.64125 10.9544L3.22688 12.3687C3.08598 12.5096 3.00682 12.7007 3.00682 12.9C3.00682 13.0993 3.08598 13.2904 3.22688 13.4312C3.36777 13.5721 3.55887 13.6513 3.75813 13.6513C3.95738 13.6513 4.14848 13.5721 4.28937 13.4312L5.70375 12.0169C5.84465 11.876 5.9238 11.6849 5.9238 11.4856C5.9238 11.2864 5.84465 11.0953 5.70375 10.9544C5.56285 10.8135 5.37176 10.7343 5.1725 10.7343C4.97324 10.7343 4.78215 10.8135 4.64125 10.9544ZM4.75 8.65625C4.75 8.45734 4.67098 8.26657 4.53033 8.12592C4.38968 7.98527 4.19891 7.90625 4 7.90625H2C1.80109 7.90625 1.61032 7.98527 1.46967 8.12592C1.32902 8.26657 1.25 8.45734 1.25 8.65625C1.25 8.85516 1.32902 9.04593 1.46967 9.18658C1.61032 9.32723 1.80109 9.40625 2 9.40625H4C4.19891 9.40625 4.38968 9.32723 4.53033 9.18658C4.67098 9.04593 4.75 8.85516 4.75 8.65625ZM4.2875 3.88313C4.1466 3.74223 3.95551 3.66307 3.75625 3.66307C3.55699 3.66307 3.3659 3.74223 3.225 3.88313C3.0841 4.02402 3.00495 4.21512 3.00495 4.41438C3.00495 4.61363 3.0841 4.80473 3.225 4.94562L4.64125 6.35813C4.78215 6.49902 4.97324 6.57818 5.1725 6.57818C5.37176 6.57818 5.56285 6.49902 5.70375 6.35813C5.84465 6.21723 5.9238 6.02613 5.9238 5.82688C5.9238 5.62762 5.84465 5.43652 5.70375 5.29563L4.2875 3.88313Z"
2209        fill="currentColor"
2210      />
2211    </svg>`}};h5.styles=[ke,Fbe];NV([V()],h5.prototype,"color",void 0);NV([V()],h5.prototype,"size",void 0);h5=NV([te("wui-loading-spinner")],h5)});var zbe,jbe=h(()=>{Tt();zbe=ce`
2212  :host {
2213    width: var(--local-width);
2214  }
2215
2216  button {
2217    width: var(--local-width);
2218    white-space: nowrap;
2219    column-gap: ${({spacing:e})=>e[2]};
2220    transition:
2221      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
2222      background-color ${({durations:e})=>e.lg}
2223        ${({easings:e})=>e["ease-out-power-2"]},
2224      border-radius ${({durations:e})=>e.lg}
2225        ${({easings:e})=>e["ease-out-power-1"]};
2226    will-change: scale, background-color, border-radius;
2227    cursor: pointer;
2228  }
2229
2230  /* -- Sizes --------------------------------------------------- */
2231  button[data-size='sm'] {
2232    border-radius: ${({borderRadius:e})=>e[2]};
2233    padding: 0 ${({spacing:e})=>e[2]};
2234    height: 28px;
2235  }
2236
2237  button[data-size='md'] {
2238    border-radius: ${({borderRadius:e})=>e[3]};
2239    padding: 0 ${({spacing:e})=>e[4]};
2240    height: 38px;
2241  }
2242
2243  button[data-size='lg'] {
2244    border-radius: ${({borderRadius:e})=>e[4]};
2245    padding: 0 ${({spacing:e})=>e[5]};
2246    height: 48px;
2247  }
2248
2249  /* -- Variants --------------------------------------------------------- */
2250  button[data-variant='accent-primary'] {
2251    background-color: ${({tokens:e})=>e.core.backgroundAccentPrimary};
2252    color: ${({tokens:e})=>e.theme.textInvert};
2253  }
2254
2255  button[data-variant='accent-secondary'] {
2256    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
2257    color: ${({tokens:e})=>e.core.textAccentPrimary};
2258  }
2259
2260  button[data-variant='neutral-primary'] {
2261    background-color: ${({tokens:e})=>e.theme.backgroundInvert};
2262    color: ${({tokens:e})=>e.theme.textInvert};
2263  }
2264
2265  button[data-variant='neutral-secondary'] {
2266    background-color: transparent;
2267    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
2268    color: ${({tokens:e})=>e.theme.textPrimary};
2269  }
2270
2271  button[data-variant='neutral-tertiary'] {
2272    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2273    color: ${({tokens:e})=>e.theme.textPrimary};
2274  }
2275
2276  button[data-variant='error-primary'] {
2277    background-color: ${({tokens:e})=>e.core.textError};
2278    color: ${({tokens:e})=>e.theme.textInvert};
2279  }
2280
2281  button[data-variant='error-secondary'] {
2282    background-color: ${({tokens:e})=>e.core.backgroundError};
2283    color: ${({tokens:e})=>e.core.textError};
2284  }
2285
2286  button[data-variant='shade'] {
2287    background: var(--wui-color-gray-glass-002);
2288    color: var(--wui-color-fg-200);
2289    border: none;
2290    box-shadow: inset 0 0 0 1px var(--wui-color-gray-glass-005);
2291  }
2292
2293  /* -- Focus states --------------------------------------------------- */
2294  button[data-size='sm']:focus-visible:enabled {
2295    border-radius: 28px;
2296  }
2297
2298  button[data-size='md']:focus-visible:enabled {
2299    border-radius: 38px;
2300  }
2301
2302  button[data-size='lg']:focus-visible:enabled {
2303    border-radius: 48px;
2304  }
2305  button[data-variant='shade']:focus-visible:enabled {
2306    background: var(--wui-color-gray-glass-005);
2307    box-shadow:
2308      inset 0 0 0 1px var(--wui-color-gray-glass-010),
2309      0 0 0 4px var(--wui-color-gray-glass-002);
2310  }
2311
2312  /* -- Hover & Active states ----------------------------------------------------------- */
2313  @media (hover: hover) {
2314    button[data-size='sm']:hover:enabled {
2315      border-radius: 28px;
2316    }
2317
2318    button[data-size='md']:hover:enabled {
2319      border-radius: 38px;
2320    }
2321
2322    button[data-size='lg']:hover:enabled {
2323      border-radius: 48px;
2324    }
2325
2326    button[data-variant='shade']:hover:enabled {
2327      background: var(--wui-color-gray-glass-002);
2328    }
2329
2330    button[data-variant='shade']:active:enabled {
2331      background: var(--wui-color-gray-glass-005);
2332    }
2333  }
2334
2335  button[data-size='sm']:active:enabled {
2336    border-radius: 28px;
2337  }
2338
2339  button[data-size='md']:active:enabled {
2340    border-radius: 38px;
2341  }
2342
2343  button[data-size='lg']:active:enabled {
2344    border-radius: 48px;
2345  }
2346
2347  /* -- Disabled states --------------------------------------------------- */
2348  button:disabled {
2349    opacity: 0.3;
2350  }
2351`});var i2,fGe,hGe,hf,RV=h(()=>{le();Ue();Jn();m5();xs();kt();Pt();jbe();i2=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},fGe={lg:"lg-regular-mono",md:"md-regular-mono",sm:"sm-regular-mono"},hGe={lg:"md",md:"md",sm:"sm"},hf=class extends ne{constructor(){super(...arguments),this.size="lg",this.disabled=!1,this.fullWidth=!1,this.loading=!1,this.variant="accent-primary"}render(){this.style.cssText=`
2352    --local-width: ${this.fullWidth?"100%":"auto"};
2353     `;let t=this.textVariant??fGe[this.size];return $`
2354      <button data-variant=${this.variant} data-size=${this.size} ?disabled=${this.disabled}>
2355        ${this.loadingTemplate()}
2356        <slot name="iconLeft"></slot>
2357        <wui-text variant=${t} color="inherit">
2358          <slot></slot>
2359        </wui-text>
2360        <slot name="iconRight"></slot>
2361      </button>
2362    `}loadingTemplate(){if(this.loading){let t=hGe[this.size],r=this.variant==="neutral-primary"||this.variant==="accent-primary"?"invert":"primary";return $`<wui-loading-spinner color=${r} size=${t}></wui-loading-spinner>`}return null}};hf.styles=[ke,Zt,zbe];i2([V()],hf.prototype,"size",void 0);i2([V({type:Boolean})],hf.prototype,"disabled",void 0);i2([V({type:Boolean})],hf.prototype,"fullWidth",void 0);i2([V({type:Boolean})],hf.prototype,"loading",void 0);i2([V()],hf.prototype,"variant",void 0);i2([V()],hf.prototype,"textVariant",void 0);hf=i2([te("wui-button")],hf)});var g5=h(()=>{RV()});var mf=h(()=>{Jn()});var E7=h(()=>{O6()});var qbe,Wbe=h(()=>{Tt();qbe=ce`
2363  button {
2364    border: none;
2365    background: transparent;
2366    height: 20px;
2367    padding: ${({spacing:e})=>e[2]};
2368    column-gap: ${({spacing:e})=>e[1]};
2369    border-radius: ${({borderRadius:e})=>e[1]};
2370    padding: 0 ${({spacing:e})=>e[1]};
2371    border-radius: ${({spacing:e})=>e[1]};
2372  }
2373
2374  /* -- Variants --------------------------------------------------------- */
2375  button[data-variant='accent'] {
2376    color: ${({tokens:e})=>e.core.textAccentPrimary};
2377  }
2378
2379  button[data-variant='secondary'] {
2380    color: ${({tokens:e})=>e.theme.textSecondary};
2381  }
2382
2383  /* -- Focus states --------------------------------------------------- */
2384  button:focus-visible:enabled {
2385    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
2386  }
2387
2388  button[data-variant='accent']:focus-visible:enabled {
2389    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
2390  }
2391
2392  button[data-variant='secondary']:focus-visible:enabled {
2393    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2394  }
2395
2396  /* -- Hover & Active states ----------------------------------------------------------- */
2397  button[data-variant='accent']:hover:enabled {
2398    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
2399  }
2400
2401  button[data-variant='secondary']:hover:enabled {
2402    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2403  }
2404
2405  button[data-variant='accent']:focus-visible {
2406    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
2407  }
2408
2409  button[data-variant='secondary']:focus-visible {
2410    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
2411    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
2412  }
2413
2414  button[disabled] {
2415    opacity: 0.5;
2416    cursor: not-allowed;
2417  }
2418`});var y5,mGe,gGe,a2,Kbe=h(()=>{le();Ue();Jn();xs();kt();Pt();Wbe();y5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},mGe={sm:"sm-medium",md:"md-medium"},gGe={accent:"accent-primary",secondary:"secondary"},a2=class extends ne{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.variant="accent",this.icon=void 0}render(){return $`
2419      <button ?disabled=${this.disabled} data-variant=${this.variant}>
2420        <slot name="iconLeft"></slot>
2421        <wui-text
2422          color=${gGe[this.variant]}
2423          variant=${mGe[this.size]}
2424        >
2425          <slot></slot>
2426        </wui-text>
2427        ${this.iconTemplate()}
2428      </button>
2429    `}iconTemplate(){return this.icon?$`<wui-icon name=${this.icon} size="sm"></wui-icon>`:null}};a2.styles=[ke,Zt,qbe];y5([V()],a2.prototype,"size",void 0);y5([V({type:Boolean})],a2.prototype,"disabled",void 0);y5([V()],a2.prototype,"variant",void 0);y5([V()],a2.prototype,"icon",void 0);a2=y5([te("wui-link")],a2)});var A7=h(()=>{Kbe()});var Zbe,Gbe=h(()=>{Tt();Zbe=ce`
2430  :host {
2431    display: block;
2432    width: 100px;
2433    height: 100px;
2434  }
2435
2436  svg {
2437    width: 100px;
2438    height: 100px;
2439  }
2440
2441  rect {
2442    fill: none;
2443    stroke: ${e=>e.colors.accent100};
2444    stroke-width: 3px;
2445    stroke-linecap: round;
2446    animation: dash 1s linear infinite;
2447  }
2448
2449  @keyframes dash {
2450    to {
2451      stroke-dashoffset: 0px;
2452    }
2453  }
2454`});var Ybe,C7,Jbe=h(()=>{le();Ue();kt();Pt();Gbe();Ybe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},C7=class extends ne{constructor(){super(...arguments),this.radius=36}render(){return this.svgLoaderTemplate()}svgLoaderTemplate(){let t=this.radius>50?50:this.radius,n=36-t,o=116+n,s=245+n,i=360+n*1.75;return $`
2455      <svg viewBox="0 0 110 110" width="110" height="110">
2456        <rect
2457          x="2"
2458          y="2"
2459          width="106"
2460          height="106"
2461          rx=${t}
2462          stroke-dasharray="${o} ${s}"
2463          stroke-dashoffset=${i}
2464        />
2465      </svg>
2466    `}};C7.styles=[ke,Zbe];Ybe([V({type:Number})],C7.prototype,"radius",void 0);C7=Ybe([te("wui-loading-thumbnail")],C7)});var Qbe=h(()=>{Jbe()});var Mn=h(()=>{xs()});var w5=h(()=>{w7()});var Xbe,e6e=h(()=>{Tt();Xbe=ce`
2467  wui-flex {
2468    width: 100%;
2469    height: 52px;
2470    box-sizing: border-box;
2471    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
2472    border-radius: ${({borderRadius:e})=>e[5]};
2473    padding-left: ${({spacing:e})=>e[3]};
2474    padding-right: ${({spacing:e})=>e[3]};
2475    display: flex;
2476    align-items: center;
2477    justify-content: space-between;
2478    gap: ${({spacing:e})=>e[6]};
2479  }
2480
2481  wui-text {
2482    color: ${({tokens:e})=>e.theme.textSecondary};
2483  }
2484
2485  wui-icon {
2486    width: 12px;
2487    height: 12px;
2488  }
2489`});var S7,U6,t6e=h(()=>{le();Ue();Jn();xs();Zg();kt();Pt();RV();e6e();S7=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},U6=class extends ne{constructor(){super(...arguments),this.disabled=!1,this.label="",this.buttonLabel=""}render(){return $`
2490      <wui-flex justifyContent="space-between" alignItems="center">
2491        <wui-text variant="lg-regular" color="inherit">${this.label}</wui-text>
2492        <wui-button variant="accent-secondary" size="sm">
2493          ${this.buttonLabel}
2494          <wui-icon name="chevronRight" color="inherit" size="inherit" slot="iconRight"></wui-icon>
2495        </wui-button>
2495
2496      </wui-flex>
2497    `}};U6.styles=[ke,Zt,Xbe];S7([V({type:Boolean})],U6.prototype,"disabled",void 0);S7([V()],U6.prototype,"label",void 0);S7([V()],U6.prototype,"buttonLabel",void 0);U6=S7([te("wui-cta-button")],U6)});var r6e=h(()=>{t6e()});var n6e,o6e=h(()=>{He();n6e=ce`
2498  :host {
2499    display: block;
2500    padding: 0 ${({spacing:e})=>e[5]} ${({spacing:e})=>e[5]};
2501  }
2502`});var s6e,I7,T7=h(()=>{le();Ue();st();He();r6e();o6e();s6e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},I7=class extends ne{constructor(){super(...arguments),this.wallet=void 0}render(){if(!this.wallet)return this.style.display="none",null;let{name:t,app_store:r,play_store:n,chrome_store:o,homepage:s}=this.wallet,i=ee.isMobile(),a=ee.isIos(),c=ee.isAndroid(),l=[r,n,s,o].filter(Boolean).length>1,u=pr.getTruncateString({string:t,charsStart:12,charsEnd:0,truncate:"end"});return l&&!i?$`
2503        <wui-cta-button
2504          label=${`Don't have ${u}?`}
2505          buttonLabel="Get"
2506          @click=${()=>Z.push("Downloads",{wallet:this.wallet})}
2507        ></wui-cta-button>
2508      `:!l&&s?$`
2509        <wui-cta-button
2510          label=${`Don't have ${u}?`}
2511          buttonLabel="Get"
2512          @click=${this.onHomePage.bind(this)}
2513        ></wui-cta-button>
2514      `:r&&a?$`
2515        <wui-cta-button
2516          label=${`Don't have ${u}?`}
2517          buttonLabel="Get"
2518          @click=${this.onAppStore.bind(this)}
2519        ></wui-cta-button>
2520      `:n&&c?$`
2521        <wui-cta-button
2522          label=${`Don't have ${u}?`}
2523          buttonLabel="Get"
2524          @click=${this.onPlayStore.bind(this)}
2525        ></wui-cta-button>
2526      `:(this.style.display="none",null)}onAppStore(){this.wallet?.app_store&&ee.openHref(this.wallet.app_store,"_blank")}onPlayStore(){this.wallet?.play_store&&ee.openHref(this.wallet.play_store,"_blank")}onHomePage(){this.wallet?.homepage&&ee.openHref(this.wallet.homepage,"_blank")}};I7.styles=[n6e];s6e([V({type:Object})],I7.prototype,"wallet",void 0);I7=s6e([te("w3m-mobile-download-links")],I7)});var i6e,a6e=h(()=>{He();i6e=ce`
2527  @keyframes shake {
2528    0% {
2529      transform: translateX(0);
2530    }
2531    25% {
2532      transform: translateX(3px);
2533    }
2534    50% {
2535      transform: translateX(-3px);
2536    }
2537    75% {
2538      transform: translateX(3px);
2539    }
2540    100% {
2541      transform: translateX(0);
2542    }
2543  }
2544
2545  wui-flex:first-child:not(:only-child) {
2546    position: relative;
2547  }
2548
2549  wui-wallet-image {
2550    width: 56px;
2551    height: 56px;
2552  }
2553
2554  wui-loading-thumbnail {
2555    position: absolute;
2556  }
2557
2558  wui-icon-box {
2559    position: absolute;
2560    right: calc(${({spacing:e})=>e[1]} * -1);
2561    bottom: calc(${({spacing:e})=>e[1]} * -1);
2562    opacity: 0;
2563    transform: scale(0.5);
2564    transition-property: opacity, transform;
2565    transition-duration: ${({durations:e})=>e.lg};
2566    transition-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
2567    will-change: opacity, transform;
2568  }
2569
2570  wui-text[align='center'] {
2571    width: 100%;
2572    padding: 0px ${({spacing:e})=>e[4]};
2573  }
2574
2575  [data-error='true'] wui-icon-box {
2576    opacity: 1;
2577    transform: scale(1);
2578  }
2579
2580  [data-error='true'] > wui-flex:first-child {
2581    animation: shake 250ms ${({easings:e})=>e["ease-out-power-2"]} both;
2582  }
2583
2584  [data-retry='false'] wui-link {
2585    display: none;
2586  }
2587
2588  [data-retry='true'] wui-link {
2589    display: block;
2590    opacity: 1;
2591  }
2592
2593  w3m-mobile-download-links {
2594    padding: 0px;
2595    width: 100%;
2596  }
2597`});var dl,Xr,L6=h(()=>{le();Ue();Pr();st();g5();Mr();mf();E7();A7();Qbe();Mn();w5();T7();a6e();dl=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Xr=class extends ne{constructor(){super(),this.wallet=Z.state.data?.wallet,this.connector=Z.state.data?.connector,this.timeout=void 0,this.secondaryBtnIcon="refresh",this.onConnect=void 0,this.onRender=void 0,this.onAutoConnect=void 0,this.isWalletConnect=!0,this.unsubscribe=[],this.imageSrc=vt.getConnectorImage(this.connector)??vt.getWalletImage(this.wallet),this.name=this.wallet?.name??this.connector?.name??"Wallet",this.isRetrying=!1,this.uri=J.state.wcUri,this.error=J.state.wcError,this.ready=!1,this.showRetry=!1,this.label=void 0,this.secondaryBtnLabel="Try again",this.secondaryLabel="Accept connection request in the wallet",this.isLoading=!1,this.isMobile=!1,this.onRetry=void 0,this.unsubscribe.push(J.subscribeKey("wcUri",t=>{this.uri=t,this.isRetrying&&this.onRetry&&(this.isRetrying=!1,this.onConnect?.())}),J.subscribeKey("wcError",t=>
2597this.error=t)),(ee.isTelegram()||ee.isSafari())&&ee.isIos()&&J.state.wcUri&&this.onConnect?.()}firstUpdated(){this.onAutoConnect?.(),this.showRetry=!this.onAutoConnect}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),J.setWcError(!1),clearTimeout(this.timeout)}render(){this.onRender?.(),this.onShowRetry();let t=this.error?"Connection can be declined if a previous request is still active":this.secondaryLabel,r="";return this.label?r=this.label:(r=`Continue in ${this.name}`,this.error&&(r="Connection declined")),$`
2598      <wui-flex
2599        data-error=${ve(this.error)}
2600        data-retry=${this.showRetry}
2601        flexDirection="column"
2602        alignItems="center"
2603        .padding=${["10","5","5","5"]}
2604        gap="6"
2605      >
2606        <wui-flex gap="2" justifyContent="center" alignItems="center">
2607          <wui-wallet-image size="lg" imageSrc=${ve(this.imageSrc)}></wui-wallet-image>
2608
2609          ${this.error?null:this.loaderTemplate()}
2610
2611          <wui-icon-box
2612            color="error"
2613            icon="close"
2614            size="sm"
2615            border
2616            borderColor="wui-color-bg-125"
2617          ></wui-icon-box>
2618        </wui-flex>
2619
2620        <wui-flex flexDirection="column" alignItems="center" gap="6"> <wui-flex
2621          flexDirection="column"
2622          alignItems="center"
2623          gap="2"
2624          .padding=${["2","0","0","0"]}
2625        >
2626          <wui-text align="center" variant="lg-medium" color=${this.error?"error":"primary"}>
2627            ${r}
2628          </wui-text>
2629          <wui-text align="center" variant="lg-regular" color="secondary">${t}</wui-text>
2630        </wui-flex>
2631
2632        ${this.secondaryBtnLabel?$`
2633                <wui-button
2634                  variant="neutral-secondary"
2635                  size="md"
2636                  ?disabled=${this.isRetrying||this.isLoading}
2637                  @click=${this.onTryAgain.bind(this)}
2638                  data-testid="w3m-connecting-widget-secondary-button"
2639                >
2640                  <wui-icon
2641                    color="inherit"
2642                    slot="iconLeft"
2643                    name=${this.secondaryBtnIcon}
2644                  ></wui-icon>
2645                  ${this.secondaryBtnLabel}
2646                </wui-button>
2647              `:null}
2648      </wui-flex>
2649
2650      ${this.isWalletConnect?$`
2651              <wui-flex .padding=${["0","5","5","5"]} justifyContent="center">
2652                <wui-link
2653                  @click=${this.onCopyUri}
2654                  variant="secondary"
2655                  icon="copy"
2656                  data-testid="wui-link-copy"
2657                >
2658                  Copy link
2659                </wui-link>
2660              </wui-flex>
2661            `:null}
2662
2663      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links></wui-flex>
2664      </wui-flex>
2665    `}onShowRetry(){this.error&&!this.showRetry&&(this.showRetry=!0,this.shadowRoot?.querySelector("wui-button")?.animate([{opacity:0},{opacity:1}],{fill:"forwards",easing:"ease"}))}onTryAgain(){J.setWcError(!1),this.onRetry?(this.isRetrying=!0,this.onRetry?.()):this.onConnect?.()}loaderTemplate(){let t=Gr.state.themeVariables["--w3m-border-radius-master"],r=t?parseInt(t.replace("px",""),10):4;return $`<wui-loading-thumbnail radius=${r*9}></wui-loading-thumbnail>`}onCopyUri(){try{this.uri&&(ee.copyToClopboard(this.uri),Ze.showSuccess("Link copied"))}catch{Ze.showError("Failed to copy")}}};Xr.styles=i6e;dl([ie()],Xr.prototype,"isRetrying",void 0);dl([ie()],Xr.prototype,"uri",void 0);dl([ie()],Xr.prototype,"error",void 0);dl([ie()],Xr.prototype,"ready",void 0);dl([ie()],Xr.prototype,"showRetry",void 0);dl([ie()],Xr.prototype,"label",void 0);dl([ie()],Xr.prototype,"secondaryBtnLabel",void 0);dl([ie()],Xr.prototype,"secondaryLabel",void 0);dl([ie()],Xr.prototype,"isLoading",void 0);dl([V({type:Boolean})],Xr.prototype,"isMobile",void 0);dl([V()],Xr.prototype,"onRetry",void 0)});var yGe,c6e,l6e=h(()=>{it();st();He();L6();yGe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},c6e=class extends Xr{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-browser: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onAutoConnect=this.onConnectProxy.bind(this),xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",dis
2665playIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:Z.state.view}})}async onConnectProxy(){try{this.error=!1;let{connectors:t}=X.state,r=t.find(n=>n.type==="ANNOUNCED"&&n.info?.rdns===this.wallet?.rdns||n.type==="INJECTED"||n.name===this.wallet?.name);if(r)await J.connectExternal(r,r.chain);else throw new Error("w3m-connecting-wc-browser: No connector found");Oe.close()}catch(t){t instanceof ec&&t.originalName===Ds.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?xe.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:t.message}}):xe.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:t?.message??"Unknown"}}),this.error=!0}}};c6e=yGe([te("w3m-connecting-wc-browser")],c6e)});var wGe,u6e,d6e=h(()=>{st();He();L6();wGe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},u6e=class extends Xr{constructor(){if(super(),!this.wallet)throw new Error("w3m-connecting-wc-desktop: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.onRender=this.onRenderProxy.bind(this),xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"desktop",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:Z.state.view}})}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onConnectProxy(){if(this.wallet?.desktop_link&&this.uri)try{this.error=!1;let{desktop_link:t,name:r}=this.wallet,{redirect:n,href:o}=ee.formatNativeUrl(t,this.uri);J.setWcLinking({name:r,href:o}),J.setRecentWallet(this.wallet),ee.openHref(n,"_blank")}catch{this.error=!0}}};u6e=wGe([te("w3m-connecting-wc-desktop")],u6e)});var M6,c2,p6e=h(()=>{Ue();st();He();L6();M6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},c2=class extends Xr{constructor(){if(super(),this.btnLabelTimeout=void 0,this.redirectDeeplink=void 0,this.redirectUniversalLink=void 0,this.target=void 0,this.preferUniversalLinks=W.state.experimental_preferUniversalLinks,this.isLoading=!0,this.onConnect=()=>{$p.onConnectMobile(this.wallet)},!this.wallet)throw new Error("w3m-connecting-wc-mobile: No wallet provided");this.secondaryBtnLabel="Open",this.secondaryLabel=We.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.onHandleURI(),this.unsubscribe.push(J.subscribeKey("wcUri",()=>{this.onHandleURI()})),xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"mobile",displayIndex:this.wallet?.display_index,walletRank:this.wallet.order,view:Z.state.view}})}disconnectedCallback(){super.disconnectedCallback(),clearTimeout(this.btnLabelTimeout)}onHandleURI(){this.isLoading=!this.uri,!this.ready&&this.uri&&(this.ready=!0,this.onConnect?.())}onTryAgain(){J.setWcError(!1),this.onConnect?.()}};M6([ie()],c2.prototype,"redirectDeeplink",void 0);M6([ie()],c2.prototype,"redirectUniversalLink",void 0);M6([ie()],c2.prototype,"target",void 0);M6([ie()],c2.prototype,"preferUniversalLinks",void 0);M6([ie()],c2.prototype,"isLoading",void 0);c2=M6([te("w3m-connecting-wc-mobile")],c2)});var h6e=ot((eir,f6e)=>{f6e.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var fm=ot(l2=>{var OV,bGe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];l2.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};l2.getSymbolTotalCodewords=function(t){return bGe[t]};l2.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};l2.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');OV=t};l2.isKanjiModeEnabled=function(){return typeof OV<"u"};l2.toSJIS=function(t){return OV(t)}});var _7=ot(dc=>{dc.L={bit:1};dc.M={bit:0};dc.Q={bit:3};dc.H={bit:2};function xGe(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return dc.L;case"m":case"medium":return dc.M;case"q":case"quartile":return dc.Q;case"h":case"high":return dc.H;default:throw new Error("Unknown EC Level: "+e)}}dc.isValid=function(t){return t&&typeof t.bit<"u"&&t.bit>=0&&t.bit<4};dc.from=function(t,r){if(dc.isValid(t))return t;try{return xGe(t)}
2665catch{return r}}});var y6e=ot((nir,g6e)=>{function m6e(){this.buffer=[],this.length=0}m6e.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};g6e.exports=m6e});var b6e=ot((oir,w6e)=>{function b5(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}b5.prototype.set=function(e,t,r,n){let o=e*this.size+t;this.data[o]=r,n&&(this.reservedBit[o]=!0)};b5.prototype.get=function(e,t){return this.data[e*this.size+t]};b5.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r};b5.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};w6e.exports=b5});var x6e=ot(P7=>{var vGe=fm().getSymbolSize;P7.getRowColCoords=function(t){if(t===1)return[];let r=Math.floor(t/7)+2,n=vGe(t),o=n===145?26:Math.ceil((n-13)/(2*r-2))*2,s=[n-7];for(let i=1;i<r-1;i++)s[i]=s[i-1]-o;return s.push(6),s.reverse()};P7.getPositions=function(t){let r=[],n=P7.getRowColCoords(t),o=n.length;for(let s=0;s<o;s++)for(let i=0;i<o;i++)s===0&&i===0||s===0&&i===o-1||s===o-1&&i===0||r.push([n[s],n[i]]);return r}});var A6e=ot(E6e=>{var EGe=fm().getSymbolSize,v6e=7;E6e.getPositions=function(t){let r=EGe(t);return[[0,0],[r-v6e,0],[0,r-v6e]]}});var C6e=ot(Hr=>{Hr.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var u2={N1:3,N2:3,N3:40,N4:10};Hr.isValid=function(t){return t!=null&&t!==""&&!isNaN(t)&&t>=0&&t<=7};Hr.from=function(t){return Hr.isValid(t)?parseInt(t,10):void 0};Hr.getPenaltyN1=function(t){let r=t.size,n=0,o=0,s=0,i=null,a=null;for(let c=0;c<r;c++){o=s=0,i=a=null;for(let l=0;l<r;l++){let u=t.get(c,l);u===i?o++:(o>=5&&(n+=u2.N1+(o-5)),i=u,o=1),u=t.get(l,c),u===a?s++:(s>=5&&(n+=u2.N1+(s-5)),a=u,s=1)}o>=5&&(n+=u2.N1+(o-5)),s>=5&&(n+=u2.N1+(s-5))}return n};Hr.getPenaltyN2=function(t){let r=t.size,n=0;for(let o=0;o<r-1;o++)for(let s=0;s<r-1;s++){let i=t.get(o,s)+t.get(o,s+1)+t.get(o+1,s)+t.get(o+1,s+1);(i===4||i===0)&&n++}return n*u2.N2};Hr.getPenaltyN3=function(t){let r=t.size,n=0,o=0,s=0;for(let i=0;i<r;i++){o=s=0;for(let a=0;a<r;a++)o=o<<1&2047|t.get(i,a),a>=10&&(o===1488||o===93)&&n++,s=s<<1&2047|t.get(a,i),a>=10&&(s===1488||s===93)&&n++}return n*u2.N3};Hr.getPenaltyN4=function(t){let r=0,n=t.data.length;for(let s=0;s<n;s++)r+=t.data[s];return Math.abs(Math.ceil(r*100/n/5)-10)*u2.N4};function AGe(e,t,r){switch(e){case Hr.Patterns.PATTERN000:return(t+r)%2===0;case Hr.Patterns.PATTERN001:return t%2===0;case Hr.Patterns.PATTERN010:return r%3===0;case Hr.Patterns.PATTERN011:return(t+r)%3===0;case Hr.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2===0;case Hr.Patterns.PATTERN101:return t*r%2+t*r%3===0;case Hr.Patterns.PATTERN110:return(t*r%2+t*r%3)%2===0;case Hr.Patterns.PATTERN111:return(t*r%3+(t+r)%2)%2===0;default:throw new Error("bad maskPattern:"+e)}}Hr.applyMask=function(t,r){let n=r.size;for(let o=0;o<n;o++)for(let s=0;s<n;s++)r.isReserved(s,o)||r.xor(s,o,AGe(t,s,o))};Hr.getBestMask=function(t,r){let n=Object.keys(Hr.Patterns).length,o=0,s=1/0;for(let i=0;i<n;i++){r(i),Hr.applyMask(i,t);let a=Hr.getPenaltyN1(t)+Hr.getPenaltyN2(t)+Hr.getPenaltyN3(t)+Hr.getPenaltyN4(t);Hr.applyMask(i,t),a<s&&(s=a,o=i)}return o}});var kV=ot(BV=>{var hm=_7(),N7=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],R7=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
2665192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];BV.getBlocksCount=function(t,r){switch(r){case hm.L:return N7[(t-1)*4+0];case hm.M:return N7[(t-1)*4+1];case hm.Q:return N7[(t-1)*4+2];case hm.H:return N7[(t-1)*4+3];default:return}};BV.getTotalCodewordsCount=function(t,r){switch(r){case hm.L:return R7[(t-1)*4+0];case hm.M:return R7[(t-1)*4+1];case hm.Q:return R7[(t-1)*4+2];case hm.H:return R7[(t-1)*4+3];default:return}}});var S6e=ot(B7=>{var x5=new Uint8Array(512),O7=new Uint8Array(256);(function(){let t=1;for(let r=0;r<255;r++)x5[r]=t,O7[t]=r,t<<=1,t&256&&(t^=285);for(let r=255;r<512;r++)x5[r]=x5[r-255]})();B7.log=function(t){if(t<1)throw new Error("log("+t+")");return O7[t]};B7.exp=function(t){return x5[t]};B7.mul=function(t,r){return t===0||r===0?0:x5[O7[t]+O7[r]]}});var I6e=ot(v5=>{var DV=S6e();v5.mul=function(t,r){let n=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let s=0;s<r.length;s++)n[o+s]^=DV.mul(t[o],r[s]);return n};v5.mod=function(t,r){let n=new Uint8Array(t);for(;n.length-r.length>=0;){let o=n[0];for(let i=0;i<r.length;i++)n[i]^=DV.mul(r[i],o);let s=0;for(;s<n.length&&n[s]===0;)s++;n=n.slice(s)}return n};v5.generateECPolynomial=function(t){let r=new Uint8Array([1]);for(let n=0;n<t;n++)r=v5.mul(r,new Uint8Array([1,DV.exp(n)]));return r}});var P6e=ot((dir,_6e)=>{var T6e=I6e();function UV(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}UV.prototype.initialize=function(t){this.degree=t,this.genPoly=T6e.generateECPolynomial(this.degree)};UV.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");let r=new Uint8Array(t.length+this.degree);r.set(t);let n=T6e.mod(r,this.genPoly),o=this.degree-n.length;if(o>0){let s=new Uint8Array(this.degree);return s.set(n,o),s}return n};_6e.exports=UV});var LV=ot(N6e=>{N6e.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}});var MV=ot(gf=>{var R6e="[0-9]+",CGe="[A-Z $%*+\\-./:]+",E5="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";E5=E5.replace(/u/g,"\\u");var SGe="(?:(?![A-Z0-9 $%*+\\-./:]|"+E5+`)(?:.|[\r
2666]))+`;gf.KANJI=new RegExp(E5,"g");gf.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");gf.BYTE=new RegExp(SGe,"g");gf.NUMERIC=new RegExp(R6e,"g");gf.ALPHANUMERIC=new RegExp(CGe,"g");var IGe=new RegExp("^"+E5+"$"),TGe=new RegExp("^"+R6e+"$"),_Ge=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");gf.testKanji=function(t){return IGe.test(t)};gf.testNumeric=function(t){return TGe.test(t)};gf.testAlphanumeric=function(t){return _Ge.test(t)}});var mm=ot(Hn=>{var PGe=LV(),HV=MV();Hn.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Hn.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Hn.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Hn.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Hn.MIXED={bit:-1};Hn.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!PGe.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]};Hn.getBestModeForData=function(t){return HV.testNumeric(t)?Hn.NUMERIC:HV.testAlphanumeric(t)?Hn.ALPHANUMERIC:HV.testKanji(t)?Hn.KANJI:Hn.BYTE};Hn.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")};Hn.isValid=function(t){return t&&t.bit&&t.ccBits};function NGe(e){if(typeof e!="string")throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return Hn.NUMERIC;case"alphanumeric":return Hn.ALPHANUMERIC;case"kanji":return Hn.KANJI;case"byte":return Hn.BYTE;default:throw new Error("Unknown mode: "+e)}}Hn.from=function(t,r){if(Hn.isValid(t))return t;try{return NGe(t)}catch{return r}}});
2666var U6e=ot(d2=>{var k7=fm(),RGe=kV(),O6e=_7(),gm=mm(),$V=LV(),k6e=7973,B6e=k7.getBCHDigit(k6e);function OGe(e,t,r){for(let n=1;n<=40;n++)if(t<=d2.getCapacity(n,r,e))return n}function D6e(e,t){return gm.getCharCountIndicator(e,t)+4}function BGe(e,t){let r=0;return e.forEach(function(n){let o=D6e(n.mode,t);r+=o+n.getBitsLength()}),r}function kGe(e,t){for(let r=1;r<=40;r++)if(BGe(e,r)<=d2.getCapacity(r,t,gm.MIXED))return r}d2.from=function(t,r){return $V.isValid(t)?parseInt(t,10):r};d2.getCapacity=function(t,r,n){if(!$V.isValid(t))throw new Error("Invalid QR Code version");typeof n>"u"&&(n=gm.BYTE);let o=k7.getSymbolTotalCodewords(t),s=RGe.getTotalCodewordsCount(t,r),i=(o-s)*8;if(n===gm.MIXED)return i;let a=i-D6e(n,t);switch(n){case gm.NUMERIC:return Math.floor(a/10*3);case gm.ALPHANUMERIC:return Math.floor(a/11*2);case gm.KANJI:return Math.floor(a/13);case gm.BYTE:default:return Math.floor(a/8)}};d2.getBestVersionForData=function(t,r){let n,o=O6e.from(r,O6e.M);if(Array.isArray(t)){if(t.length>1)return kGe(t,o);if(t.length===0)return 1;n=t[0]}else n=t;return OGe(n.mode,n.getLength(),o)};d2.getEncodedBits=function(t){if(!$V.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;k7.getBCHDigit(r)-B6e>=0;)r^=k6e<<k7.getBCHDigit(r)-B6e;return t<<12|r}});var $6e=ot(H6e=>{var FV=fm(),M6e=1335,DGe=21522,L6e=FV.getBCHDigit(M6e);H6e.getEncodedBits=function(t,r){let n=t.bit<<3|r,o=n<<10;for(;FV.getBCHDigit(o)-L6e>=0;)o^=M6e<<FV.getBCHDigit(o)-L6e;return(n<<10|o)^DGe}});var V6e=ot((yir,F6e)=>{var UGe=mm();function H6(e){this.mode=UGe.NUMERIC,this.data=e.toString()}H6.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};H6.prototype.getLength=function(){return this.data.length};H6.prototype.getBitsLength=function(){return H6.getBitsLength(this.data.length)};H6.prototype.write=function(t){let r,n,o;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),o=parseInt(n,10),t.put(o,10);let s=this.data.length-r;s>0&&(n=this.data.substr(r),o=parseInt(n,10),t.put(o,s*3+1))};F6e.exports=H6});var j6e=ot((wir,z6e)=>{var LGe=mm(),VV=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function $6(e){this.mode=LGe.ALPHANUMERIC,this.data=e}$6.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};$6.prototype.getLength=function(){return this.data.length};$6.prototype.getBitsLength=function(){return $6.getBitsLength(this.data.length)};$6.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let n=VV.indexOf(this.data[r])*45;n+=VV.indexOf(this.data[r+1]),t.put(n,11)}this.data.length%2&&t.put(VV.indexOf(this.data[r]),6)};z6e.exports=$6});var W6e=ot((bir,q6e)=>{"use strict";q6e.exports=function(t){for(var r=[],n=t.length,o=0;o<n;o++){var s=t.charCodeAt(o);if(s>=55296&&s<=56319&&n>o+1){var i=t.charCodeAt(o+1);i>=56320&&i<=57343&&(s=(s-55296)*1024+i-56320+65536,o+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer}});var Z6e=ot((xir,K6e)=>{var MGe=W6e(),HGe=mm();function F6(e){this.mode=HGe.BYTE,typeof e=="string"&&(e=MGe(e)),this.data=new Uint8Array(e)}F6.getBitsLength=function(t){return t*8};F6.prototype.getLength=function(){return this.data.length};F6.prototype.getBitsLength=function(){return F6.getBitsLength(this.data.length)};F6.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)};K6e.exports=F6});var Y6e=ot((vir,G6e)=>{var $Ge=mm(),FGe=fm();function V6(e){this.mode=$Ge.KANJI,this.data=e}V6.getBitsLength=function(t){return t*13};V6.prototype.getLength=function(){return this.data.length};V6.prototype.getBitsLength=function(){return V6.getBitsLength(this.data.length)};V6.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=FGe.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
2667Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};
vendor: 9,976 bytes, lines 2667-2671
2667G6e.exports=V6});var J6e=ot((Eir,zV)=>{"use strict";var A5={single_source_shortest_paths:function(e,t,r){var n={},o={};o[t]=0;var s=A5.PriorityQueue.make();s.push(t,0);for(var i,a,c,l,u,d,p,f,m;!s.empty();){i=s.pop(),a=i.value,l=i.cost,u=e[a]||{};for(c in u)u.hasOwnProperty(c)&&(d=u[c],p=l+d,f=o[c],m=typeof o[c]>"u",(m||f>p)&&(o[c]=p,s.push(c,p),n[c]=a))}if(typeof r<"u"&&typeof o[r]>"u"){var g=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(g)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t,o;n;)r.push(n),o=e[n],n=e[n];return r.reverse(),r},find_path:function(e,t,r){var n=A5.single_source_shortest_paths(e,t,r);return A5.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t=A5.PriorityQueue,r={},n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(r[n]=t[n]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof zV<"u"&&(zV.exports=A5)});var sxe=ot(z6=>{var fr=mm(),exe=V6e(),txe=j6e(),rxe=Z6e(),nxe=Y6e(),C5=MV(),D7=fm(),VGe=J6e();function Q6e(e){return unescape(encodeURIComponent(e)).length}function S5(e,t,r){let n=[],o;for(;(o=e.exec(r))!==null;)n.push({data:o[0],index:o.index,mode:t,length:o[0].length});return n}function oxe(e){let t=S5(C5.NUMERIC,fr.NUMERIC,e),r=S5(C5.ALPHANUMERIC,fr.ALPHANUMERIC,e),n,o;return D7.isKanjiModeEnabled()?(n=S5(C5.BYTE,fr.BYTE,e),o=S5(C5.KANJI,fr.KANJI,e)):(n=S5(C5.BYTE_KANJI,fr.BYTE,e),o=[]),t.concat(r,n,o).sort(function(i,a){return i.index-a.index}).map(function(i){return{data:i.data,mode:i.mode,length:i.length}})}function jV(e,t){switch(t){case fr.NUMERIC:return exe.getBitsLength(e);case fr.ALPHANUMERIC:return txe.getBitsLength(e);case fr.KANJI:return nxe.getBitsLength(e);case fr.BYTE:return rxe.getBitsLength(e)}}function zGe(e){return e.reduce(function(t,r){let n=t.length-1>=0?t[t.length-1]:null;return n&&n.mode===r.mode?(t[t.length-1].data+=r.data,t):(t.push(r),t)},[])}function jGe(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];switch(n.mode){case fr.NUMERIC:t.push([n,{data:n.data,mode:fr.ALPHANUMERIC,length:n.length},{data:n.data,mode:fr.BYTE,length:n.length}]);break;case fr.ALPHANUMERIC:t.push([n,{data:n.data,mode:fr.BYTE,length:n.length}]);break;case fr.KANJI:t.push([n,{data:n.data,mode:fr.BYTE,length:Q6e(n.data)}]);break;case fr.BYTE:t.push([{data:n.data,mode:fr.BYTE,length:Q6e(n.data)}])}}return t}function qGe(e,t){let r={},n={start:{}},o=["start"];for(let s=0;s<e.length;s++){let i=e[s],a=[];for(let c=0;c<i.length;c++){let l=i[c],u=""+s+c;a.push(u),r[u]={node:l,lastCount:0},n[u]={};for(let d=0;d<o.length;d++){let p=o[d];r[p]&&r[p].node.mode===l.mode?(n[p][u]=jV(r[p].lastCount+l.length,l.mode)-jV(r[p].lastCount,l.mode),r[p].lastCount+=l.length):(r[p]&&(r[p].lastCount=l.length),n[p][u]=jV(l.length,l.mode)+4+fr.getCharCountIndicator(l.mode,t))}}o=a}for(let s=0;s<o.length;s++)n[o[s]].end=0;return{map:n,table:r}}function X6e(e,t){let r,n=fr.getBestModeForData(e);if(r=fr.from(t,n),r!==fr.BYTE&&r.bit<n.bit)throw new Error('"'+e+'" cannot be encoded with mode '+fr.toString(r)+`.
2668 Suggested mode is: `+fr.toString(n));switch(r===fr.KANJI&&!D7.isKanjiModeEnabled()&&(r=fr.BYTE),r){case fr.NUMERIC:return new exe(e);case fr.ALPHANUMERIC:return new txe(e);case fr.KANJI:return new nxe(e);case fr.BYTE:return new rxe(e)}}z6.fromArray=function(t){return t.reduce(function(r,n){return typeof n=="string"?r.push(X6e(n,null)):n.data&&r.push(X6e(n.data,n.mode)),r},[])};z6.fromString=function(t,r){let n=oxe(t,D7.isKanjiModeEnabled()),o=jGe(n),s=qGe(o,r),i=VGe.find_path(s.map,"start","end"),a=[];for(let c=1;c<i.length-1;c++)a.push(s.table[i[c]].node);return z6.fromArray(zGe(a))};z6.rawSplit=function(t){return z6.fromArray(oxe(t,D7.isKanjiModeEnabled()))}});var axe=ot(ixe=>{var L7=fm(),qV=_7(),WGe=y6e(),KGe=b6e(),ZGe=x6e(),GGe=A6e(),ZV=C6e(),GV=kV(),YGe=P6e(),U7=U6e(),JGe=$6e(),QGe=mm(),WV=sxe();function XGe(e,t){let r=e.size,n=GGe.getPositions(t);for(let o=0;o<n.length;o++){let s=n[o][0],i=n[o][1];for(let a=-1;a<=7;a++)if(!(s+a<=-1||r<=s+a))for(let c=-1;c<=7;c++)i+c<=-1||r<=i+c||(a>=0&&a<=6&&(c===0||c===6)||c>=0&&c<=6&&(a===0||a===6)||a>=2&&a<=4&&c>=2&&c<=4?e.set(s+a,i+c,!0,!0):e.set(s+a,i+c,!1,!0))}}function eYe(e){let t=e.size;for(let r=8;r<t-8;r++){let n=r%2===0;e.set(r,6,n,!0),e.set(6,r,n,!0)}}function tYe(e,t){let r=ZGe.getPositions(t);for(let n=0;n<r.length;n++){let o=r[n][0],s=r[n][1];for(let i=-2;i<=2;i++)for(let a=-2;a<=2;a++)i===-2||i===2||a===-2||a===2||i===0&&a===0?e.set(o+i,s+a,!0,!0):e.set(o+i,s+a,!1,!0)}}function rYe(e,t){let r=e.size,n=U7.getEncodedBits(t),o,s,i;for(let a=0;a<18;a++)o=Math.floor(a/3),s=a%3+r-8-3,i=(n>>a&1)===1,e.set(o,s,i,!0),e.set(s,o,i,!0)}function KV(e,t,r){let n=e.size,o=JGe.getEncodedBits(t,r),s,i;for(s=0;s<15;s++)i=(o>>s&1)===1,s<6?e.set(s,8,i,!0):s<8?e.set(s+1,8,i,!0):e.set(n-15+s,8,i,!0),s<8?e.set(8,n-s-1,i,!0):s<9?e.set(8,15-s-1+1,i,!0):e.set(8,15-s-1,i,!0);e.set(n-8,8,1,!0)}function nYe(e,t){let r=e.size,n=-1,o=r-1,s=7,i=0;for(let a=r-1;a>0;a-=2)for(a===6&&a--;;){for(let c=0;c<2;c++)if(!e.isReserved(o,a-c)){let l=!1;i<t.length&&(l=(t[i]>>>s&1)===1),e.set(o,a-c,l),s--,s===-1&&(i++,s=7)}if(o+=n,o<0||r<=o){o-=n,n=-n;break}}}function oYe(e,t,r){let n=new WGe;r.forEach(function(c){n.put(c.mode.bit,4),n.put(c.getLength(),QGe.getCharCountIndicator(c.mode,e)),c.write(n)});let o=L7.getSymbolTotalCodewords(e),s=GV.getTotalCodewordsCount(e,t),i=(o-s)*8;for(n.getLengthInBits()+4<=i&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);let a=(i-n.getLengthInBits())/8;for(let c=0;c<a;c++)n.put(c%2?17:236,8);return sYe(n,e,t)}function sYe(e,t,r){let n=L7.getSymbolTotalCodewords(t),o=GV.getTotalCodewordsCount(t,r),s=n-o,i=GV.getBlocksCount(t,r),a=n%i,c=i-a,l=Math.floor(n/i),u=Math.floor(s/i),d=u+1,p=l-u,f=new YGe(p),m=0,g=new Array(i),y=new Array(i),b=0,C=new Uint8Array(e.buffer);for(let D=0;D<i;D++){let U=D<c?u:d;g[D]=C.slice(m,m+U),y[D]=f.encode(g[D]),m+=U,b=Math.max(b,U)}let w=new Uint8Array(n),x=0,S,P;for(S=0;S<b;S++)for(P=0;P<i;P++)S<g[P].length&&(w[x++]=g[P][S]);for(S=0;S<p;S++)for(P=0;P<i;P++)w[x++]=y[P][S];return w}function iYe(e,t,r,n){let o;if(Array.isArray(e))o=WV.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){let u=WV.rawSplit(e);l=U7.getBestVersionForData(u,r)}o=WV.fromString(e,l||40)}else throw new Error("Invalid data");let s=U7.getBestVersionForData(o,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=s;else if(t<s)throw new Error(`
2669The chosen QR Code version cannot contain this amount of data.
2670Minimum version required to store current data is: `+s+`.
2671`);let i=oYe(t,r,o),a=L7.getSymbolSize(t),c=new KGe(a);return XGe(c,t),eYe(c),tYe(c,t),KV(c,r,0),t>=7&&rYe(c,t),nYe(c,i),isNaN(n)&&(n=ZV.getBestMask(c,KV.bind(null,c,r))),ZV.applyMask(n,c),KV(c,r,n),{modules:c,version:t,errorCorrectionLevel:r,maskPattern:n,segments:o}}ixe.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");let n=qV.M,o,s;return typeof r<"u"&&(n=qV.from(r.errorCorrectionLevel,qV.M),o=U7.from(r.version),s=ZV.from(r.maskPattern),r.toSJISFunc&&L7.setToSJISFunction(r.toSJISFunc)),iYe(t,o,n,s)}});var YV=ot(p2=>{function cxe(e){if(typeof e=="number"&&(e=e.toString()),typeof e!="string")throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||t.length===5||t.length>8)throw new Error("Invalid hex color: "+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(n){return[n,n]}))),t.length===6&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:r&255,hex:"#"+t.slice(0,6).join("")}}p2.getOptions=function(t){t||(t={}),t.color||(t.color={});let r=typeof t.margin>"u"||t.margin===null||t.margin<0?4:t.margin,n=t.width&&t.width>=21?t.width:void 0,o=t.scale||4;return{width:n,scale:n?4:o,margin:r,color:{dark:cxe(t.color.dark||"#000000ff"),light:cxe(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}};p2.getScale=function(t,r){return r.width&&r.width>=t+r.margin*2?r.width/(t+r.margin*2):r.scale};p2.getImageWidth=function(t,r){let n=p2.getScale(t,r);return Math.floor((t+r.margin*2)*n)};p2.qrToImageData=function(t,r,n){let o=r.modules.size,s=r.modules.data,i=p2.getScale(o,n),a=Math.floor((o+n.margin*2)*i),c=n.margin*i,l=[n.color.light,n.color.dark];for(let u=0;u<a;u++)for(let d=0;d<a;d++){let p=(u*a+d)*4,f=n.color.light;if(u>=c&&d>=c&&u<a-c&&d<a-c){let m=Math.floor((u-c)/i),g=Math.floor((d-c)/i);f=l[s[m*o+g]?1:0]}t[p++]=f.r,t[p++]=f.g,t[p++]=f.b,t[p]=f.a}}});var lxe=ot(M7=>{var JV=YV();function aYe(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}function cYe(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}M7.render=function(t,r,n){let o=n,s=r;typeof o>"u"&&(!r||!r.getContext)&&(o=r,r=void 0),r||(s=cYe()),o=JV.getOptions(o);let i=JV.getImageWidth(t.modules.size,o),a=s.getContext("2d"),c=a.createImageData(i,i);return JV.qrToImageData(c.data,t,o),aYe(a,s,i),a.putImageData(c,0,0),s};M7.renderToDataURL=function(t,r,n){let o=n;typeof o>"u"&&(!r||!r.getContext)&&(o=r,r=void 0),o||(o={});let s=M7.render(t,r,o),i=o.type||"image/png",a=o.rendererOpts||{};return s.toDataURL(i,a.quality)}});var pxe=ot(dxe=>{var lYe=YV();function uxe(e,t){let r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function QV(e,t,r){let n=e+t;return typeof r<"u"&&(n+=" "+r),n}function uYe(e,t,r){let n="",o=0,s=!1,i=0;for(let a=0;a<e.length;a++){let c=Math.floor(a%t),l=Math.floor(a/t);!c&&!s&&(s=!0),e[a]?(i++,a>0&&c>0&&e[a-1]||(n+=s?QV("M",c+r,.5+l+r):QV("m",o,0),o=0,s=!1),c+1<t&&e[a+1]||(n+=QV("h",i),i=0)):o++}
2671return n}dxe.render=function(t,r,n){let o=lYe.getOptions(r),s=t.modules.size,i=t.modules.data,a=s+o.margin*2,c=o.color.light.a?"<path "+uxe(o.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+uxe(o.color.dark,"stroke")+' d="'+uYe(i,s,o.margin)+'"/>',u='viewBox="0 0 '+a+" "+a+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+u+' shape-rendering="crispEdges">'+c+l+`</svg>
2672`;return typeof n=="function"&&n(null,p),p}});var hxe=ot(I5=>{var dYe=h6e(),XV=axe(),fxe=lxe(),pYe=pxe();function ez(e,t,r,n,o){let s=[].slice.call(arguments,1),i=s.length,a=typeof s[i-1]=="function";if(!a&&!dYe())throw new Error("Callback required as last argument");if(a){if(i<2)throw new Error("Too few arguments provided");i===2?(o=r,r=t,t=n=void 0):i===3&&(t.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=r,r=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(r=t,t=n=void 0):i===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(c,l){try{let u=XV.create(r,n);c(e(u,t,n))}catch(u){l(u)}})}try{let c=XV.create(r,n);o(null,e(c,t,n))}catch(c){o(c)}}I5.create=XV.create;I5.toCanvas=ez.bind(null,fxe.render);I5.toDataURL=ez.bind(null,fxe.renderToDataURL);I5.toString=ez.bind(null,function(e,t,r){return pYe.render(e,r)})});function tz(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+fYe}function hYe(e,t){let r=Array.prototype.slice.call(gxe.default.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((o,s,i)=>(i%n===0?o.push([s]):o[o.length-1].push(s))&&o,[])}var gxe,fYe,mxe,yf,yxe,wxe=h(()=>{gxe=Lt(hxe(),1);le();fYe=.1,mxe=2.5,yf=7;yxe={generate({uri:e,size:t,logoSize:r,padding:n=8,dotColor:o="var(--apkt-colors-black)"}){let i=[],a=hYe(e,"Q"),c=(t-2*n)/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:g,y})=>{let b=(a.length-yf)*c*g+n,C=(a.length-yf)*c*y+n,w=.45;for(let x=0;x<l.length;x+=1){let S=c*(yf-x*2);i.push(De`
2673            <rect
2674              fill=${x===2?"var(--apkt-colors-black)":"var(--apkt-colors-white)"}
2675              width=${x===0?S-10:S}
2676              rx= ${x===0?(S-10)*w:S*w}
2677              ry= ${x===0?(S-10)*w:S*w}
2678              stroke=${o}
2679              stroke-width=${x===0?10:0}
2680              height=${x===0?S-10:S}
2681              x= ${x===0?C+c*x+10/2:C+c*x}
2682              y= ${x===0?b+c*x+10/2:b+c*x}
2683            />
2684          `)}});let u=Math.floor((r+25)/c),d=a.length/2-u/2,p=a.length/2+u/2-1,f=[];a.forEach((g,y)=>{g.forEach((b,C)=>{if(a[y][C]&&!(y<yf&&C<yf||y>a.length-(yf+1)&&C<yf||y<yf&&C>a.length-(yf+1))&&!(y>d&&y<p&&C>d&&C<p)){let w=y*c+c/2+n,x=C*c+c/2+n;f.push([w,x])}})});let m={};return f.forEach(([g,y])=>{m[g]?m[g]?.push(y):m[g]=[y]}),Object.entries(m).map(([g,y])=>{let b=y.filter(C=>y.every(w=>!tz(C,w,c)));return[Number(g),b]}).forEach(([g,y])=>{y.forEach(b=>{i.push(De`<circle cx=${g} cy=${b} fill=${o} r=${c/mxe} />`)})}),Object.entries(m).filter(([g,y])=>y.length>1).map(([g,y])=>{let b=y.filter(C=>y.some(w=>tz(C,w,c)));return[Number(g),b]}).map(([g,y])=>{y.sort((C,w)=>C<w?-1:1);let b=[];for(let C of y){let w=b.find(x=>x.some(S=>tz(C,S,c)));w?w.push(C):b.push([C])}return[g,b.map(C=>[C[0],C[C.length-1]])]}).forEach(([g,y])=>{y.forEach(([b,C])=>{i.push(De`
2685              <line
2686                x1=${g}
2687                x2=${g}
2688                y1=${b}
2689                y2=${C}
2690                stroke=${o}
2691                stroke-width=${c/(mxe/2)}
2692                stroke-linecap="round"
2693              />
2694            `)})}),i}}});var bxe,xxe=h(()=>{Tt();bxe=ce`
2695  :host {
2696    position: relative;
2697    user-select: none;
2698    display: block;
2699    overflow: hidden;
2700    aspect-ratio: 1 / 1;
2701    width: 100%;
2702    height: 100%;
2703    background-color: ${({colors:e})=>e.white};
2704    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
2705  }
2706
2707  :host {
2708    border-radius: ${({borderRadius:e})=>e[4]};
2709    display: flex;
2710    align-items: center;
2711    justify-content: center;
2712  }
2713
2714  :host([data-clear='true']) > wui-icon {
2715    display: none;
2716  }
2717
2718  svg:first-child,
2719  wui-image,
2720  wui-icon {
2721    position: absolute;
2722    top: 50%;
2723    left: 50%;
2724    transform: translateY(-50%) translateX(-50%);
2725    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
2726    box-shadow: inset 0 0 0 4px ${({tokens:e})=>e.theme.backgroundPrimary};
2727    border-radius: ${({borderRadius:e})=>e[6]};
2728  }
2729
2730  wui-image {
2731    width: 25%;
2732    height: 25%;
2733    border-radius: ${({borderRadius:e})=>e[2]};
2734  }
2735
2736  wui-icon {
2737    width: 100%;
2738    height: 100%;
2739    color: #3396ff !important;
2740    transform: translateY(-50%) translateX(-50%) scale(0.25);
2741  }
2742
2743  wui-icon > svg {
2744    width: inherit;
2745    height: inherit;
2746  }
2747`});var ym,yd,vxe=h(()=>{le();Ue();Jn();t2();Zg();wxe();kt();Pt();xxe();ym=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},yd=class extends ne{constructor(){super(...arguments),this.uri="",this.size=500,this.theme="dark",this.imageSrc=void 0,this.alt=void 0,this.arenaClear=void 0,this.farcaster=void 0}render(){return this.dataset.theme=this.theme,this.dataset.clear=String(this.arenaClear),$`<wui-flex
2748      alignItems="center"
2749      justifyContent="center"
2750      class="wui-qr-code"
2751      direction="column"
2752      gap="4"
2753      width="100%"
2754      style="height: 100%"
2755    >
2756      ${this.templateVisual()} ${this.templateSvg()}
2757    </wui-flex>`}templateSvg(){return De`
2758      <svg viewBox="0 0 ${this.size} ${this.size}" width="100%" height="100%">
2759        ${yxe.generate({uri:this.uri,size:this.size,logoSize:this.arenaClear?0:this.size/4})}
2760      </svg>
2761    `}templateVisual(){return this.imageSrc?$`<wui-image src=${this.imageSrc} alt=${this.alt??"logo"}></wui-image>`:this.farcaster?$`<wui-icon
2762        class="farcaster"
2763        size="inherit"
2764        color="inherit"
2765        name="farcaster"
2766      ></wui-icon>`:$`<wui-icon size="inherit" color="inherit" name="walletConnect"></wui-icon>`}};
2766yd.styles=[ke,bxe];ym([V()],yd.prototype,"uri",void 0);ym([V({type:Number})],yd.prototype,"size",void 0);ym([V()],yd.prototype,"theme",void 0);ym([V()],yd.prototype,"imageSrc",void 0);ym([V()],yd.prototype,"alt",void 0);ym([V({type:Boolean})],yd.prototype,"arenaClear",void 0);ym([V({type:Boolean})],yd.prototype,"farcaster",void 0);yd=ym([te("wui-qr-code")],yd)});var Exe=h(()=>{vxe()});var Axe,Cxe=h(()=>{Tt();Axe=ce`
2767  :host {
2768    display: block;
2769    background: linear-gradient(
2770      90deg,
2771      ${({tokens:e})=>e.theme.foregroundPrimary} 0%,
2772      ${({tokens:e})=>e.theme.foregroundSecondary} 50%,
2773      ${({tokens:e})=>e.theme.foregroundPrimary} 100%
2774    );
2775    background-size: 200% 100%;
2776    animation: shimmer 2s linear infinite;
2777    border-radius: ${({borderRadius:e})=>e[1]};
2778  }
2779
2780  :host([data-rounded='true']) {
2781    border-radius: ${({borderRadius:e})=>e[16]};
2782  }
2783
2784  @keyframes shimmer {
2785    0% {
2786      background-position: 100% 0;
2787    }
2788    100% {
2789      background-position: -100% 0;
2790    }
2791  }
2792`});var T5,f2,rz=h(()=>{le();Ue();Pt();Cxe();T5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},f2=class extends ne{constructor(){super(...arguments),this.width="",this.height="",this.variant="default",this.rounded=!1}render(){return this.style.cssText=`
2793      width: ${this.width};
2794      height: ${this.height};
2795    `,this.dataset.rounded=this.rounded?"true":"false",$`<slot></slot>`}};f2.styles=[Axe];T5([V()],f2.prototype,"width",void 0);T5([V()],f2.prototype,"height",void 0);T5([V()],f2.prototype,"variant",void 0);T5([V({type:Boolean})],f2.prototype,"rounded",void 0);f2=T5([te("wui-shimmer")],f2)});var _5=h(()=>{rz()});var Sxe,Ixe=h(()=>{Sxe="https://reown.com"});var Txe,_xe=h(()=>{Tt();Txe=ce`
2796  .reown-logo {
2797    height: 24px;
2798  }
2799
2800  a {
2801    text-decoration: none;
2802    cursor: pointer;
2803    color: ${({tokens:e})=>e.theme.textSecondary};
2804  }
2805
2806  a:hover {
2807    opacity: 0.9;
2808  }
2809`});var mYe,nz,Pxe=h(()=>{le();Jn();xs();Zg();Ixe();kt();Pt();_xe();mYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},nz=class extends ne{render(){return $`
2810      <a
2811        data-testid="ux-branding-reown"
2812        href=${Sxe}
2813        rel="noreferrer"
2814        target="_blank"
2815        style="text-decoration: none;"
2816      >
2817        <wui-flex
2818          justifyContent="center"
2819          alignItems="center"
2820          gap="1"
2821          .padding=${["01","0","3","0"]}
2822        >
2823          <wui-text variant="sm-regular" color="inherit"> UX by </wui-text>
2824          <wui-icon name="reown" size="inherit" class="reown-logo"></wui-icon>
2825        </wui-flex>
2826      </a>
2827    `}};nz.styles=[ke,Zt,Txe];nz=mYe([te("wui-ux-by-reown")],nz)});var oz=h(()=>{Pxe()});var Nxe,Rxe=h(()=>{He();Nxe=ce`
2828  wui-shimmer {
2829    width: 100%;
2830    aspect-ratio: 1 / 1;
2831    border-radius: ${({borderRadius:e})=>e[4]};
2832  }
2833
2834  wui-qr-code {
2835    opacity: 0;
2836    animation-duration: ${({durations:e})=>e.xl};
2837    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
2838    animation-name: fade-in;
2839    animation-fill-mode: forwards;
2840  }
2841
2842  @keyframes fade-in {
2843    from {
2844      opacity: 0;
2845    }
2846    to {
2847      opacity: 1;
2848    }
2849  }
2850`});var Oxe,H7,Bxe=h(()=>{le();Ue();Pr();st();He();Mr();mf();A7();Exe();_5();Mn();oz();L6();T7();Rxe();Oxe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},H7=class extends Xr{constructor(){super(),this.basic=!1}firstUpdated(){this.basic||xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet?.name??"WalletConnect",platform:"qrcode",dis
2850playIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:Z.state.view}})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribe?.forEach(t=>t())}render(){return this.onRenderProxy(),$`
2851      <wui-flex
2852        flexDirection="column"
2853        alignItems="center"
2854        .padding=${["0","5","5","5"]}
2855        gap="5"
2856      >
2857        <wui-shimmer width="100%"> ${this.qrCodeTemplate()} </wui-shimmer>
2858        <wui-text variant="lg-medium" color="primary"> Scan this QR Code with your phone </wui-text>
2859        ${this.copyTemplate()}
2860      </wui-flex>
2861      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2862    `}onRenderProxy(){!this.ready&&this.uri&&(this.ready=!0)}qrCodeTemplate(){if(!this.uri||!this.ready)return null;let t=this.wallet?this.wallet.name:void 0;J.setWcLinking(void 0),J.setRecentWallet(this.wallet);let r=Gr.state.themeVariables["--apkt-qr-color"]??Gr.state.themeVariables["--w3m-qr-color"];return $` <wui-qr-code
2863      theme=${Gr.state.themeMode}
2864      uri=${this.uri}
2865      imageSrc=${ve(vt.getWalletImage(this.wallet))}
2866      color=${ve(r)}
2867      alt=${ve(t)}
2868      data-testid="wui-qr-code"
2869    ></wui-qr-code>`}copyTemplate(){let t=!this.uri||!this.ready;return $`<wui-button
2870      .disabled=${t}
2871      @click=${this.onCopyUri}
2872      variant="neutral-secondary"
2873      size="sm"
2874      data-testid="copy-wc2-uri"
2875    >
2876      Copy link
2877      <wui-icon size="sm" color="inherit" name="copy" slot="iconRight"></wui-icon>
2878    </wui-button>`}};H7.styles=Nxe;Oxe([V({type:Boolean})],H7.prototype,"basic",void 0);H7=Oxe([te("w3m-connecting-wc-qrcode")],H7)});var gYe,kxe,Dxe=h(()=>{le();Pr();st();He();Mr();Mn();w5();T7();gYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},kxe=class extends ne{constructor(){if(super(),this.wallet=Z.state.data?.wallet,!this.wallet)throw new Error("w3m-connecting-wc-unsupported: No wallet provided");xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"browser",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:Z.state.view}})}render(){return $`
2879      <wui-flex
2880        flexDirection="column"
2881        alignItems="center"
2882        .padding=${["10","5","5","5"]}
2883        gap="5"
2884      >
2885        <wui-wallet-image
2886          size="lg"
2887          imageSrc=${ve(vt.getWalletImage(this.wallet))}
2888        ></wui-wallet-image>
2889
2890        <wui-text variant="md-regular" color="primary">Not Detected</wui-text>
2891      </wui-flex>
2892
2893      <w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
2894    `}};kxe=gYe([te("w3m-connecting-wc-unsupported")],kxe)});var Uxe,sz,Lxe=h(()=>{Ue();st();He();L6();Uxe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},sz=class extends Xr{constructor(){if(super(),this.isLoading=!0,!this.wallet)throw new Error("w3m-connecting-wc-web: No wallet provided");this.onConnect=this.onConnectProxy.bind(this),this.secondaryBtnLabel="Open",this.secondaryLabel=We.CONNECT_LABELS.MOBILE,this.secondaryBtnIcon="externalLink",this.updateLoadingState(),this.unsubscribe.push(J.subscribeKey("wcUri",()=>{this.updateLoadingState()})),xe.sendEvent({type:"track",event:"SELECT_WALLET",properties:{name:this.wallet.name,platform:"web",displayIndex:this.wallet?.display_index,walletRank:this.wallet?.order,view:Z.state.view}})}updateLoadingState(){this.isLoading=!this.uri}onConnectProxy(){if(this.wallet?.webapp_link&&this.uri)try{this.error=!1;let{webapp_link:t,name:r}=this.wallet,{redirect:n,href:o}=ee.formatUniversalUrl(t,this.uri);J.setWcLinking({name:r,href:o}),J.setRecentWallet(this.wallet),ee.openHref(n,"_blank")}catch{this.error=!0}}};Uxe([ie()],sz.prototype,"isLoading",void 0);sz=Uxe([te("w3m-connecting-wc-web")],sz)}
2894);var Mxe,Hxe=h(()=>{He();Mxe=ce`
2895  :host([data-mobile-fullscreen='true']) {
2896    height: 100%;
2897    display: flex;
2898    flex-direction: column;
2899  }
2900
2901  :host([data-mobile-fullscreen='true']) wui-ux-by-reown {
2902    margin-top: auto;
2903  }
2904`});var h2,wf,$xe=h(()=>{le();Ue();it();st();He();ul();$be();l6e();d6e();p6e();Bxe();Dxe();Lxe();Hxe();h2=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},wf=class extends ne{constructor(){super(),this.wallet=Z.state.data?.wallet,this.unsubscribe=[],this.platform=void 0,this.platforms=[],this.isSiwxEnabled=!!W.state.siwx,this.remoteFeatures=W.state.remoteFeatures,this.displayBranding=!0,this.basic=!1,this.determinePlatforms(),this.initializeConnection(),this.unsubscribe.push(W.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return W.state.enableMobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),$`
2905      ${this.headerTemplate()}
2906      <div class="platform-container">${this.platformTemplate()}</div>
2907      ${this.reownBrandingTemplate()}
2908    `}reownBrandingTemplate(){return!this.remoteFeatures?.reownBranding||!this.displayBranding?null:$`<wui-ux-by-reown></wui-ux-by-reown>`}async initializeConnection(t=!1){if(!(this.platform==="browser"||W.state.manualWCControl&&!t))try{let{wcPairingExpiry:r,status:n}=J.state,{redirectView:o}=Z.state.data??{};if(t||W.state.enableEmbedded||ee.isPairingExpired(r)||n==="connecting"){let s=J.getConnections(k.state.activeChain),i=this.remoteFeatures?.multiWallet,a=s.length>0;await J.connectWalletConnect({cache:"never"}),this.isSiwxEnabled||(a&&i?(Z.replace("ProfileWallets"),Ze.showSuccess("New Wallet Added")):o?Z.replace(o):Oe.close())}}catch(r){if(r instanceof Error&&r.message.includes("An error occurred when attempting to switch chain")&&!W.state.enableNetworkSwitch&&k.state.activeChain){k.setActiveCaipNetwork(yu.getUnsupportedNetwork(`${k.state.activeChain}:${k.state.activeCaipNetwork?.id}`)),k.showUnsupportedChainUI();return}r instanceof ec&&r.originalName===Ds.PROVIDER_RPC_ERROR_NAME.USER_REJECTED_REQUEST?xe.sendEvent({type:"track",event:"USER_REJECTED",properties:{message:r.message}}):xe.sendEvent({type:"track",event:"CONNECT_ERROR",properties:{message:r?.message??"Unknown"}}),J.setWcError(!0),Ze.showError(r.message??"Connection error"),J.resetWcConnection(),Z.goBack()}}determinePlatforms(){if(!this.wallet){this.platforms.push("qrcode"),this.platform="qrcode";return}if(this.platform)return;let{mobile_link:t,desktop_link:r,webapp_link:n,injected:o,rdns:s}=this.wallet,i=o?.map(({injected_id:g})=>g).filter(Boolean),a=[...s?[s]:i??[]],c=W.state.isUniversalProvider?!1:a.length,l=t,u=n,d=J.checkInstalled(a),p=c&&d,f=r&&!ee.isMobile();p&&!k.state.noAdapters&&this.platforms.push("browser"),l&&this.platforms.push(ee.isMobile()?"mobile":"qrcode"),u&&this.platforms.push("web"),f&&this.platforms.push("desktop");let m=Q4.isCustomDeeplinkWallet(this.wallet.id,k.state.activeChain);!p&&c&&!k.state.noAdapters&&!m&&this.platforms.push("unsupported"),this.platform=this.platforms[0]}platformTemplate(){switch(this.platform){case"browser":return $`<w3m-connecting-wc-browser></w3m-connecting-wc-browser>`;case"web":return $`<w3m-connecting-wc-web></w3m-connecting-wc-web>`;case"desktop":return $`
2909          <w3m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
2910          </w3m-connecting-wc-desktop>
2911        `;case"mobile":return $`
2912          <w3m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
2913          </w3m-connecting-wc-mobile>
2914        `;case"qrcode":return $`<w3m-connecting-wc-qrcode ?basic=${this.basic}></w3m-connecting-wc-qrcode>`;default:return $`<w3m-connecting-wc-unsupported></w3m-connecting-wc-unsupported>`}}headerTemplate(){return this.platforms.length>1?$`
2915      <w3m-connecting-header
2916        .platforms=${this.platforms}
2917        .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
2918      >
2919      </w3m-connecting-header>
2920    `:null}async onSelectPlatform(t){let r=this.shadowRoot?.querySelector("div");r&&(await r.animate([{opacity:1},{opacity:0}
2920],{duration:200,fill:"forwards",easing:"ease"}).finished,this.platform=t,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}};wf.styles=Mxe;h2([ie()],wf.prototype,"platform",void 0);h2([ie()],wf.prototype,"platforms",void 0);h2([ie()],wf.prototype,"isSiwxEnabled",void 0);h2([ie()],wf.prototype,"remoteFeatures",void 0);h2([V({type:Boolean})],wf.prototype,"displayBranding",void 0);h2([V({type:Boolean})],wf.prototype,"basic",void 0);wf=h2([te("w3m-connecting-wc-view")],wf)});var iz,P5,Fxe=h(()=>{le();Ue();st();He();Mr();Pbe();Obe();$xe();iz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},P5=class extends ne{constructor(){super(),this.unsubscribe=[],this.isMobile=ee.isMobile(),this.remoteFeatures=W.state.remoteFeatures,this.unsubscribe.push(W.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){if(this.isMobile){let{featured:t,recommended:r}=de.state,{customWallets:n}=W.state,o=ae.getRecentWallets(),s=t.length||r.length||n?.length||o.length;return $`<wui-flex flexDirection="column" gap="2" .margin=${["1","3","3","3"]}>
2921        ${s?$`<w3m-connector-list></w3m-connector-list>`:null}
2922        <w3m-all-wallets-widget></w3m-all-wallets-widget>
2923      </wui-flex>`}return $`<wui-flex flexDirection="column" .padding=${["0","0","4","0"]}>
2924        <w3m-connecting-wc-view ?basic=${!0} .displayBranding=${!1}></w3m-connecting-wc-view>
2925        <wui-flex flexDirection="column" .padding=${["0","3","0","3"]}>
2926          <w3m-all-wallets-widget></w3m-all-wallets-widget>
2927        </wui-flex>
2928      </wui-flex>
2929      ${this.reownBrandingTemplate()} `}reownBrandingTemplate(){return this.remoteFeatures?.reownBranding?$` <wui-flex flexDirection="column" .padding=${["1","0","1","0"]}>
2930      <wui-ux-by-reown></wui-ux-by-reown>
2931    </wui-flex>`:null}};iz([ie()],P5.prototype,"isMobile",void 0);iz([ie()],P5.prototype,"remoteFeatures",void 0);P5=iz([te("w3m-connecting-wc-basic-view")],P5)});var _cr,Vxe,zxe=h(()=>{uf();({I:_cr}=G1e),Vxe=e=>e.strings===void 0});function yYe(e){this._$AN!==void 0?($7(this),this._$AM=e,jxe(this)):this._$AM=e}function wYe(e,t=!1,r=0){let n=this._$AH,o=this._$AN;if(o!==void 0&&o.size!==0)if(t)if(Array.isArray(n))for(let s=r;s<n.length;s++)N5(n[s],!1),$7(n[s]);else n!=null&&(N5(n,!1),$7(n));else N5(this,e)}var N5,$7,jxe,bYe,F7,qxe=h(()=>{zxe();u5();u5();N5=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let n of r)n._$AO?.(t,!1),N5(n,t);return!0},$7=e=>{let t,r;do{if((t=e._$AM)===void 0)break;r=t._$AN,r.delete(e),e=t}while(r?.size===0)},jxe=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(r===void 0)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),bYe(t)}};bYe=e=>{e.type==g7.CHILD&&(e._$AP??=wYe,e._$AQ??=yYe)},F7=class extends P6{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,r,n){super._$AT(t,r,n),jxe(this),this.isConnected=t._$AU}_$AO(t,r=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),r&&(N5(this,t),$7(this))}setValue(t){if(Vxe(this._$Ct))this._$Ct._$AI(t,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=t,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}}});var j6,cz,az,q6,Wxe=h(()=>{uf();qxe();u5();j6=()=>new cz,cz=class{},az=new WeakMap,q6=l5(class extends F7{render(e){return an}update(e,[t]){let r=t!==this.G;return r&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),an}rt(e){if(this.G!==void 0)if(this.isConnected||(e=void 0),typeof this.G=="function"){let t=this.ht??globalThis,r=az.get(t);r===void 0&&(r=new WeakMap,az.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,e),e!==void 0&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return typeof this.G=="function"?az.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})});var V7=h(()=>{Wxe()});var Kxe,Zxe=h(()=>{Tt();Kxe=ce`
2932  :host {
2933    display: flex;
2934    align-items: center;
2935    justify-content: center;
2936  }
2937
2938  label {
2939    position: relative;
2940    display: inline-block;
2941    user-select: none;
2942    transition:
2943      background-color ${({durations:e})=>e.lg}
2944        ${({easings:e})=>e["ease-out-power-2"]},
2945      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2946      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2947      box-shadow ${({durations:e})=>e.lg}
2948        ${({easings:e})=>e["ease-out-power-2"]},
2949      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2950      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2951      transform ${({durations:e})=>e.lg}
2952        ${({easings:e})=>e["ease-out-power-2"]},
2953      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
2954    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
2955  }
2956
2957  input {
2958    width: 0;
2959    height: 0;
2960    opacity: 0;
2961  }
2962
2963  span {
2964    position: absolute;
2965    cursor: pointer;
2966    top: 0;
2967    left: 0;
2968    right: 0;
2969    bottom: 0;
2970    background-color: ${({colors:e})=>e.neutrals300};
2971    border-radius: ${({borderRadius:e})=>e.round};
2972    border: 1px solid transparent;
2973    will-change: border;
2974    transition:
2975      background-color ${({durations:e})=>e.lg}
2976        ${({easings:e})=>e["ease-out-power-2"]},
2977      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2978      border ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2979      box-shadow ${({durations:e})=>e.lg}
2980        ${({easings:e})=>e["ease-out-power-2"]},
2981      width ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2982      height ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
2983      transform ${({durations:e})=>e.lg}
2984        ${({easings:e})=>e["ease-out-power-2"]},
2985      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
2986    will-change: background-color, color, border, box-shadow, width, height, transform, opacity;
2987  }
2988
2989  span:before {
2990    content: '';
2991    position: absolute;
2992    background-color: ${({colors:e})=>e.white};
2993    border-radius: 50%;
2994  }
2995
2996  /* -- Sizes --------------------------------------------------------- */
2997  label[data-size='lg'] {
2998    width: 48px;
2999    height: 32px;
3000  }
3001
3002  label[data-size='md'] {
3003    width: 40px;
3004    height: 28px;
3005  }
3006
3007  label[data-size='sm'] {
3008    width: 32px;
3009    height: 22px;
3010  }
3011
3012  label[data-size='lg'] > span:before {
3013    height: 24px;
3014    width: 24px;
3015    left: 4px;
3016    top: 3px;
3017  }
3018
3019  label[data-size='md'] > span:before {
3020    height: 20px;
3021    width: 20px;
3022    left: 4px;
3023    top: 3px;
3024  }
3025
3026  label[data-size='sm'] > span:before {
3027    height: 16px;
3028    width: 16px;
3029    left: 3px;
3030    top: 2px;
3031  }
3032
3033  /* -- Focus states --------------------------------------------------- */
3034  input:focus-visible:not(:checked) + span,
3035  input:focus:not(:checked) + span {
3036    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
3037    background-color: ${({tokens:e})=>e.theme.textTertiary};
3038    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
3039  }
3040
3041  input:focus-visible:checked + span,
3042  input:focus:checked + span {
3043    border: 1px solid ${({tokens:e})=>e.core.iconAccentPrimary};
3044    box-shadow: 0px 0px 0px 4px rgba(9, 136, 240, 0.2);
3045  }
3046
3047  /* -- Checked states --------------------------------------------------- */
3048  input:checked + span {
3049    background-color: ${({tokens:e})=>e.core.iconAccentPrimary};
3050  }
3051
3052  label[data-size='lg'] > input:checked + span:before {
3053    transform: translateX(calc(100% - 9px));
3054  }
3055
3056  label[data-size='md'] > input:checked + span:before {
3057    transform: translateX(calc(100% - 9px));
3058  }
3059
3060  label[data-size='sm'] > input:checked + span:before {
3061    transform: translateX(calc(100% - 7px));
3062  }
3063
3064  /* -- Hover states ------------------------------------------------------- */
3065  label:hover > input:not(:checked):not(:disabled) + span {
3066    background-color: ${({colors:e})=>e.neutrals400};
3067  }
3068
3069  label:hover > input:checked:not(:disabled) + span {
3070    background-color: ${({colors:e})=>e.accent080};
3071  }
3072
3073  /* -- Disabled state --------------------------------------------------- */
3074  label:has(input:disabled) {
3075    pointer-events: none;
3076    user-select: none;
3077  }
3078
3079  input:not(:checked):disabled + span {
3080    background-color: ${({colors:e})=>e.neutrals700};
3081  }
3082
3083  input:checked:disabled + span {
3084    background-color: ${({colors:e})=>e.neutrals700};
3085  }
3086
3087  input:not(:checked):disabled + span::before {
3088    background-color: ${({colors:e})=>e.neutrals400};
3089  }
3090
3091  input:checked:disabled + span::before {
3092    background-color: ${({tokens:e})=>e.theme.textTertiary};
3093  }
3094`});var z7,W6,Gxe=h(()=>{le();Ue();V7();kt();Pt();Zxe();z7=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},W6=class extends ne{constructor(){super(...arguments),this.inputElementRef=j6(),this.checked=!1,this.disabled=!1,this.size="md"}render(){return $`
3095      <label data-size=${this.size}>
3096        <input
3097          ${q6(this.inputElementRef)}
3098          type="checkbox"
3099          ?checked=${this.checked}
3100          ?disabled=${this.disabled}
3101          @change=${this.dispatchChangeEvent.bind(this)}
3102        />
3103        <span></span>
3104      </label>
3105    `}dispatchChangeEvent(){this.dispatchEvent(new CustomEvent("switchChange",{detail:this.inputElementRef.value?.checked,bubbles:!0,composed:!0}))}};W6.styles=[ke,Zt,Kxe];z7([V({type:Boolean})],W6.prototype,"checked",void 0);z7([V({type:Boolean})],W6.prototype,"disabled",void 0);z7([V()],W6.prototype,"size",void 0);W6=z7([te("wui-toggle")],W6)});var Yxe,Jxe=h(()=>{Tt();Yxe=ce`
3106  :host {
3107    height: auto;
3108  }
3109
3110  :host > wui-flex {
3111    height: 100%;
3112    display: flex;
3113    align-items: center;
3114    justify-content: center;
3115    column-gap: ${({spacing:e})=>e[2]};
3116    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]};
3117    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3118    border-radius: ${({borderRadius:e})=>e[4]};
3119    box-shadow: inset 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
3120    transition: background-color ${({durations:e})=>e.lg}
3121      ${({easings:e})=>e["ease-out-power-2"]};
3122    will-change: background-color;
3123    cursor: pointer;
3124  }
3125
3126  wui-switch {
3127    pointer-events: none;
3128  }
3129`});var Qxe,j7,Xxe=h(()=>{le();Ue();kt();Pt();Gxe();Jxe();Qxe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},j7=class extends ne{constructor(){super(...arguments),this.checked=!1}
3129render(){return $`
3130      <wui-flex>
3131        <wui-icon size="xl" name="walletConnectBrown"></wui-icon>
3132        <wui-toggle
3133          ?checked=${this.checked}
3134          size="sm"
3135          @switchChange=${this.handleToggleChange.bind(this)}
3136        ></wui-toggle>
3137      </wui-flex>
3138    `}handleToggleChange(t){t.stopPropagation(),this.checked=t.detail,this.dispatchSwitchEvent()}dispatchSwitchEvent(){this.dispatchEvent(new CustomEvent("certifiedSwitchChange",{detail:this.checked,bubbles:!0,composed:!0}))}};j7.styles=[ke,Zt,Yxe];Qxe([V({type:Boolean})],j7.prototype,"checked",void 0);j7=Qxe([te("wui-certified-switch")],j7)});var e8e=h(()=>{Xxe()});var t8e,r8e=h(()=>{Tt();t8e=ce`
3139  :host {
3140    position: relative;
3141    width: 100%;
3142    display: inline-flex;
3143    flex-direction: column;
3144    gap: ${({spacing:e})=>e[3]};
3145    color: ${({tokens:e})=>e.theme.textPrimary};
3146    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
3147  }
3148
3149  .wui-input-text-container {
3150    position: relative;
3151    display: flex;
3152  }
3153
3154  input {
3155    width: 100%;
3156    border-radius: ${({borderRadius:e})=>e[4]};
3157    color: inherit;
3158    background: transparent;
3159    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
3160    caret-color: ${({tokens:e})=>e.core.textAccentPrimary};
3161    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[3]}
3162      ${({spacing:e})=>e[3]} ${({spacing:e})=>e[10]};
3163    font-size: ${({textSize:e})=>e.large};
3164    line-height: ${({typography:e})=>e["lg-regular"].lineHeight};
3165    letter-spacing: ${({typography:e})=>e["lg-regular"].letterSpacing};
3166    font-weight: ${({fontWeight:e})=>e.regular};
3167    font-family: ${({fontFamily:e})=>e.regular};
3168  }
3169
3170  input[data-size='lg'] {
3171    padding: ${({spacing:e})=>e[4]} ${({spacing:e})=>e[3]}
3172      ${({spacing:e})=>e[4]} ${({spacing:e})=>e[10]};
3173  }
3174
3175  @media (hover: hover) and (pointer: fine) {
3176    input:hover:enabled {
3177      border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
3178    }
3179  }
3180
3181  input:disabled {
3182    cursor: unset;
3183    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
3184  }
3185
3186  input::placeholder {
3187    color: ${({tokens:e})=>e.theme.textSecondary};
3188  }
3189
3190  input:focus:enabled {
3191    border: 1px solid ${({tokens:e})=>e.theme.borderSecondary};
3192    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3193    -webkit-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
3194    -moz-box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
3195    box-shadow: 0px 0px 0px 4px ${({tokens:e})=>e.core.foregroundAccent040};
3196  }
3197
3198  div.wui-input-text-container:has(input:disabled) {
3199    opacity: 0.5;
3200  }
3201
3202  wui-icon.wui-input-text-left-icon {
3203    position: absolute;
3204    top: 50%;
3205    transform: translateY(-50%);
3206    pointer-events: none;
3207    left: ${({spacing:e})=>e[4]};
3208    color: ${({tokens:e})=>e.theme.iconDefault};
3209  }
3210
3211  button.wui-input-text-submit-button {
3212    position: absolute;
3213    top: 50%;
3214    transform: translateY(-50%);
3215    right: ${({spacing:e})=>e[3]};
3216    width: 24px;
3217    height: 24px;
3218    border: none;
3219    background: transparent;
3220    border-radius: ${({borderRadius:e})=>e[2]};
3221    color: ${({tokens:e})=>e.core.textAccentPrimary};
3222  }
3223
3224  button.wui-input-text-submit-button:disabled {
3225    opacity: 1;
3226  }
3227
3228  button.wui-input-text-submit-button.loading wui-icon {
3229    animation: spin 1s linear infinite;
3230  }
3231
3232  button.wui-input-text-submit-button:hover {
3233    background: ${({tokens:e})=>e.core.foregroundAccent010};
3234  }
3235
3236  input:has(+ .wui-input-text-submit-button) {
3237    padding-right: ${({spacing:e})=>e[12]};
3238  }
3239
3240  input[type='number'] {
3241    -moz-appearance: textfield;
3242  }
3243
3244  input[type='search']::-webkit-search-decoration,
3245  input[type='search']::-webkit-search-cancel-button,
3246  input[type='search']::-webkit-search-results-button,
3247  input[type='search']::-webkit-search-results-decoration {
3248    -webkit-appearance: none;
3249  }
3250
3251  /* -- Keyframes --------------------------------------------------- */
3252  @keyframes spin {
3253    from {
3254      transform: rotate(0deg);
3255    }
3256    to {
3257      transform: rotate(360deg);
3258    }
3259  }
3260`});var pc,Li,n8e=h(()=>{le();Ue();Pr();V7();Jn();xs();kt();Pt();r8e();pc=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Li=class extends ne{constructor(){super(...arguments),this.inputElementRef=j6(),this.disabled=!1,this.loading=!1,this.placeholder="",this.type="text",this.value="",this.size="md"}render(){return $` <div class="wui-input-text-container">
3261        ${this.templateLeftIcon()}
3262        <input
3263          data-size=${this.size}
3264          ${q6(this.inputElementRef)}
3265          data-testid="wui-input-text"
3266          type=${this.type}
3267          enterkeyhint=${ve(this.enterKeyHint)}
3268          ?disabled=${this.disabled}
3269          placeholder=${this.placeholder}
3270          @input=${this.dispatchInputChangeEvent.bind(this)}
3271          @keydown=${this.onKeyDown}
3272          .value=${this.value||""}
3273        />
3274        ${this.templateSubmitButton()}
3275        <slot class="wui-input-text-slot"></slot>
3276      </div>
3277      ${this.templateError()} ${this.templateWarning()}`}templateLeftIcon(){return this.icon?$`<wui-icon
3278        class="wui-input-text-left-icon"
3279        size="md"
3280        data-size=${this.size}
3281        color="inherit"
3282        name=${this.icon}
3283      ></wui-icon>`:null}templateSubmitButton(){return this.onSubmit?$`<button
3284        class="wui-input-text-submit-button ${this.loading?"loading":""}"
3285        @click=${this.onSubmit?.bind(this)}
3286        ?disabled=${this.disabled||this.loading}
3287      >
3288        ${this.loading?$`<wui-icon name="spinner" size="md"></wui-icon>`:$`<wui-icon name="chevronRight" size="md"></wui-icon>`}
3289      </button>`:null}templateError(){return this.errorText?$`<wui-text variant="sm-regular" color="error">${this.errorText}</wui-text>`:null}templateWarning(){return this.warningText?$`<wui-text variant="sm-regular" color="warning">${this.warningText}</wui-text>`:null}dispatchInputChangeEvent(){this.dispatchEvent(new CustomEvent("inputChange",{detail:this.inputElementRef.value?.value,bubbles:!0,composed:!0}))}};Li.styles=[ke,Zt,t8e];pc([V()],Li.prototype,"icon",void 0);pc([V({type:Boolean})],Li.prototype,"disabled",void 0);pc([V({type:Boolean})],Li.prototype,"loading",void 0);pc([V()],Li.prototype,"placeholder",void 0);pc([V()],Li.prototype,"type",void 0);pc([V()],Li.prototype,"value",void 0);pc([V()],Li.prototype,"errorText",void 0);pc([V()],Li.prototype,"warningText",void 0);pc([V()],Li.prototype,"onSubmit",void 0);pc([V()],Li.prototype,"size",void 0);pc([V({attribute:!1})],Li.prototype,"onKeyDown",void 0);Li=pc([te("wui-input-text")],Li)});var o8e,s8e=h(()=>{Tt();o8e=ce`
3290  :host {
3291    position: relative;
3292    display: inline-block;
3293    width: 100%;
3294  }
3295
3296  wui-icon {
3297    position: absolute;
3298    top: 50%;
3299    transform: translateY(-50%);
3300    right: ${({spacing:e})=>e[3]};
3301    color: ${({tokens:e})=>e.theme.iconDefault};
3302    cursor: pointer;
3303    padding: ${({spacing:e})=>e[2]};
3304    background-color: transparent;
3305    border-radius: ${({borderRadius:e})=>e[4]};
3306    transition: background-color ${({durations:e})=>e.lg}
3307      ${({easings:e})=>e["ease-out-power-2"]};
3308  }
3309
3310  @media (hover: hover) {
3311    wui-icon:hover {
3312      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3313    }
3314  }
3315`});var i8e,q7,a8e=h(()=>{le();Ue();V7();kt();Pt();n8e();s8e();i8e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},q7=class extends ne{constructor(){super(...arguments),this.inputComponentRef=j6(),this.inputValue=""}render(){return $`
3316      <wui-input-text
3317        ${q6(this.inputComponentRef)}
3318        placeholder="Search wallet"
3319        icon="search"
3320        type="search"
3321        enterKeyHint="search"
3322        size="sm"
3323        @inputChange=${this.onInputChange}
3324      >
3325        ${this.inputValue?$`<wui-icon
3326              @click=${this.clearValue}
3327              color="inherit"
3328              size="sm"
3329              name="close"
3330            ></wui-icon>`:null}
3331      </wui-input-text>
3332    `}onInputChange(t){this.inputValue=t.detail||""}clearValue(){let r=this.inputComponentRef.value?.inputElementRef.value;r&&(r.value="",this.inputValue="",r.focus(),r.dispatchEvent(new Event("input")))}};q7.styles=[ke,o8e];i8e([V()],q7.prototype,"inputValue",void 0);q7=i8e([te("wui-search-bar")],q7)});var c8e=h(()=>{a8e()});var W7,lz=h(()=>{le();W7=De`<svg  viewBox="0 0 48 54" fill="none">
3333  <path
3334    d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
3335  />
3336</svg>`});var l8e,u8e=h(()=>{Tt();l8e=ce`
3337  :host {
3338    display: flex;
3339    flex-direction: column;
3340    justify-content: center;
3341    align-items: center;
3342    height: 104px;
3343    width: 104px;
3344    row-gap: ${({spacing:e})=>e[2]};
3345    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3346    border-radius: ${({borderRadius:e})=>e[5]};
3347    position: relative;
3348  }
3349
3350  wui-shimmer[data-type='network'] {
3351    border: none;
3352    -webkit-clip-path: var(--apkt-path-network);
3353    clip-path: var(--apkt-path-network);
3354  }
3355
3356  svg {
3357    position: absolute;
3358    width: 48px;
3359    height: 54px;
3360    z-index: 1;
3361  }
3362
3363  svg > path {
3364    stroke: ${({tokens:e})=>e.theme.foregroundSecondary};
3365    stroke-width: 1px;
3366  }
3367
3368  @media (max-width: 350px) {
3369    :host {
3370      width: 100%;
3371    }
3372  }
3373`});var d8e,K7,p8e=h(()=>{le();Ue();lz();rz();kt();Pt();u8e();d8e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},K7=class extends ne{constructor(){super(...arguments),this.type="wallet"}render(){return $`
3374      ${this.shimmerTemplate()}
3375      <wui-shimmer width="80px" height="20px"></wui-shimmer>
3376    `}shimmerTemplate(){return this.type==="network"?$` <wui-shimmer data-type=${this.type} width="48px" height="54px"></wui-shimmer>
3377        ${W7}`:$`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}};K7.styles=[ke,Zt,l8e];d8e([V()],K7.prototype,"type",void 0);K7=d8e([te("wui-card-select-loader")],K7)});var f8e=h(()=>{p8e()});var h8e,m8e=h(()=>{le();h8e=yr`
3378  :host {
3379    display: grid;
3380    width: inherit;
3381    height: inherit;
3382  }
3383`});var fc,Mi,g8e=h(()=>{le();Ue();kt();A6();Pt();m8e();fc=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Mi=class extends ne{render(){return this.style.cssText=`
3384      grid-template-rows: ${this.gridTemplateRows};
3385      grid-template-columns: ${this.gridTemplateColumns};
3386      justify-items: ${this.justifyItems};
3387      align-items: ${this.alignItems};
3388      justify-content: ${this.justifyContent};
3389      align-content: ${this.alignContent};
3390      column-gap: ${this.columnGap&&`var(--apkt-spacing-${this.columnGap})`};
3391      row-gap: ${this.rowGap&&`var(--apkt-spacing-${this.rowGap})`};
3392      gap: ${this.gap&&`var(--apkt-spacing-${this.gap})`};
3393      padding-top: ${this.padding&&pr.getSpacingStyles(this.padding,0)};
3394      padding-right: ${this.padding&&pr.getSpacingStyles(this.padding,1)};
3395      padding-bottom: ${this.padding&&pr.getSpacingStyles(this.padding,2)};
3396      padding-left: ${this.padding&&pr.getSpacingStyles(this.padding,3)};
3397      margin-top: ${this.margin&&pr.getSpacingStyles(this.margin,0)};
3398      margin-right: ${this.margin&&pr.getSpacingStyles(this.margin,1)};
3399      margin-bottom: ${this.margin&&pr.getSpacingStyles(this.margin,2)};
3400      margin-left: ${this.margin&&pr.getSpacingStyles(this.margin,3)};
3401    `,$`<slot></slot>`}};Mi.styles=[ke,h8e];fc([V()],Mi.prototype,"gridTemplateRows",void 0);fc([V()],Mi.prototype,"gridTemplateColumns",void 0);fc([V()],Mi.prototype,"justifyItems",void 0);fc([V()],Mi.prototype,"alignItems",void 0);fc([V()],Mi.prototype,"justifyContent",void 0);fc([V()],Mi.prototype,"alignContent",void 0);fc([V()],Mi.prototype,"columnGap",void 0);fc([V()],Mi.prototype,"rowGap",void 0);fc([V()],Mi.prototype,"gap",void 0);fc([V()],Mi.prototype,"padding",void 0);fc([V()],Mi.prototype,"margin",void 0);Mi=fc([te("wui-grid")],Mi)});var uz=h(()=>{g8e()});var y8e,w8e=h(()=>{He();y8e=ce`
3402  button {
3403    display: flex;
3404    flex-direction: column;
3405    justify-content: center;
3406    align-items: center;
3407    cursor: pointer;
3408    width: 104px;
3409    row-gap: ${({spacing:e})=>e[2]};
3410    padding: ${({spacing:e})=>e[3]} ${({spacing:e})=>e[0]};
3411    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3412    border-radius: clamp(0px, ${({borderRadius:e})=>e[4]}, 20px);
3413    transition:
3414      color ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-1"]},
3415      background-color ${({durations:e})=>e.lg}
3416        ${({easings:e})=>e["ease-out-power-1"]},
3417      border-radius ${({durations:e})=>e.lg}
3418        ${({easings:e})=>e["ease-out-power-1"]};
3419    will-change: background-color, color, border-radius;
3420    outline: none;
3421    border: none;
3422  }
3423
3424  button > wui-flex > wui-text {
3425    color: ${({tokens:e})=>e.theme.textPrimary};
3426    max-width: 86px;
3427    white-space: nowrap;
3428    overflow: hidden;
3429    text-overflow: ellipsis;
3430    justify-content: center;
3431  }
3432
3433  button > wui-flex > wui-text.certified {
3434    max-width: 66px;
3435  }
3436
3437  @media (hover: hover) and (pointer: fine) {
3438    button:hover:enabled {
3439      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3440    }
3441  }
3442
3443  button:disabled > wui-flex > wui-text {
3444    color: ${({tokens:e})=>e.core.glass010};
3445  }
3446
3447  [data-selected='true'] {
3448    background-color: ${({colors:e})=>e.accent020};
3449  }
3450
3451  @media (hover: hover) and (pointer: fine) {
3452    [data-selected='true']:hover:enabled {
3453      background-color: ${({colors:e})=>e.accent010};
3454    }
3455  }
3456
3457  [data-selected='true']:active:enabled {
3458    background-color: ${({colors:e})=>e.accent010};
3459  }
3460
3461  @media (max-width: 350px) {
3462    button {
3463      width: 100%;
3464    }
3465  }
3466`});var wd,hc,dz=h(()=>{le();Ue();Pr();st();He();Mr();mf();_5();Mn();w5();w8e();wd=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},hc=class extends ne{constructor(){super(),this.observer=new IntersectionObserver(()=>{}),this.visible=!1,this.imageSrc=void 0,this.imageLoading=!1,this.isImpressed=!1,this.explorerId="",this.walletQuery="",this.certified=!1,this.displayIndex=0,this.wallet=void 0,this.observer=new IntersectionObserver(t=>{t.forEach(r=>{r.isIntersecting?(this.visible=!0,this.fetchImageSrc(),this.sendImpressionEvent()):this.visible=!1})},{threshold:.01})}firstUpdated(){this.observer.observe(this)}disconnectedCallback(){this.observer.disconnect()}render(){let t=this.wallet?.badge_type==="certified";return $`
3467      <button>
3468        ${this.imageTemplate()}
3469        <wui-flex flexDirection="row" alignItems="center" justifyContent="center" gap="1">
3470          <wui-text
3471            variant="md-regular"
3472            color="inherit"
3473            class=${ve(t?"certified":void 0)}
3474            >${this.wallet?.name}</wui-text
3475          >
3476          ${t?$`<wui-icon size="sm" name="walletConnectBrown"></wui-icon>`:null}
3477        </wui-flex>
3478      </button>
3479    `}imageTemplate(){return!this.visible&&!this.imageSrc||this.imageLoading?this.shimmerTemplate():$`
3480      <wui-wallet-image
3481        size="lg"
3482        imageSrc=${ve(this.imageSrc)}
3483        name=${ve(this.wallet?.name)}
3484        .installed=${this.wallet?.installed??!1}
3485        badgeSize="sm"
3486      >
3487      </wui-wallet-image>
3488    `}shimmerTemplate(){return $`<wui-shimmer width="56px" height="56px"></wui-shimmer>`}async fetchImageSrc(){this.wallet&&(this.imageSrc=vt.getWalletImage(this.wallet),!this.imageSrc&&(this.imageLoading=!0,this.imageSrc=await vt.fetchWalletImage(this.wallet.image_id),this.imageLoading=!1))}sendImpressionEvent(){!this.wallet||this.isImpressed||(this.isImpressed=!0,xe.sendWalletImpressionEvent({name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.explorerId,view:Z.state.view,query:this.walletQuery,certified:this.certified,displayIndex:this.displayIndex}))}};hc.styles=y8e;wd([ie()],hc.prototype,"visible",void 0);wd([ie()],hc.prototype,"imageSrc",void 0);wd([ie()],hc.prototype,"imageLoading",void 0);wd([ie()],hc.prototype,"isImpressed",void 0);wd([V()],hc.prototype,"explorerId",void 0);wd([V()],hc.prototype,"walletQuery",void 0);wd([V()],hc.prototype,"certified",void 0);wd([V()],hc.prototype,"displayIndex",void 0);wd([V({type:Object})],hc.prototype,"wallet",void 0);hc=wd([te("w3m-all-wallets-list-item")],hc)});var b8e,x8e=h(()=>{He();b8e=ce`
3489  wui-grid {
3490    max-height: clamp(360px, 400px, 80vh);
3491    overflow: scroll;
3492    scrollbar-width: none;
3493    grid-auto-rows: min-content;
3494    grid-template-columns: repeat(auto-fill, 104px);
3495  }
3496
3497  :host([data-mobile-fullscreen='true']) wui-grid {
3498    max-height: none;
3499  }
3500
3501  @media (max-width: 350px) {
3502    wui-grid {
3503      grid-template-columns: repeat(2, 1fr);
3504    }
3505  }
3506
3507  wui-grid[data-scroll='false'] {
3508    overflow: hidden;
3509  }
3510
3511  wui-grid::-webkit-scrollbar {
3512    display: none;
3513  }
3514
3515  w3m-all-wallets-list-item {
3516    opacity: 0;
3517    animation-duration: ${({durations:e})=>e.xl};
3518    animation-timing-function: ${({easings:e})=>e["ease-inout-power-2"]};
3519    animation-name: fade-in;
3520    animation-fill-mode: forwards;
3521  }
3522
3523  @keyframes fade-in {
3524    from {
3525      opacity: 0;
3526    }
3527    to {
3528      opacity: 1;
3529    }
3530  }
3531
3532  wui-loading-spinner {
3533    padding-top: ${({spacing:e})=>e[4]};
3534    padding-bottom: ${({spacing:e})=>e[4]};
3535    justify-content: center;
3536    grid-column: 1 / span 4;
3537  }
3538`});var R5,v8e,m2,E8e=h(()=>{le();Ue();Pr();st();He();f8e();uz();dz();x8e();R5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},v8e="local-paginator",m2=class extends ne{constructor(){super(),this.unsubscribe=[],this.paginationObserver=void 0,this.loading=!de.state.wallets.length,this.wallets=de.state.wallets,this.mobileFullScreen=W.state.enableMobileFullScreen,this.unsubscribe.push(de.subscribeKey("wallets",t=>this.wallets=t))}firstUpdated(){this.initialFetch(),this.createPaginationObserver()}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),this.paginationObserver?.disconnect()}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),$`
3539      <wui-grid
3540        data-scroll=${!this.loading}
3541        .padding=${["0","3","3","3"]}
3542        gap="2"
3543        justifyContent="space-between"
3544      >
3545        ${this.loading?this.shimmerTemplate(16):this.walletsTemplate()}
3546        ${this.paginationLoaderTemplate()}
3547      </wui-grid>
3548    `}async initialFetch(){this.loading=!0;let t=this.shadowRoot?.querySelector("wui-grid");t&&(await de.fetchWalletsByPage({page:1}),await t.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.loading=!1,t.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}shimmerTemplate(t,r){return[...Array(t)].map(()=>$`
3549        <wui-card-select-loader type="wallet" id=${ve(r)}></wui-card-select-loader>
3550      `)}walletsTemplate(){return is.getWalletConnectWallets(this.wallets).map((t,r)=>$`
3551        <w3m-all-wallets-list-item
3552          data-testid="wallet-search-item-${t.id}"
3553          @click=${()=>this.onConnectWallet(t)}
3554          .wallet=${t}
3555          explorerId=${t.id}
3556          certified=${this.badge==="certified"}
3557          displayIndex=${r}
3558        ></w3m-all-wallets-list-item>
3559      `)}paginationLoaderTemplate(){let{wallets:t,recommended:r,featured:n,count:o,mobileFilteredOutWalletsLength:s}=de.state,i=window.innerWidth<352?3:4,a=t.length+r.length,l=Math.ceil(a/i)*i-a+i;return l-=t.length?n.length%i:0,o===0&&n.length>0?null:o===0||[...n,...t,...r].length<o-(s??0)?this.shimmerTemplate(l,v8e):null}createPaginationObserver(){let t=this.shadowRoot?.querySelector(`#${v8e}`);t&&(this.paginationObserver=new IntersectionObserver(([r])=>{if(r?.isIntersecting&&!this.loading){let{page:n,count:o,wallets:s}=de.state;s.length<o&&de.fetchWalletsByPage({page:n+1})}}),this.paginationObserver.observe(t))}onConnectWallet(t){X.selectWalletConnector(t)}};m2.styles=b8e;R5([ie()],m2.prototype,"loading",void 0);R5([ie()],m2.prototype,"wallets",void 0);R5([ie()],m2.prototype,"badge",void 0);R5([ie()],m2.prototype,"mobileFullScreen",void 0);m2=R5([te("w3m-all-wallets-list")],m2)});var O5=h(()=>{m5()});var A8e,C8e=h(()=>{le();A8e=yr`
3560  wui-grid,
3561  wui-loading-spinner,
3562  wui-flex {
3563    height: 360px;
3564  }
3565
3566  wui-grid {
3567    overflow: scroll;
3568    scrollbar-width: none;
3569    grid-auto-rows: min-content;
3570    grid-template-columns: repeat(auto-fill, 104px);
3571  }
3572
3573  :host([data-mobile-fullscreen='true']) wui-grid {
3574    max-height: none;
3575    height: auto;
3576  }
3577
3578  wui-grid[data-scroll='false'] {
3579    overflow: hidden;
3580  }
3581
3582  wui-grid::-webkit-scrollbar {
3583    display: none;
3584  }
3585
3586  wui-loading-spinner {
3587    justify-content: center;
3588    align-items: center;
3589  }
3590
3591  @media (max-width: 350px) {
3592    wui-grid {
3593      grid-template-columns: repeat(2, 1fr);
3594    }
3595  }
3596`});var B5,g2,S8e=h(()=>{le();Ue();st();He();Mr();uz();E7();O5();Mn();dz();C8e();B5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},g2=class extends ne{constructor(){super(...arguments),this.prevQuery="",this.prevBadge=void 0,this.loading=!0,this.mobileFullScreen=W.state.enableMobileFullScreen,this.query=""}render(){return this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.onSearch(),this.loading?$`<wui-loading-spinner color="accent-primary"></wui-loading-spinner>`:this.walletsTemplate()}async onSearch(){(this.query.trim()!==this.prevQuery.trim()||this.badge!==this.prevBadge)&&(this.prevQuery=this.query,this.prevBadge=this.badge,this.loading=!0,await de.searchWallet({search:this.query,badge:this.badge}),this.loading=!1)}walletsTemplate(){let{search:t}=de.state,r=is.markWalletsAsInstalled(t),n=is.filterWalletsByWcSupport(r);return n.length?$`
3597      <wui-grid
3598        data-testid="wallet-list"
3599        .padding=${["0","3","3","3"]}
3600        rowGap="4"
3601        columngap="2"
3602        justifyContent="space-between"
3603      >
3604        ${n.map((o,s)=>$`
3605            <w3m-all-wallets-list-item
3606              @click=${()=>this.onConnectWallet(o)}
3607              .wallet=${o}
3608              data-testid="wallet-search-item-${o.id}"
3609              explorerId=${o.id}
3610              certified=${this.badge==="certified"}
3611              walletQuery=${this.query}
3612              displayIndex=${s}
3613            ></w3m-all-wallets-list-item>
3614          `)}
3615      </wui-grid>
3616    `:$`
3617        <wui-flex
3618          data-testid="no-wallet-found"
3619          justifyContent="center"
3620          alignItems="center"
3621          gap="3"
3622          flexDirection="column"
3623        >
3624          <wui-icon-box size="lg" color="default" icon="wallet"></wui-icon-box>
3625          <wui-text data-testid="no-wallet-found-text" color="secondary" variant="md-medium">
3626            No Wallet found
3627          </wui-text>
3628        </wui-flex>
3629      `}onConnectWallet(t){X.selectWalletConnector(t)}};g2.styles=A8e;B5([ie()],g2.prototype,"loading",void 0);B5([ie()],g2.prototype,"mobileFullScreen",void 0);B5([V()],g2.prototype,"query",void 0);B5([V()],g2.prototype,"badge",void 0);g2=B5([te("w3m-all-wallets-search")],g2)});var pz,k5,I8e=h(()=>{le();Ue();st();He();e8e();Mr();E7();c8e();E8e();S8e();pz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},k5=class extends ne{constructor(){super(...arguments),this.search="",this.badge=void 0,this.onDebouncedSearch=ee.debounce(t=>{this.search=t})}render(){let t=this.search.length>=2;return $`
3630      <wui-flex .padding=${["1","3","3","3"]} gap="2" alignItems="center">
3631        <wui-search-bar @inputChange=${this.onInputChange.bind(this)}></wui-search-bar>
3632        <wui-certified-switch
3633          ?checked=${this.badge==="certified"}
3634          @certifiedSwitchChange=${this.onCertifiedSwitchChange.bind(this)}
3635          data-testid="wui-certified-switch"
3636        ></wui-certified-switch>
3637        ${this.qrButtonTemplate()}
3638      </wui-flex>
3639      ${t||this.badge?$`<w3m-all-wallets-search
3640            query=${this.search}
3641            .badge=${this.badge}
3642          ></w3m-all-wallets-search>`:$`<w3m-all-wallets-list .badge=${this.badge}></w3m-all-wallets-list>`}
3643    `}onInputChange(t){this.onDebouncedSearch(t.detail)}onCertifiedSwitchChange(t){t.detail?(this.badge="certified",Ze.showSvg("Only WalletConnect certified",{icon:"walletConnectBrown",iconColor:"accent-100"})):this.badge=void 0}qrButtonTemplate(){return ee.isMobile()?$`
3644        <wui-icon-box
3645          size="xl"
3646          iconSize="xl"
3647          color="accent-primary"
3648          icon="qrCode"
3649          border
3650          borderColor="wui-accent-glass-010"
3651          @click=${this.onWalletConnectQr.bind(this)}
3652        ></wui-icon-box>
3653      `:null}onWalletConnectQr(){Z.push("ConnectingWalletConnect")}};pz([ie()],k5.prototype,"search",void 0);pz([ie()],k5.prototype,"badge",void 0);k5=pz([te("w3m-all-wallets-view")],k5)});var T8e,_8e=h(()=>{Tt();T8e=ce`
3654  :host {
3655    width: 100%;
3656  }
3657
3658  :host([data-type='primary']) > button {
3659    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
3660  }
3661
3662  :host([data-type='secondary']) > button {
3663    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3664  }
3665
3666  button {
3667    display: flex;
3668    align-items: center;
3669    justify-content: space-between;
3670    padding: ${({spacing:e})=>e[3]};
3671    width: 100%;
3672    border-radius: ${({borderRadius:e})=>e[4]};
3673    transition:
3674      background-color ${({durations:e})=>e.lg}
3675        ${({easings:e})=>e["ease-out-power-2"]},
3676      scale ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]};
3677    will-change: background-color, scale;
3678  }
3679
3680  wui-text {
3681    text-transform: capitalize;
3682  }
3683
3684  wui-image {
3685    color: ${({tokens:e})=>e.theme.textPrimary};
3686  }
3687
3688  @media (hover: hover) {
3689    :host([data-type='primary']) > button:hover:enabled {
3690      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3691    }
3692
3693    :host([data-type='secondary']) > button:hover:enabled {
3694      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3695    }
3696  }
3697
3698  button:disabled {
3699    opacity: 0.5;
3700    cursor: not-allowed;
3701  }
3702`});var Hi,Es,P8e=h(()=>{le();Ue();Pr();m5();xs();kt();Pt();_8e();Hi=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Es=class extends ne{constructor(){super(...arguments),this.type="primary",this.imageSrc="google",this.imageSize=void 0,this.loading=!1,this.boxColor="foregroundPrimary",this.disabled=!1,this.rightIcon=!0,this.boxed=!0,this.rounded=!1,this.fullSize=!1}render(){return this.dataset.rounded=this.rounded?"true":"false",this.dataset.type=this.type,$`
3703      <button
3704        ?disabled=${this.loading?!0:!!this.disabled}
3705        data-loading=${this.loading}
3706        tabindex=${ve(this.tabIdx)}
3707      >
3708        <wui-flex gap="2" alignItems="center">
3709          ${this.templateLeftIcon()}
3710          <wui-flex gap="1">
3711            <slot></slot>
3712          </wui-flex>
3713        </wui-flex>
3714        ${this.templateRightIcon()}
3715      </button>
3716    `}templateLeftIcon(){return this.icon?$`<wui-image
3717        icon=${this.icon}
3718        iconColor=${ve(this.iconColor)}
3719        ?boxed=${this.boxed}
3720        ?rounded=${this.rounded}
3721        boxColor=${this.boxColor}
3722      ></wui-image>`:$`<wui-image
3723      ?boxed=${this.boxed}
3724      ?rounded=${this.rounded}
3725      ?fullSize=${this.fullSize}
3726      size=${ve(this.imageSize)}
3727      src=${this.imageSrc}
3728      boxColor=${this.boxColor}
3729    ></wui-image>`}templateRightIcon(){return this.rightIcon?this.loading?$`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:$`<wui-icon name="chevronRight" size="lg" color="default"></wui-icon>`:null}};Es.styles=[ke,Zt,T8e];Hi([V()],Es.prototype,"type",void 0);Hi([V()],Es.prototype,"imageSrc",void 0);Hi([V()],Es.prototype,"imageSize",void 0);Hi([V()],Es.prototype,"icon",void 0);Hi([V()],Es.prototype,"iconColor",void 0);Hi([V({type:Boolean})],Es.prototype,"loading",void 0);Hi([V()],Es.prototype,"tabIdx",void 0);Hi([V()],Es.prototype,"boxColor",void 0);Hi([V({type:Boolean})],Es.prototype,"disabled",void 0);Hi([V({type:Boolean})],Es.prototype,"rightIcon",void 0);Hi([V({type:Boolean})],Es.prototype,"boxed",void 0);Hi([V({type:Boolean})],Es.prototype,"rounded",void 0);Hi([V({type:Boolean})],Es.prototype,"fullSize",void 0);Es=Hi([te("wui-list-item")],Es)});var fz=h(()=>{P8e()});var xYe,hz,N8e=h(()=>{le();st();He();Mr();fz();Mn();xYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},hz=class extends ne{constructor(){super(...arguments),this.wallet=Z.state.data?.wallet}render(){if(!this.wallet)throw new Error("w3m-downloads-view");return $`
3730      <wui-flex gap="2" flexDirection="column" .padding=${["3","3","4","3"]}>
3731        ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
3732        ${this.homepageTemplate()}
3733      </wui-flex>
3734    `}chromeTemplate(){return this.wallet?.chrome_store?$`<wui-list-item
3735      variant="icon"
3736      icon="chromeStore"
3737      iconVariant="square"
3738      @click=${this.onChromeStore.bind(this)}
3739      chevron
3740    >
3741      <wui-text variant="md-medium" color="primary">Chrome Extension</wui-text>
3742    </wui-list-item>`:null}iosTemplate(){return this.wallet?.app_store?$`<wui-list-item
3743      variant="icon"
3744      icon="appStore"
3745      iconVariant="square"
3746      @click=${this.onAppStore.bind(this)}
3747      chevron
3748    >
3749      <wui-text variant="md-medium" color="primary">iOS App</wui-text>
3750    </wui-list-item>`:null}androidTemplate(){return this.wallet?.play_store?$`<wui-list-item
3751      variant="icon"
3752      icon="playStore"
3753      iconVariant="square"
3754      @click=${this.onPlayStore.bind(this)}
3755      chevron
3756    >
3757      <wui-text variant="md-medium" color="primary">Android App</wui-text>
3758    </wui-list-item>`:null}homepageTemplate(){return this.wallet?.homepage?$`
3759      <wui-list-item
3760        variant="icon"
3761        icon="browser"
3762        iconVariant="square-blue"
3763        @click=${this.onHomePage.bind(this)}
3764        chevron
3765      >
3766        <wui-text variant="md-medium" color="primary">Website</wui-text>
3767      </wui-list-item>
3768    `:null}openStore(t){t.href&&this.wallet&&(xe.sendEvent({type:"track",event:"GET_WALLET",properties:{name:this.wallet.name,walletRank:this.wallet.order,explorerId:this.wallet.id,type:t.type}}),ee.openHref(t.href,"_blank"))}onChromeStore(){this.wallet?.chrome_store&&this.openStore({href:this.wallet.chrome_store,type:"chrome_store"})}onAppStore(){this.wallet?.app_store&&this.openStore({href:this.wallet.app_store,type:"app_store"})}onPlayStore(){this.wallet?.play_store&&this.openStore({href:this.wallet.play_store,type:"play_store"})}onHomePage(){this.wallet?.homepage&&this.openStore({href:this.wallet.homepage,type:"homepage"})}};hz=xYe([te("w3m-downloads-view")],hz)});var R8e={};Ce(R8e,{W3mAllWalletsView:()=>k5,W3mConnectingWcBasicView:()=>P5,W3mDownloadsView:()=>hz});var O8e=h(()=>{Fxe();I8e();N8e()});var B8e,k8e=h(()=>{Tt();B8e=ce`
3769  :host {
3770    display: block;
3771    border-radius: clamp(0px, ${({borderRadius:e})=>e[8]}, 44px);
3772    box-shadow: 0 0 0 1px ${({tokens:e})=>e.theme.foregroundPrimary};
3773    overflow: hidden;
3774  }
3775`});var vYe,mz,D8e=h(()=>{le();kt();Pt();k8e();vYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},mz=class extends ne{render(){return $`<slot></slot>`}};mz.styles=[ke,B8e];mz=vYe([te("wui-card")],mz)});var U8e=h(()=>{D8e()});var L8e,M8e=h(()=>{Tt();L8e=ce`
3776  :host {
3777    width: 100%;
3778  }
3779
3780  :host > wui-flex {
3781    width: 100%;
3782    display: flex;
3783    align-items: center;
3784    justify-content: center;
3785    gap: ${({spacing:e})=>e[2]};
3786    padding: ${({spacing:e})=>e[3]};
3787    border-radius: ${({borderRadius:e})=>e[6]};
3788    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
3789    box-sizing: border-box;
3790    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
3791    box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
3792    color: ${({tokens:e})=>e.theme.textPrimary};
3793  }
3794
3795  :host > wui-flex[data-type='info'] {
3796    .icon-box {
3797      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3798
3799      wui-icon {
3800        color: ${({tokens:e})=>e.theme.iconDefault};
3801      }
3802    }
3803  }
3804  :host > wui-flex[data-type='success'] {
3805    .icon-box {
3806      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
3807
3808      wui-icon {
3809        color: ${({tokens:e})=>e.core.borderSuccess};
3810      }
3811    }
3812  }
3813  :host > wui-flex[data-type='warning'] {
3814    .icon-box {
3815      background-color: ${({tokens:e})=>e.core.backgroundWarning};
3816
3817      wui-icon {
3818        color: ${({tokens:e})=>e.core.borderWarning};
3819      }
3820    }
3821  }
3822  :host > wui-flex[data-type='error'] {
3823    .icon-box {
3824      background-color: ${({tokens:e})=>e.core.backgroundError};
3825
3826      wui-icon {
3827        color: ${({tokens:e})=>e.core.borderError};
3828      }
3829    }
3830  }
3831
3832  wui-flex {
3833    width: 100%;
3834  }
3835
3836  wui-text {
3837    word-break: break-word;
3838    flex: 1;
3839  }
3840
3841  .close {
3842    cursor: pointer;
3843    color: ${({tokens:e})=>e.theme.iconDefault};
3844  }
3845
3846  .icon-box {
3847    height: 40px;
3848    width: 40px;
3849    border-radius: ${({borderRadius:e})=>e[2]};
3850    background-color: var(--local-icon-bg-value);
3851  }
3852`});var gz,EYe,D5,H8e=h(()=>{le();Ue();Pr();st();Jn();xs();Zg();kt();Pt();M8e();gz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},EYe={info:"info",success:"checkmark",warning:"warningCircle",error:"warning"},D5=class extends ne{constructor(){super(...arguments),this.message="",this.type="info"}render(){return $`
3853      <wui-flex
3854        data-type=${ve(this.type)}
3855        flexDirection="row"
3856        justifyContent="space-between"
3857        alignItems="center"
3858        gap="2"
3859      >
3860        <wui-flex columnGap="2" flexDirection="row" alignItems="center">
3861          <wui-flex
3862            flexDirection="row"
3863            alignItems="center"
3864            justifyContent="center"
3865            class="icon-box"
3866          >
3867            <wui-icon color="inherit" size="md" name=${EYe[this.type]}></wui-icon>
3868          </wui-flex>
3869          <wui-text variant="md-medium" color="inherit" data-testid="wui-alertbar-text"
3870            >${this.message}</wui-text
3871          >
3872        </wui-flex>
3873        <wui-icon
3874          class="close"
3875          color="inherit"
3876          size="sm"
3877          name="close"
3878          @click=${this.onClose}
3879        ></wui-icon>
3880      </wui-flex>
3881    `}onClose(){Jr.close()}};D5.styles=[ke,L8e];gz([V()],D5.prototype,"message",void 0);gz([V()],D5.prototype,"type",void 0);D5=gz([te("wui-alertbar")],D5)});var $8e=h(()=>{H8e()});var F8e,V8e=h(()=>{He();F8e=ce`
3882  :host {
3883    display: block;
3884    position: absolute;
3885    top: ${({spacing:e})=>e[3]};
3886    left: ${({spacing:e})=>e[4]};
3887    right: ${({spacing:e})=>e[4]};
3888    opacity: 0;
3889    pointer-events: none;
3890  }
3891`});var z8e,AYe,Z7,j8e=h(()=>{le();Ue();st();He();$8e();V8e();z8e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},AYe={info:{backgroundColor:"fg-350",iconColor:"fg-325",icon:"info"},success:{backgroundColor:"success-glass-reown-020",iconColor:"success-125",icon:"checkmark"},warning:{backgroundColor:"warning-glass-reown-020",iconColor:"warning-100",icon:"warningCircle"},error:{backgroundColor:"error-glass-reown-020",iconColor:"error-125",icon:"warning"}},Z7=class extends ne{constructor(){super(),this.unsubscribe=[],this.open=Jr.state.open,this.onOpen(!0),this.unsubscribe.push(Jr.subscribeKey("open",t=>{this.open=t,this.onOpen(!1)}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let{message:t,variant:r}=Jr.state,n=AYe[r];return $`
3892      <wui-alertbar
3893        message=${t}
3894        backgroundColor=${n?.backgroundColor}
3895        iconColor=${n?.iconColor}
3896        icon=${n?.icon}
3897        type=${r}
3898      ></wui-alertbar>
3899    `}onOpen(t){this.open?(this.animate([{opacity:0,transform:"scale(0.85)"},{opacity:1,transform:"scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: auto"):t||(this.animate([{opacity:1,transform:"scale(1)"},{opacity:0,transform:"scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"}),this.style.cssText="pointer-events: none")}};Z7.styles=F8e;z8e([ie()],Z7.prototype,"open",void 0);Z7=z8e([te("w3m-alertbar")],Z7)});var q8e,W8e=h(()=>{Tt();q8e=ce`
3900  :host {
3901    position: relative;
3902  }
3903
3904  button {
3905    display: flex;
3906    justify-content: center;
3907    align-items: center;
3908    background-color: transparent;
3909    padding: ${({spacing:e})=>e[1]};
3910  }
3911
3912  /* -- Colors --------------------------------------------------- */
3913  button[data-type='accent'] wui-icon {
3914    color: ${({tokens:e})=>e.core.iconAccentPrimary};
3915  }
3916
3917  button[data-type='neutral'][data-variant='primary'] wui-icon {
3918    color: ${({tokens:e})=>e.theme.iconInverse};
3919  }
3920
3921  button[data-type='neutral'][data-variant='secondary'] wui-icon {
3922    color: ${({tokens:e})=>e.theme.iconDefault};
3923  }
3924
3925  button[data-type='success'] wui-icon {
3926    color: ${({tokens:e})=>e.core.iconSuccess};
3927  }
3928
3929  button[data-type='error'] wui-icon {
3930    color: ${({tokens:e})=>e.core.iconError};
3931  }
3932
3933  /* -- Sizes --------------------------------------------------- */
3934  button[data-size='xs'] {
3935    width: 16px;
3936    height: 16px;
3937
3938    border-radius: ${({borderRadius:e})=>e[1]};
3939  }
3940
3941  button[data-size='sm'] {
3942    width: 20px;
3943    height: 20px;
3944    border-radius: ${({borderRadius:e})=>e[1]};
3945  }
3946
3947  button[data-size='md'] {
3948    width: 24px;
3949    height: 24px;
3950    border-radius: ${({borderRadius:e})=>e[2]};
3951  }
3952
3953  button[data-size='lg'] {
3954    width: 28px;
3955    height: 28px;
3956    border-radius: ${({borderRadius:e})=>e[2]};
3957  }
3958
3959  button[data-size='xs'] wui-icon {
3960    width: 8px;
3961    height: 8px;
3962  }
3963
3964  button[data-size='sm'] wui-icon {
3965    width: 12px;
3966    height: 12px;
3967  }
3968
3969  button[data-size='md'] wui-icon {
3970    width: 16px;
3971    height: 16px;
3972  }
3973
3974  button[data-size='lg'] wui-icon {
3975    width: 20px;
3976    height: 20px;
3977  }
3978
3979  /* -- Hover --------------------------------------------------- */
3980  @media (hover: hover) {
3981    button[data-type='accent']:hover:enabled {
3982      background-color: ${({tokens:e})=>e.core.foregroundAccent010};
3983    }
3984
3985    button[data-variant='primary'][data-type='neutral']:hover:enabled {
3986      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3987    }
3988
3989    button[data-variant='secondary'][data-type='neutral']:hover:enabled {
3990      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
3991    }
3992
3993    button[data-type='success']:hover:enabled {
3994      background-color: ${({tokens:e})=>e.core.backgroundSuccess};
3995    }
3996
3997    button[data-type='error']:hover:enabled {
3998      background-color: ${({tokens:e})=>e.core.backgroundError};
3999    }
4000  }
4001
4002  /* -- Focus --------------------------------------------------- */
4003  button:focus-visible {
4004    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
4005  }
4006
4007  /* -- Properties --------------------------------------------------- */
4008  button[data-full-width='true'] {
4009    width: 100%;
4010  }
4011
4012  :host([fullWidth]) {
4013    width: 100%;
4014  }
4015
4016  button[disabled] {
4017    opacity: 0.5;
4018    cursor: not-allowed;
4019  }
4020`});var wm,bd,K8e=h(()=>{le();Ue();Pr();Jn();kt();Pt();W8e();wm=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},bd=class extends ne{constructor(){super(...arguments),this.icon="card",this.variant="primary",this.type="accent",this.size="md",this.iconSize=void 0,this.fullWidth=!1,this.disabled=!1}render(){return $`<button
4021      data-variant=${this.variant}
4022      data-type=${this.type}
4023      data-size=${this.size}
4024      data-full-width=${this.fullWidth}
4025      ?disabled=${this.disabled}
4026    >
4027      <wui-icon color="inherit" name=${this.icon} size=${ve(this.iconSize)}></wui-icon>
4028    </button>`}};bd.styles=[ke,Zt,q8e];wm([V()],bd.prototype,"icon",void 0);wm([V()],bd.prototype,"variant",void 0);wm([V()],bd.prototype,"type",void 0);wm([V()],bd.prototype,"size",void 0);wm([V()],bd.prototype,"iconSize",void 0);wm([V({type:Boolean})],bd.prototype,"fullWidth",void 0);wm([V({type:Boolean})],bd.prototype,"disabled",void 0);bd=wm([te("wui-icon-button")],bd)});var yz=h(()=>{K8e()});var Z8e,G8e=h(()=>{Tt();Z8e=ce`
4029  button {
4030    display: block;
4031    display: flex;
4032    align-items: center;
4033    padding: ${({spacing:e})=>e[1]};
4034    transition: background-color ${({durations:e})=>e.lg}
4035      ${({easings:e})=>e["ease-out-power-2"]};
4036    will-change: background-color;
4037    border-radius: ${({borderRadius:e})=>e[32]};
4038  }
4039
4040  wui-image {
4041    border-radius: 100%;
4042  }
4043
4044  wui-text {
4045    padding-left: ${({spacing:e})=>e[1]};
4046  }
4047
4048  .left-icon-container,
4049  .right-icon-container {
4050    width: 24px;
4051    height: 24px;
4052    justify-content: center;
4053    align-items: center;
4054  }
4055
4056  wui-icon {
4057    color: ${({tokens:e})=>e.theme.iconDefault};
4058  }
4059
4060  /* -- Sizes --------------------------------------------------- */
4061  button[data-size='lg'] {
4062    height: 32px;
4063  }
4064
4065  button[data-size='md'] {
4066    height: 28px;
4067  }
4068
4069  button[data-size='sm'] {
4070    height: 24px;
4071  }
4072
4073  button[data-size='lg'] wui-image {
4074    width: 24px;
4075    height: 24px;
4076  }
4077
4078  button[data-size='md'] wui-image {
4079    width: 20px;
4080    height: 20px;
4081  }
4082
4083  button[data-size='sm'] wui-image {
4084    width: 16px;
4085    height: 16px;
4086  }
4087
4088  button[data-size='lg'] .left-icon-container {
4089    width: 24px;
4090    height: 24px;
4091  }
4092
4093  button[data-size='md'] .left-icon-container {
4094    width: 20px;
4095    height: 20px;
4096  }
4097
4098  button[data-size='sm'] .left-icon-container {
4099    width: 16px;
4100    height: 16px;
4101  }
4102
4103  /* -- Variants --------------------------------------------------------- */
4104  button[data-type='filled-dropdown'] {
4105    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4106  }
4107
4108  button[data-type='text-dropdown'] {
4109    background-color: transparent;
4110  }
4111
4112  /* -- Focus states --------------------------------------------------- */
4113  button:focus-visible:enabled {
4114    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4115    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent040};
4116  }
4117
4118  /* -- Hover & Active states ----------------------------------------------------------- */
4119  @media (hover: hover) and (pointer: fine) {
4120    button:hover:enabled,
4121    button:active:enabled {
4122      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4123    }
4124  }
4125
4126  /* -- Disabled states --------------------------------------------------- */
4127  button:disabled {
4128    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4129    opacity: 0.5;
4130  }
4131`});var K6,CYe,SYe,bm,Y8e=h(()=>{le();Ue();Jn();t2();xs();kt();Pt();G8e();K6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},CYe={lg:"lg-regular",md:"md-regular",sm:"sm-regular"},SYe={lg:"lg",md:"md",sm:"sm"},bm=class extends ne{constructor(){super(...arguments),this.imageSrc="",this.text="",this.size="lg",this.type="text-dropdown",this.disabled=!1}render(){return $`<button ?disabled=${this.disabled} data-size=${this.size} data-type=${this.type}>
4132      ${this.imageTemplate()} ${this.textTemplate()}
4133      <wui-flex class="right-icon-container">
4134        <wui-icon name="chevronBottom"></wui-icon>
4135      </wui-flex>
4136    </button>`}textTemplate(){let t=CYe[this.size];return this.text?$`<wui-text color="primary" variant=${t}>${this.text}</wui-text>`:null}imageTemplate(){if(this.imageSrc)return $`<wui-image src=${this.imageSrc} alt="select visual"></wui-image>`;let t=SYe[this.size];return $` <wui-flex class="left-icon-container">
4137      <wui-icon size=${t} name="networkPlaceholder"></wui-icon>
4138    </wui-flex>`}};bm.styles=[ke,Zt,Z8e];K6([V()],bm.prototype,"imageSrc",void 0);K6([V()],bm.prototype,"text",void 0);K6([V()],bm.prototype,"size",void 0);K6([V()],bm.prototype,"type",void 0);K6([V({type:Boolean})],bm.prototype,"disabled",void 0);bm=K6([te("wui-select")],bm)});var J8e=h(()=>{Y8e()});var Q8e=h(()=>{TV()});var bf,wz=h(()=>{bf={ACCOUNT_TABS:[{label:"Tokens"},{label:"Activity"}],SECURE_SITE_ORIGIN:(typeof process<"u"&&typeof process.env<"u"?process.env.NEXT_PUBLIC_SECURE_SITE_ORIGIN:void 0)||"https://secure.walletconnect.org",VIEW_DIRECTION:{Next:"next",Prev:"prev"},ANIMATION_DURATIONS:{HeaderText:120,ModalHeight:150,ViewTransition:150},VIEWS_WITH_LEGAL_FOOTER:["Connect","ConnectWallets","OnRampTokenSelect","OnRampFiatSelect","OnRampProviders"],VIEWS_WITH_DEFAULT_FOOTER:["Networks"]}});var X8e,e4e=h(()=>{Tt();X8e=ce`
4139  button {
4140    background-color: transparent;
4141    padding: ${({spacing:e})=>e[1]};
4142  }
4143
4144  button:focus-visible {
4145    box-shadow: 0 0 0 4px ${({tokens:e})=>e.core.foregroundAccent020};
4146  }
4147
4148  button[data-variant='accent']:hover:enabled,
4149  button[data-variant='accent']:focus-visible {
4150    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
4151  }
4152
4153  button[data-variant='primary']:hover:enabled,
4154  button[data-variant='primary']:focus-visible,
4155  button[data-variant='secondary']:hover:enabled,
4156  button[data-variant='secondary']:focus-visible {
4157    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4158  }
4159
4160  button[data-size='xs'] > wui-icon {
4161    width: 8px;
4162    height: 8px;
4163  }
4164
4165  button[data-size='sm'] > wui-icon {
4166    width: 12px;
4167    height: 12px;
4168  }
4169
4170  button[data-size='xs'],
4171  button[data-size='sm'] {
4172    border-radius: ${({borderRadius:e})=>e[1]};
4173  }
4174
4175  button[data-size='md'],
4176  button[data-size='lg'] {
4177    border-radius: ${({borderRadius:e})=>e[2]};
4178  }
4179
4180  button[data-size='md'] > wui-icon {
4181    width: 16px;
4182    height: 16px;
4183  }
4184
4185  button[data-size='lg'] > wui-icon {
4186    width: 20px;
4187    height: 20px;
4188  }
4189
4190  button:disabled {
4191    background-color: transparent;
4192    cursor: not-allowed;
4193    opacity: 0.5;
4194  }
4195
4196  button:hover:not(:disabled) {
4197    background-color: var(--wui-color-accent-glass-015);
4198  }
4199
4200  button:focus-visible:not(:disabled) {
4201    background-color: var(--wui-color-accent-glass-015);
4202    box-shadow:
4203      inset 0 0 0 1px var(--wui-color-accent-100),
4204      0 0 0 4px var(--wui-color-accent-glass-020);
4205  }
4206`});var Z6,xm,t4e=h(()=>{le();Ue();Jn();kt();Pt();e4e();Z6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},xm=class extends ne{constructor(){super(...arguments),this.size="md",this.disabled=!1,this.icon="copy",this.iconColor="default",this.variant="accent"}render(){let t={accent:"accent-primary",primary:"inverse",secondary:"default"};return $`
4207      <button data-variant=${this.variant} ?disabled=${this.disabled} data-size=${this.size}>
4208        <wui-icon
4209          color=${t[this.variant]||this.iconColor}
4210          size=${this.size}
4211          name=${this.icon}
4212        ></wui-icon>
4213      </button>
4214    `}};xm.styles=[ke,Zt,X8e];Z6([V()],xm.prototype,"size",void 0);Z6([V({type:Boolean})],xm.prototype,"disabled",void 0);Z6([V()],xm.prototype,"icon",void 0);Z6([V()],xm.prototype,"iconColor",void 0);Z6([V()],xm.prototype,"variant",void 0);xm=Z6([te("wui-icon-link")],xm)});var r4e=h(()=>{t4e()});var G7=h(()=>{t2()});var n4e,o4e=h(()=>{le();n4e=De`<svg width="86" height="96" fill="none">
4215  <path
4216    d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
4217  />
4218</svg>`});var s4e,i4e=h(()=>{le();s4e=De`
4219  <svg fill="none" viewBox="0 0 36 40">
4220    <path
4221      d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
4222    />
4223  </svg>
4224`});var a4e,c4e=h(()=>{Tt();a4e=ce`
4225  :host {
4226    position: relative;
4227    border-radius: inherit;
4228    display: flex;
4229    justify-content: center;
4230    align-items: center;
4231    width: var(--local-width);
4232    height: var(--local-height);
4233  }
4234
4235  :host([data-round='true']) {
4236    background: ${({tokens:e})=>e.theme.foregroundPrimary};
4237    border-radius: 100%;
4238    outline: 1px solid ${({tokens:e})=>e.core.glass010};
4239  }
4240
4241  svg {
4242    position: absolute;
4243    top: 0;
4244    left: 0;
4245    width: 100%;
4246    height: 100%;
4247    z-index: 1;
4248  }
4249
4250  svg > path {
4251    stroke: var(--local-stroke);
4252  }
4253
4254  wui-image {
4255    width: 100%;
4256    height: 100%;
4257    -webkit-clip-path: var(--local-path);
4258    clip-path: var(--local-path);
4259    background: ${({tokens:e})=>e.theme.foregroundPrimary};
4260  }
4261
4262  wui-icon {
4263    transform: translateY(-5%);
4264    width: var(--local-icon-size);
4265    height: var(--local-icon-size);
4266  }
4267`});var y2,xf,l4e=h(()=>{le();Ue();o4e();lz();i4e();Jn();t2();kt();Pt();c4e();y2=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},xf=class extends ne{constructor(){super(...arguments),this.size="md",this.name="uknown",this.networkImagesBySize={sm:s4e,md:W7,lg:n4e},this.selected=!1,this.round=!1}render(){let t={sm:"4",md:"6",lg:"10"};return this.round?(this.dataset.round="true",this.style.cssText=`
4268      --local-width: var(--apkt-spacing-10);
4269      --local-height: var(--apkt-spacing-10);
4270      --local-icon-size: var(--apkt-spacing-4);
4271    `):this.style.cssText=`
4272
4273      --local-path: var(--apkt-path-network-${this.size});
4274      --local-width:  var(--apkt-width-network-${this.size});
4275      --local-height:  var(--apkt-height-network-${this.size});
4276      --local-icon-size:  var(--apkt-spacing-${t[this.size]});
4277    `,$`${this.templateVisual()} ${this.svgTemplate()} `}svgTemplate(){return this.round?null:this.networkImagesBySize[this.size]}templateVisual(){return this.imageSrc?$`<wui-image src=${this.imageSrc} alt=${this.name}></wui-image>`:$`<wui-icon size="inherit" color="default" name="networkPlaceholder"></wui-icon>`}};xf.styles=[ke,a4e];y2([V()],xf.prototype,"size",void 0);y2([V()],xf.prototype,"name",void 0);y2([V({type:Object})],xf.prototype,"networkImagesBySize",void 0);y2([V()],xf.prototype,"imageSrc",void 0);y2([V({type:Boolean})],xf.prototype,"selected",void 0);y2([V({type:Boolean})],xf.prototype,"round",void 0);xf=y2([te("wui-network-image")],xf)});var u4e=h(()=>{l4e()});var d4e,p4e=h(()=>{Tt();d4e=ce`
4278  :host {
4279    position: relative;
4280    display: flex;
4281    width: 100%;
4282    height: 1px;
4283    background-color: ${({tokens:e})=>e.theme.borderPrimary};
4284    justify-content: center;
4285    align-items: center;
4286  }
4287
4288  :host > wui-text {
4289    position: absolute;
4290    padding: 0px 8px;
4291    transition: background-color ${({durations:e})=>e.lg}
4292      ${({easings:e})=>e["ease-out-power-2"]};
4293    will-change: background-color;
4294  }
4295
4296  :host([data-bg-color='primary']) > wui-text {
4297    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4298  }
4299
4300  :host([data-bg-color='secondary']) > wui-text {
4301    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4302  }
4303`});var bz,U5,f4e=h(()=>{le();Ue();xs();kt();Pt();p4e();bz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},U5=class extends ne{constructor(){super(...arguments),this.text="",this.bgColor="primary"}render(){return this.dataset.bgColor=this.bgColor,$`${this.template()}`}template(){return this.text?$`<wui-text variant="md-regular" color="secondary">${this.text}</wui-text>`:null}};U5.styles=[ke,d4e];bz([V()],U5.prototype,"text",void 0);bz([V()],U5.prototype,"bgColor",void 0);U5=bz([te("wui-separator")],U5)});var xz=h(()=>{f4e()});var h4e=h(()=>{jb()});var lt,vf,_t,G6=h(()=>{lt={INVALID_PAYMENT_CONFIG:"INVALID_PAYMENT_CONFIG",INVALID_RECIPIENT:"INVALID_RECIPIENT",INVALID_ASSET:"INVALID_ASSET",INVALID_AMOUNT:"INVALID_AMOUNT",UNKNOWN_ERROR:"UNKNOWN_ERROR",UNABLE_TO_INITIATE_PAYMENT:"UNABLE_TO_INITIATE_PAYMENT",INVALID_CHAIN_NAMESPACE:"INVALID_CHAIN_NAMESPACE",GENERIC_PAYMENT_ERROR:"GENERIC_PAYMENT_ERROR",UNABLE_TO_GET_EXCHANGES:"UNABLE_TO_GET_EXCHANGES",ASSET_NOT_SUPPORTED:"ASSET_NOT_SUPPORTED",UNABLE_TO_GET_PAY_URL:"UNABLE_TO_GET_PAY_URL",UNABLE_TO_GET_BUY_STATUS:"UNABLE_TO_GET_BUY_STATUS",UNABLE_TO_GET_TOKEN_BALANCES:"UNABLE_TO_GET_TOKEN_BALANCES",UNABLE_TO_GET_QUOTE:"UNABLE_TO_GET_QUOTE",UNABLE_TO_GET_QUOTE_STATUS:"UNABLE_TO_GET_QUOTE_STATUS",INVALID_RECIPIENT_ADDRESS_FOR_ASSET:"INVALID_RECIPIENT_ADDRESS_FOR_ASSET"},vf={[lt.INVALID_PAYMENT_CONFIG]:"Invalid payment configuration",[lt.INVALID_RECIPIENT]:"Invalid recipient address",[lt.INVALID_ASSET]:"Invalid asset specified",[lt.INVALID_AMOUNT]:"Invalid payment amount",[lt.INVALID_RECIPIENT_ADDRESS_FOR_ASSET]:"Invalid recipient address for the asset selected",[lt.UNKNOWN_ERROR]:"Unknown payment error occurred",[lt.UNABLE_TO_INITIATE_PAYMENT]:"Unable to initiate payment",[lt.INVALID_CHAIN_NAMESPACE]:"Invalid chain namespace",[lt.GENERIC_PAYMENT_ERROR]:"Unable to process payment",[lt.UNABLE_TO_GET_EXCHANGES]:"Unable to get exchanges",[lt.ASSET_NOT_SUPPORTED]:"Asset not supported by the selected exchange",[lt.UNABLE_TO_GET_PAY_URL]:"Unable to get payment URL",[lt.UNABLE_TO_GET_BUY_STATUS]:"Unable to get buy status",[lt.UNABLE_TO_GET_TOKEN_BALANCES]:"Unable to get token balances",[lt.UNABLE_TO_GET_QUOTE]:"Unable to get quote. Please choose a different token",[lt.UNABLE_TO_GET_QUOTE_STATUS]:"Unable to get quote status"},_t=class e extends Error{get message(){return vf[this.code]}constructor(t,r){super(vf[t]),this.name="AppKitPayError",this.code=t,this.details=r,Error.captureStackTrace&&Error.captureStackTrace(this,e)}}});var m4e,vz,Ez=h(()=>{m4e="https://rpc.walletconnect.org/v1/json-rpc",vz="reown_test"});function g4e(){let{chainNamespace:e}=Qe.parseCaipNetworkId(Se.state.paymentAsset.network);if(!ee.isAddress(Se.state.recipient,e))throw new _t(lt.INVALID_RECIPIENT_ADDRESS_FOR_ASSET,`Provide valid recipient address for namespace "${e}"`)}async function y4e(e,t,r){if(t!==j.CHAIN.EVM)throw new _t(lt.INVALID_CHAIN_NAMESPACE);if(!r.fromAddress)throw new _t(lt.INVALID_PAYMENT_CONFIG,"fromAddress is required for native EVM payments.");let n=typeof r.amount=="string"?parseFloat(r.amount):r.amount;if(isNaN(n))throw new _t(lt.INVALID_PAYMENT_CONFIG);let o=e.metadata?.decimals??18,s=J.parseUnits(n.toString(),o);if(typeof s!="bigint")throw new _t(lt.GENERIC_PAYMENT_ERROR);return await J.sendTransaction({chainNamespace:t,to:r.recipient,address:r.fromAddress,value:s,data:"0x"})??void 0}
4303async function w4e(e,t){if(!t.fromAddress)throw new _t(lt.INVALID_PAYMENT_CONFIG,"fromAddress is required for ERC20 EVM payments.");let r=e.asset,n=t.recipient,o=Number(e.metadata.decimals),s=J.parseUnits(t.amount.toString(),o);if(s===void 0)throw new _t(lt.GENERIC_PAYMENT_ERROR);return await J.writeContract({fromAddress:t.fromAddress,tokenAddress:r,args:[n,s],method:"transfer",abi:y8.getERC20Abi(r),chainNamespace:j.CHAIN.EVM})??void 0}async function b4e(e,t){if(e!==j.CHAIN.SOLANA)throw new _t(lt.INVALID_CHAIN_NAMESPACE);if(!t.fromAddress)throw new _t(lt.INVALID_PAYMENT_CONFIG,"fromAddress is required for Solana payments.");let r=typeof t.amount=="string"?parseFloat(t.amount):t.amount;if(isNaN(r)||r<=0)throw new _t(lt.INVALID_PAYMENT_CONFIG,"Invalid payment amount.");try{if(!or.getProvider(e))throw new _t(lt.GENERIC_PAYMENT_ERROR,"No Solana provider available.");let o=await J.sendTransaction({chainNamespace:j.CHAIN.SOLANA,to:t.recipient,value:r,tokenMint:t.tokenMint});if(!o)throw new _t(lt.GENERIC_PAYMENT_ERROR,"Transaction failed.");return o}catch(n){throw n instanceof _t?n:new _t(lt.GENERIC_PAYMENT_ERROR,`Solana payment failed: ${n}`)}}async function x4e({sourceToken:e,toToken:t,amount:r,recipient:n}){let o=J.parseUnits(r,e.metadata.decimals),s=J.parseUnits(r,t.metadata.decimals);return Promise.resolve({type:Y7,origin:{amount:o?.toString()??"0",currency:e},destination:{amount:s?.toString()??"0",currency:t},fees:[{id:"service",label:"Service Fee",amount:"0",currency:t}],steps:[{requestId:Y7,type:"deposit",deposit:{amount:o?.toString()??"0",currency:e.asset,receiver:n}}],timeInSeconds:6})}function L5(e){if(!e)return null;let t=e.steps[0];return!t||t.type!==v4e?null:t}function J7(e,t=0){if(!e)return[];let r=e.steps.filter(o=>o.type===E4e),n=r.filter((o,s)=>s+1>t);return r.length>0&&r.length<3?n:[]}var Q7=h(()=>{it();st();Ef();G6();G6()});function IYe(){let e=W.getSnapshot().projectId;return`${m4e}?projectId=${e}`}function Sz(){let{projectId:e,sdkType:t,sdkVersion:r}=W.state;return{projectId:e,st:t||"appkit",sv:r||"html-wagmi-4.2.2"}}async function Iz(e,t){let r=IYe(),{sdkType:n,sdkVersion:o,projectId:s}=W.getSnapshot(),i={jsonrpc:"2.0",id:1,method:e,params:{...t||{},st:n,sv:o,projectId:s}},c=await(await fetch(r,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}})).json();if(c.error)throw new Az(c.error.message);return c}async function Tz(e){return(await Iz("reown_getExchanges",e)).result}async function _z(e){return(await Iz("reown_getExchangePayUrl",e)).result}async function A4e(e){return(await Iz("reown_getExchangeBuyStatus",e)).result}async function TYe(e){let t=dt.bigNumber(e.amount).times(10**e.toToken.metadata.decimals).toString(),{chainId:r,chainNamespace:n}=Qe.parseCaipNetworkId(e.sourceToken.network),{chainId:o,chainNamespace:s}=Qe.parseCaipNetworkId(e.toToken.network),i=e.sourceToken.asset==="native"?FL(n):e.sourceToken.asset,a=e.toToken.asset==="native"?FL(s):e.toToken.asset;return await Cz.post({path:"/appkit/v1/transfers/quote",body:{user:e.address,originChainId:r.toString(),originCurrency:i,destinationChainId:o.toString(),destinationCurrency:a,recipient:e.recipient,amount:t},params:Sz()})}async function C4e(e){let t=Qr.isLowerCaseMatch(e.sourceToken.network,e.toToken.network),r=Qr.isLowerCaseMatch(e.sourceToken.asset,e.toToken.asset);return t&&r?x4e(e):TYe(e)}async function S4e(e){return await Cz.get({path:"/appkit/v1/transfers/status",params:{requestId:e.requestId,...Sz()}})}async function I4e(e){return await Cz.get({path:`/appkit/v1/transfers/assets/exchanges/${e}`,params:Sz()})}var Cz,Az,T4e=h(()=>{it();st();ul();Ez();Q7();Cz=new Ai({baseUrl:ee.getApiUrl(),clientId:null}),Az=class extends Error{}});function X7(e,t){let{chainNamespace:r,chainId:n}=Qe.parseCaipNetworkId(e),o=PYe[r];if(!o)throw new Error(`Unsupported chain namespace for CAIP-19 formatting: ${r}`);let s=o.native.assetNamespace,i=o.native.assetReference;return t!=="native"?(s=o.defaultTokenNamespace,i=t):r==="eip155"&&_4e[n]&&(i=_4e[n]),`${`${r}:${n}`}/${s}:${i}`}function P4e(e){let{chainNamespace:t}=Qe.parseCaipNetworkId(e);return _Ye.includes(t)}function N4e(e){let r=k.getAllRequestedCaipNetworks().find(o=>o.caipNetworkId===e.chainId),n=e.address;if(!r)throw new Error(`Target network not found for balance chainId "${e.chainId}"`);if(Qr.isLowerCaseMatch(e.symbol,r.nativeCurrency.symbol))n="native";else if(ee.isCaipAddress(n)){let{address:o}=Qe.parseCaipAddress(n);n=o}else if(!n)throw new Error(`Balance address not found for balance symbol "${e.symbol}"`);return{network:r.caipNetworkId,asset:n,metadata:{name:e.name,symbol:e.symbol,decimals:Number(e.quantity.decimals),logoURI:e.iconUrl},amount:e.quantity.numeric}}function R4e(e){return{chainId:e.network,address:`${e.network}:${e.asset}
4303`,symbol:e.metadata.symbol,name:e.metadata.name,iconUrl:e.metadata.logoURI||"",price:0,quantity:{numeric:"0",decimals:e.metadata.decimals.toString()}}}function w2(e){let t=dt.bigNumber(e,{safe:!0});return t.lt(.001)?"<0.001":t.round(4).toString()}function O4e(e){let r=k.getAllRequestedCaipNetworks().find(n=>n.caipNetworkId===e.network);return r?!!r.testnet:!1}var _Ye,PYe,_4e,M5=h(()=>{it();st();ul();_Ye=["eip155","solana"],PYe={eip155:{native:{assetNamespace:"slip44",assetReference:"60"},defaultTokenNamespace:"erc20"},solana:{native:{assetNamespace:"slip44",assetReference:"501"},defaultTokenNamespace:"token"}},_4e={56:"714",204:"714"}});var B4e,Pz,Y7,v4e,E4e,se,Se,Ef=h(()=>{Rr();Pn();it();st();h4e();ul();G6();G6();T4e();M5();Q7();B4e=0,Pz="unknown",Y7="direct-transfer",v4e="deposit",E4e="transaction",se=Xe({paymentAsset:{network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},recipient:"0x0",amount:0,isConfigured:!1,error:null,isPaymentInProgress:!1,exchanges:[],isLoading:!1,openInNewTab:!0,redirectUrl:void 0,payWithExchange:void 0,currentPayment:void 0,analyticsSet:!1,paymentId:void 0,choice:"pay",tokenBalances:{[j.CHAIN.EVM]:[],[j.CHAIN.SOLANA]:[]},isFetchingTokenBalances:!1,selectedPaymentAsset:null,quote:void 0,quoteStatus:"waiting",quoteError:null,isFetchingQuote:!1,selectedExchange:void 0,exchangeUrlForQuote:void 0,requestId:void 0}),Se={state:se,subscribe(e){return Ot(se,()=>e(se))},subscribeKey(e,t){return Ct(se,e,t)},async handleOpenPay(e){this.resetState(),this.setPaymentConfig(e),this.initializeAnalytics(),g4e(),await this.prepareTokenLogo(),se.isConfigured=!0,xe.sendEvent({type:"track",event:"PAY_MODAL_OPEN",properties:{exchanges:se.exchanges,configuration:{network:se.paymentAsset.network,asset:se.paymentAsset.asset,recipient:se.recipient,amount:se.amount}}}),await Oe.open({view:"Pay"})},resetState(){se.paymentAsset={network:"eip155:1",asset:"0x0",metadata:{name:"0x0",symbol:"0x0",decimals:0}},se.recipient="0x0",se.amount=0,se.isConfigured=!1,se.error=null,se.isPaymentInProgress=!1,se.isLoading=!1,se.currentPayment=void 0,se.selectedExchange=void 0,se.exchangeUrlForQuote=void 0,se.requestId=void 0},resetQuoteState(){se.quote=void 0,se.quoteStatus="waiting",se.quoteError=null,se.isFetchingQuote=!1,se.requestId=void 0},setPaymentConfig(e){if(!e.paymentAsset)throw new _t(lt.INVALID_PAYMENT_CONFIG);try{se.choice=e.choice??"pay",se.paymentAsset=e.paymentAsset,se.recipient=e.recipient,se.amount=e.amount,se.openInNewTab=e.openInNewTab??!0,se.redirectUrl=e.redirectUrl,se.payWithExchange=e.payWithExchange,se.error=null}catch(t){throw new _t(lt.INVALID_PAYMENT_CONFIG,t.message)}},setSelectedPaymentAsset(e){se.selectedPaymentAsset=e},setSelectedExchange(e){se.selectedExchange=e},setRequestId(e){se.requestId=e},setPaymentInProgress(e){se.isPaymentInProgress=e},getPaymentAsset(){return se.paymentAsset},getExchanges(){return se.exchanges},async fetchExchanges(){try{se.isLoading=!0;let e=await Tz({page:B4e});se.exchanges=e.exchanges.slice(0,2)}catch{throw Ze.showError(vf.UNABLE_TO_GET_EXCHANGES),new _t(lt.UNABLE_TO_GET_EXCHANGES)}finally{se.isLoading=!1}},async getAvailableExchanges(e){try{let t=e?.asset&&e?.network?X7(e.network,e.asset):void 0;return await Tz({page:e?.page??B4e,asset:t,amount:e?.amount?.toString()})}catch{throw new _t(lt.UNABLE_TO_GET_EXCHANGES)}},async getPayUrl(e,t,r=!1){try{let n=Number(t.amount),o=await _z({exchangeId:e,asset:X7(t.network,t.asset),amount:n.toString(),recipient:`${t.network}:${t.recipient}`});return xe.sendEvent({type:"track",event:"PAY_EXCHANGE_SELECTED",properties:{source:"pay",exchange:{id:e},configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:n},currentPayment:{type:"exchange",exchangeId:e},headless:r}}),r&&(this.initiatePayment(),xe.sendEvent({type:"track",event:"PAY_INITIATED",properties:{source:"pay",paymentId:se.paymentId||Pz,configuration:{network:t.network,asset:t.asset,recipient:t.recipient,amount:n},currentPayment:{type:"exchange",exchangeId:e}}})),o}catch(n){throw n instanceof Error&&n.message.includes("is not supported")?new _t(lt.ASSET_NOT_SUPPORTED):new Error(n.message)}},async generateExchangeUrlForQuote({exchangeId:e,paymentAsset:t,amount:r,recipient:n}){let o=await _z({exchangeId:e,asset:X7(t.network,t.asset),amount:r.toString(),recipient:n});se.exchangeSessionId=o.sessionId,se.exchangeUrlForQuote=o.url},async openPayUrl(e,t,r=!1){try{let n=await this.getPayUrl(e.exchangeId,t,r);if(!n)throw new _t(lt.UNABLE_TO_GET_PAY_URL);let s=e.openInNewTab??!0?"_blank":"_self";return ee.openHref(n.url,s),n}catch(n){throw n instanceof _t?se.error=n.message:se.error=vf.GENERIC_PAYMENT_ERROR,new _t(lt.UNABLE_TO_GET_PAY_URL)}},async onTransfer({chainNamespace:e,fromAddress:t,toAddress:r,amount:n,paymentAsset:o}){if(se.currentPayment={type:"wallet",status:"IN_PROGRESS"},!se.isPaymentInProgress)try{this.initiatePayment();let i=k.getAllRequestedCaipNetworks().find(c=>c.caipNetworkId===o.network);if(!i)throw new Error("Target network not found");let a=k.state.activeCaipNetwork;switch(Qr.isLowerCaseMatch(a?.caipNetworkId,i.caipNetworkId)||await k.switchActiveNetwork(i),e){case j.CHAIN.EVM:o.asset==="native"&&(se.currentPayment.result=await y4e(o,e,{recipient:r,amount:n,fromAddress:t})),o.asset.startsWith("0x")&&(se.currentPayment.result=await w4e(o,{recipient:r,amount:n,fromAddress:t})),se.currentPayment.status="SUCCESS";break;case j.CHAIN.SOLANA:se.currentPayment.result=await b4e(e,{recipient:r,amount:n,fromAddress:t,tokenMint:o.asset==="native"?void 0:o.asset}),se.currentPayment.status="SUCCESS";break;
vendor: 1,028 bytes, line 4303
4303default:throw new _t(lt.INVALID_CHAIN_NAMESPACE)}}catch(s){throw s instanceof _t?se.error=s.message:se.error=vf.GENERIC_PAYMENT_ERROR,se.currentPayment.status="FAILED",Ze.showError(se.error),s}finally{se.isPaymentInProgress=!1}},async onSendTransaction(e){try{let{namespace:t,transactionStep:r}=e;Se.initiatePayment();let o=k.getAllRequestedCaipNetworks().find(i=>i.caipNetworkId===se.paymentAsset?.network);if(!o)throw new Error("Target network not found");let s=k.state.activeCaipNetwork;if(Qr.isLowerCaseMatch(s?.caipNetworkId,o.caipNetworkId)||await k.switchActiveNetwork(o),t===j.CHAIN.EVM){let{from:i,to:a,data:c,value:l}=r.transaction;await J.sendTransaction({address:i,to:a,data:c,value:BigInt(l),chainNamespace:t})}else if(t===j.CHAIN.SOLANA){let{instructions:i}=r.transaction;await J.writeSolanaTransaction({instructions:i})}}catch(t){throw t instanceof _t?se.error=t.message:se.error=vf.GENERIC_PAYMENT_ERROR,Ze.showError(se.error),t}finally{se.isPaymentInProgress=!1}},getExchangeById(e){return se.exchanges.find(t=>
4303t.id===e)},validatePayConfig(e){let{paymentAsset:t,recipient:r,amount:n}=e;if(!t)throw new _t(lt.INVALID_PAYMENT_CONFIG);if(!r)throw new _t(lt.INVALID_RECIPIENT);if(!t.asset)throw new _t(lt.INVALID_ASSET);if(n==null||n<=0)throw new _t(lt.INVALID_AMOUNT)},async handlePayWithExchange(e){try{se.currentPayment={type:"exchange",exchangeId:e};let{network:t,asset:r}=se.paymentAsset,n={network:t,asset:r,amount:se.amount,recipient:se.recipient},o=await this.getPayUrl(e,n);if(!o)throw new _t(lt.UNABLE_TO_INITIATE_PAYMENT);return se.currentPayment.sessionId=o.sessionId,se.currentPayment.status="IN_PROGRESS",se.currentPayment.exchangeId=e,this.initiatePayment(),{url:o.url,openInNewTab:se.openInNewTab}}catch(t){return t instanceof _t?se.error=t.message:se.error=vf.GENERIC_PAYMENT_ERROR,se.isPaymentInProgress=!1,Ze.showError(se.error),null}},async getBuyStatus(e,t){try{let r=await A4e({sessionId:t,exchangeId:e});return(r.status==="SUCCESS"||r.status==="FAILED")&&xe.sendEvent({type:"track",event:r.status==="SUCCESS"?"PAY_SUCCESS":"PAY_ERROR",properties:{message:r.status==="FAILED"?ee.parseError(se.error):void 0,source:"pay",paymentId:se.paymentId||Pz,configuration:{network:se.paymentAsset.network,asset:se.paymentAsset.asset,recipient:se.recipient,amount:se.amount},currentPayment:{type:"exchange",exchangeId:se.currentPayment?.exchangeId,sessionId:se.currentPayment?.sessionId,result:r.txHash}}}),r}catch{throw new _t(lt.UNABLE_TO_GET_BUY_STATUS)}},async fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:r}){if(!e)return[];let{address:n}=Qe.parseCaipAddress(e),o=t;return r===j.CHAIN.EVM&&(o=void 0),await jc.getMyTokensWithBalance({address:n,caipNetwork:o})},async fetchTokensFromExchange(){if(!se.selectedExchange)return[];let e=await I4e(se.selectedExchange.id),t=Object.values(e.assets).flat();return await Promise.all(t.map(async n=>{let o=R4e(n),{chainNamespace:s}=Qe.parseCaipNetworkId(o.chainId),i=o.address;if(ee.isCaipAddress(i)){let{address:c}=Qe.parseCaipAddress(i);i=c}let a=await vt.getImageByToken(i??"",s).catch(()=>{});return o.iconUrl=a??"",o}))},async fetchTokens({caipAddress:e,caipNetwork:t,namespace:r}){try{se.isFetchingTokenBalances=!0;let s=await(!!se.selectedExchange?this.fetchTokensFromExchange():this.fetchTokensFromEOA({caipAddress:e,caipNetwork:t,namespace:r}));se.tokenBalances={...se.tokenBalances,[r]:s}}catch(n){let o=n instanceof Error?n.message:"Unable to get token balances";Ze.showError(o)}finally{se.isFetchingTokenBalances=!1}},async fetchQuote({amount:e,address:t,sourceToken:r,toToken:n,recipient:o}){try{Se.resetQuoteState(),se.isFetchingQuote=!0;let s=await C4e({amount:e,address:se.selectedExchange?void 0:t,sourceToken:r,toToken:n,recipient:o});if(se.selectedExchange){let i=L5(s);if(i){let a=`${r.network}:${i.deposit.receiver}`,c=dt.formatNumber(i.deposit.amount,{decimals:r.metadata.decimals??0,round:8});await Se.generateExchangeUrlForQuote({exchangeId:se.selectedExchange.id,paymentAsset:r,amount:c.toString(),recipient:a})}}se.quote=s}catch(s){let i=vf.UNABLE_TO_GET_QUOTE;if(s instanceof Error&&s.cause&&s.cause instanceof Response)try{let a=await s.cause.json();a.error&&typeof a.error=="string"&&(i=a.error)}catch{}throw se.quoteError=i,Ze.showError(i),new _t(lt.UNABLE_TO_GET_QUOTE)}finally{se.isFetchingQuote=!1}},async fetchQuoteStatus({requestId:e}){try{if(e===Y7){let r=se.selectedExchange,n=se.exchangeSessionId;if(r&&n){switch((await this.getBuyStatus(r.id,n)).status){case"IN_PROGRESS":se.quoteStatus="waiting";break;case"SUCCESS":se.quoteStatus="success",se.isPaymentInProgress=!1;break;case"FAILED":se.quoteStatus="failure",se.isPaymentInProgress=!1;break;case"UNKNOWN":se.quoteStatus="waiting";break;default:se.quoteStatus="waiting";break}return}se.quoteStatus="success";return}let{status:t}=await S4e({requestId:e});se.quoteStatus=t}catch{throw se.quoteStatus="failure",new _t(lt.UNABLE_TO_GET_QUOTE_STATUS)}},initiatePayment(){se.isPaymentInProgress=!0,se.paymentId=crypto.randomUUID()},initializeAnalytics(){se.analyticsSet||(se.analyticsSet=!0,this.subscribeKey("isPaymentInProgress",e=>{if(se.currentPayment?.status&&se.currentPayment.status!=="UNKNOWN"){let t={IN_PROGRESS:"PAY_INITIATED",SUCCESS:"PAY_SUCCESS",FAILED:"PAY_ERROR"}[se.currentPayment.status];xe.sendEvent({type:"track",event:t,properties:{message:se.currentPayment.status==="FAILED"?ee.parseError(se.error):void 0,source:"pay",paymentId:se.paymentId||Pz,configuration:{network:se.paymentAsset.network,asset:se.paymentAsset.asset,recipient:se.recipient,amount:se.amount},currentPayment:{type:se.currentPayment.type,exchangeId:se.currentPayment.exchangeId,sessionId:se.currentPayment.sessionId,result:se.currentPayment.result}}})}}))},async prepareTokenLogo(){if(!se.paymentAsset.metadata.logoURI)try{let{chainNamespace:e}=Qe.parseCaipNetworkId(se.paymentAsset.network),t=await vt.getImageByToken(se.paymentAsset.asset,e);se.paymentAsset.metadata.logoURI=t}catch{}}}});var k4e,D4e=h(()=>{He();k4e=ce`
4304  wui-separator {
4305    margin: var(--apkt-spacing-3) calc(var(--apkt-spacing-3) * -1) var(--apkt-spacing-2)
4306      calc(var(--apkt-spacing-3) * -1);
4307    width: calc(100% + var(--apkt-spacing-3) * 2);
4308  }
4309
4310  .token-display {
4311    padding: var(--apkt-spacing-3) var(--apkt-spacing-3);
4312    border-radius: var(--apkt-borderRadius-5);
4313    background-color: var(--apkt-tokens-theme-backgroundPrimary);
4314    margin-top: var(--apkt-spacing-3);
4315    margin-bottom: var(--apkt-spacing-3);
4316  }
4317
4318  .token-display wui-text {
4319    text-transform: none;
4320  }
4321
4322  wui-loading-spinner {
4323    padding: var(--apkt-spacing-2);
4324  }
4325
4326  .left-image-container {
4327    position: relative;
4328    justify-content: center;
4329    align-items: center;
4330  }
4331
4332  .token-image {
4333    border-radius: ${({borderRadius:e})=>e.round};
4334    width: 40px;
4335    height: 40px;
4336  }
4337
4338  .chain-image {
4339    position: absolute;
4340    width: 20px;
4341    height: 20px;
4342    bottom: -3px;
4343    right: -5px;
4344    border-radius: ${({borderRadius:e})=>e.round};
4345    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
4346  }
4347
4348  .payment-methods-container {
4349    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4350    border-top-right-radius: ${({borderRadius:e})=>e[8]};
4351    border-top-left-radius: ${({borderRadius:e})=>e[8]};
4352  }
4353`});var vm,xd,U4e=h(()=>{le();Ue();Pr();st();He();g5();Mr();mf();yz();r4e();G7();fz();O5();O5();u4e();xz();Mn();w5();Ef();M5();Ez();D4e();vm=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},xd=class extends ne{constructor(){super(),this.unsubscribe=[],this.amount=Se.state.amount,this.namespace=void 0,this.paymentAsset=Se.state.paymentAsset,this.activeConnectorIds=X.state.activeConnectorIds,this.caipAddress=void 0,this.exchanges=Se.state.exchanges,this.isLoading=Se.state.isLoading,this.initializeNamespace(),this.unsubscribe.push(Se.subscribeKey("amount",t=>this.amount=t)),this.unsubscribe.push(X.subscribeKey("activeConnectorIds",t=>this.activeConnectorIds=t)),this.unsubscribe.push(Se.subscribeKey("exchanges",t=>this.exchanges=t)),this.unsubscribe.push(Se.subscribeKey("isLoading",t=>this.isLoading=t)),Se.fetchExchanges(),Se.setSelectedExchange(void 0)}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){return $`
4354      <wui-flex flexDirection="column">
4355        ${this.paymentDetailsTemplate()} ${this.paymentMethodsTemplate()}
4356      </wui-flex>
4357    `}paymentMethodsTemplate(){return $`
4358      <wui-flex flexDirection="column" padding="3" gap="2" class="payment-methods-container">
4359        ${this.payWithWalletTemplate()} ${this.templateSeparator()}
4360        ${this.templateExchangeOptions()}
4361      </wui-flex>
4362    `}initializeNamespace(){let t=k.state.activeChain;this.namespace=t,this.caipAddress=k.getAccountData(t)?.caipAddress,this.unsubscribe.push(k.subscribeChainProp("accountState",r=>{this.caipAddress=r?.caipAddress},t))}paymentDetailsTemplate(){let r=k.getAllRequestedCaipNetworks().find(n=>n.caipNetworkId===this.paymentAsset.network);return $`
4363      <wui-flex
4364        alignItems="center"
4365        justifyContent="space-between"
4366        .padding=${["6","8","6","8"]}
4367        gap="2"
4368      >
4369        <wui-flex alignItems="center" gap="1">
4370          <wui-text variant="h1-regular" color="primary">
4371            ${w2(this.amount||"0")}
4372          </wui-text>
4373
4374          <wui-flex flexDirection="column">
4375            <wui-text variant="h6-regular" color="secondary">
4376              ${this.paymentAsset.metadata.symbol||"Unknown"}
4377            </wui-text>
4378            <wui-text variant="md-medium" color="secondary"
4379              >on ${r?.name||"Unknown"}</wui-text
4380            >
4381          </wui-flex>
4382        </wui-flex>
4383
4384        <wui-flex class="left-image-container">
4385          <wui-image
4386            src=${ve(this.paymentAsset.metadata.logoURI)}
4387            class="token-image"
4388          ></wui-image>
4389          <wui-image
4390            src=${ve(vt.getNetworkImage(r))}
4391            class="chain-image"
4392          ></wui-image>
4393        </wui-flex>
4394      </wui-flex>
4395    `}payWithWalletTemplate(){return P4e(this.paymentAsset.network)?this.caipAddress?this.connectedWalletTemplate():this.disconnectedWalletTemplate():$``}connectedWalletTemplate(){let{name:t,image:r}=this.getWalletProperties({namespace:this.namespace});return $`
4396      <wui-flex flexDirection="column" gap="3">
4397        <wui-list-item
4398          type="secondary"
4399          boxColor="foregroundSecondary"
4400          @click=${this.onWalletPayment}
4401          .boxed=${!1}
4402          ?chevron=${!0}
4403          ?fullSize=${!1}
4404          ?rounded=${!0}
4405          data-testid="wallet-payment-option"
4406          imageSrc=${ve(r)}
4407          imageSize="3xl"
4408        >
4409          <wui-text variant="lg-regular" color="primary">Pay with ${t}</wui-text>
4410        </wui-list-item>
4411
4412        <wui-list-item
4413          type="secondary"
4414          icon="power"
4415          iconColor="error"
4416          @click=${this.onDisconnect}
4417          data-testid="disconnect-button"
4418          ?chevron=${!1}
4419          boxColor="foregroundSecondary"
4420        >
4421          <wui-text variant="lg-regular" color="secondary">Disconnect</wui-text>
4422        </wui-list-item>
4423      </wui-flex>
4424    `}disconnectedWalletTemplate(){return $`<wui-list-item
4425      type="secondary"
4426      boxColor="foregroundSecondary"
4427      variant="icon"
4428      iconColor="default"
4429      iconVariant="overlay"
4430      icon="wallet"
4431      @click=${this.onWalletPayment}
4432      ?chevron=${!0}
4433      data-testid="wallet-payment-option"
4434    >
4435      <wui-text variant="lg-regular" color="primary">Pay with wallet</wui-text>
4436    </wui-list-item>`}templateExchangeOptions(){if(this.isLoading)return $`<wui-flex justifyContent="center" alignItems="center">
4437        <wui-loading-spinner size="md"></wui-loading-spinner>
4438      </wui-flex>`;let t=this.exchanges.filter(r=>O4e(this.paymentAsset)?r.id===vz:r.id!==vz);return t.length===0?$`<wui-flex justifyContent="center" alignItems="center">
4439        <wui-text variant="md-medium" color="primary">No exchanges available</wui-text>
4440      </wui-flex>`:t.map(r=>$`
4441        <wui-list-item
4442          type="secondary"
4443          boxColor="foregroundSecondary"
4444          @click=${()=>this.onExchangePayment(r)}
4445          data-testid="exchange-option-${r.id}"
4446          ?chevron=${!0}
4447          imageSrc=${ve(r.imageUrl)}
4448        >
4449          <wui-text flexGrow="1" variant="lg-regular" color="primary">
4450            Pay with ${r.name}
4451          </wui-text>
4452        </wui-list-item>
4453      `)}templateSeparator(){return $`<wui-separator text="or" bgColor="secondary"></wui-separator>`}async onWalletPayment(){if(!this.namespace)throw new Error("Namespace not found");this.caipAddress?Z.push("PayQuote"):(await X.connect(),await Oe.open({view:"PayQuote"}))}onExchangePayment(t){Se.setSelectedExchange(t),Z.push("PayQuote")}async onDisconnect(){try{await J.disconnect(),await Oe.open({view:"Pay"})}catch{console.error("Failed to disconnect"),Ze.showError("Failed to disconnect")}}getWalletProperties({namespace:t}){if(!t)return{name:void 0,image:void 0};let r=this.activeConnectorIds[t];if(!r)return{name:void 0,image:void 0};let n=X.getConnector({id:r,namespace:t});if(!n)return{name:void 0,image:void 0};let o=vt.getConnectorImage(n);return{name:n.name,image:o}}};xd.styles=k4e;vm([ie()],xd.prototype,"amount",void 0);vm([ie()],xd.prototype,"namespace",void 0);vm([ie()],xd.prototype,"paymentAsset",void 0);vm([ie()],xd.prototype,"activeConnectorIds",void 0);vm([ie()],xd.prototype,"caipAddress",void 0);vm([ie()],xd.prototype,"exchanges",void 0);vm([ie()],xd.prototype,"isLoading",void 0);xd=vm([te("w3m-pay-view")],xd)});var L4e,M4e=h(()=>{Tt();L4e=ce`
4454  :host {
4455    display: inline-flex;
4456    align-items: center;
4457    justify-content: center;
4458  }
4459
4460  .pulse-container {
4461    position: relative;
4462    width: var(--pulse-size);
4463    height: var(--pulse-size);
4464    display: flex;
4465    align-items: center;
4466    justify-content: center;
4467  }
4468
4469  .pulse-rings {
4470    position: absolute;
4471    inset: 0;
4472    pointer-events: none;
4473  }
4474
4475  .pulse-ring {
4476    position: absolute;
4477    inset: 0;
4478    border-radius: 50%;
4479    border: 2px solid var(--pulse-color);
4480    opacity: 0;
4481    animation: pulse var(--pulse-duration, 2s) ease-out infinite;
4482  }
4483
4484  .pulse-content {
4485    position: relative;
4486    z-index: 1;
4487    display: flex;
4488    align-items: center;
4489    justify-content: center;
4490  }
4491
4492  @keyframes pulse {
4493    0% {
4494      transform: scale(0.5);
4495      opacity: var(--pulse-opacity, 0.3);
4496    }
4497    50% {
4498      opacity: calc(var(--pulse-opacity, 0.3) * 0.5);
4499    }
4500    100% {
4501      transform: scale(1.2);
4502      opacity: 0;
4503    }
4504  }
4505`});var Y6,NYe,RYe,OYe,BYe,kYe,Em,H4e=h(()=>{le();Ue();Tt();kt();Pt();M4e();Y6=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},NYe=3,RYe=2,OYe=.3,BYe="200px",kYe={"accent-primary":Ut.tokens.core.backgroundAccentPrimary},Em=class extends ne{constructor(){super(...arguments),this.rings=NYe,this.duration=RYe,this.opacity=OYe,this.size=BYe,this.variant="accent-primary"}render(){let t=kYe[this.variant];this.style.cssText=`
4506      --pulse-size: ${this.size};
4507      --pulse-duration: ${this.duration}s;
4508      --pulse-color: ${t};
4509      --pulse-opacity: ${this.opacity};
4510    `;let r=Array.from({length:this.rings},(n,o)=>this.renderRing(o,this.rings));return $`
4511      <div class="pulse-container">
4512        <div class="pulse-rings">${r}</div>
4513        <div class="pulse-content">
4514          <slot></slot>
4515        </div>
4516      </div>
4517    `}renderRing(t,r){let o=`animation-delay: ${t/r*this.duration}s;`;return $`<div class="pulse-ring" style=${o}></div>`}};Em.styles=[ke,L4e];Y6([V({type:Number})],Em.prototype,"rings",void 0);Y6([V({type:Number})],Em.prototype,"duration",void 0);Y6([V({type:Number})],Em.prototype,"opacity",void 0);Y6([V()],Em.prototype,"size",void 0);Y6([V()],Em.prototype,"variant",void 0);Em=Y6([te("wui-pulse")],Em)});var $4e=h(()=>{H4e()});var Nz,Rz,F4e=h(()=>{Nz=[{id:"received",title:"Receiving funds",icon:"dollar"},{id:"processing",title:"Swapping asset",icon:"recycleHorizontal"},{id:"sending",title:"Sending asset to the recipient address",icon:"send"}],Rz=["success","submitted","failure","timeout","refund"]});var V4e,z4e=h(()=>{He();V4e=ce`
4518  :host {
4519    display: block;
4520    height: 100%;
4521    width: 100%;
4522  }
4523
4524  wui-image {
4525    border-radius: ${({borderRadius:e})=>e.round};
4526  }
4527
4528  .token-badge-container {
4529    position: absolute;
4530    bottom: 6px;
4531    left: 50%;
4532    transform: translateX(-50%);
4533    border-radius: ${({borderRadius:e})=>e[4]};
4534    z-index: 3;
4535    min-width: 105px;
4536  }
4537
4538  .token-badge-container.loading {
4539    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4540    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
4541  }
4542
4543  .token-badge-container.success {
4544    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
4545    border: 3px solid ${({tokens:e})=>e.theme.backgroundPrimary};
4546  }
4547
4548  .token-image-container {
4549    position: relative;
4550  }
4551
4552  .token-image {
4553    border-radius: ${({borderRadius:e})=>e.round};
4554    width: 64px;
4555    height: 64px;
4556  }
4557
4558  .token-image.success {
4559    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4560  }
4561
4562  .token-image.error {
4563    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4564  }
4565
4566  .token-image.loading {
4567    background: ${({colors:e})=>e.accent010};
4568  }
4569
4570  .token-image wui-icon {
4571    width: 32px;
4572    height: 32px;
4573  }
4574
4575  .token-badge {
4576    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4577    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
4578    border-radius: ${({borderRadius:e})=>e[4]};
4579  }
4580
4581  .token-badge wui-text {
4582    white-space: nowrap;
4583  }
4584
4585  .payment-lifecycle-container {
4586    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4587    border-top-right-radius: ${({borderRadius:e})=>e[6]};
4588    border-top-left-radius: ${({borderRadius:e})=>e[6]};
4589  }
4590
4591  .payment-step-badge {
4592    padding: ${({spacing:e})=>e[1]} ${({spacing:e})=>e[2]};
4593    border-radius: ${({borderRadius:e})=>e[1]};
4594  }
4595
4596  .payment-step-badge.loading {
4597    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4598  }
4599
4600  .payment-step-badge.error {
4601    background-color: ${({tokens:e})=>e.core.backgroundError};
4602  }
4603
4604  .payment-step-badge.success {
4605    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
4606  }
4607
4608  .step-icon-container {
4609    position: relative;
4610    height: 40px;
4611    width: 40px;
4612    border-radius: ${({borderRadius:e})=>e.round};
4613    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4614  }
4615
4616  .step-icon-box {
4617    position: absolute;
4618    right: -4px;
4619    bottom: -1px;
4620    padding: 2px;
4621    border-radius: ${({borderRadius:e})=>e.round};
4622    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
4623    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4624  }
4625
4626  .step-icon-box.success {
4627    background-color: ${({tokens:e})=>e.core.backgroundSuccess};
4628  }
4629`});var vd,DYe,UYe,mc,j4e=h(()=>{le();Ue();y7();Pr();it();st();He();Mr();G7();O5();$4e();xz();Mn();ul();Ef();M5();F4e();z4e();vd=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},DYe={received:["pending","success","submitted"],processing:["success","submitted"],sending:["success","submitted"]},UYe=3e3,mc=class extends ne{constructor(){super(),this.unsubscribe=[],this.pollingInterval=null,this.paymentAsset=Se.state.paymentAsset,this.quoteStatus=Se.state.quoteStatus,this.quote=Se.state.quote,this.amount=Se.state.amount,this.namespace=void 0,this.caipAddress=void 0,this.profileName=null,this.activeConnectorIds=X.state.activeConnectorIds,this.selectedExchange=Se.state.selectedExchange,this.initializeNamespace(),this.unsubscribe.push(Se.subscribeKey("quoteStatus",t=>this.quoteStatus=t),Se.subscribeKey("quote",t=>this.quote=t),X.subscribeKey("activeConnectorIds",t=>this.activeConnectorIds=t),Se.subscribeKey("selectedExchange",t=>this.selectedExchange=t))}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling(),this.unsubscribe.forEach(t=>t())}render(){return $`
4630      <wui-flex flexDirection="column" .padding=${["3","0","0","0"]} gap="2">
4631        ${this.tokenTemplate()} ${this.paymentTemplate()} ${this.paymentLifecycleTemplate()}
4632      </wui-flex>
4633    `}tokenTemplate(){let t=w2(this.amount||"0"),r=this.paymentAsset.metadata.symbol??"Unknown",o=k.getAllRequestedCaipNetworks().find(a=>a.caipNetworkId===this.paymentAsset.network),s=this.quoteStatus==="failure"||this.quoteStatus==="timeout"||this.quoteStatus==="refund";return this.quoteStatus==="success"||this.quoteStatus==="submitted"?$`<wui-flex alignItems="center" justifyContent="center">
4634        <wui-flex justifyContent="center" alignItems="center" class="token-image success">
4635          <wui-icon name="checkmark" color="success" size="inherit"></wui-icon>
4636        </wui-flex>
4637      </wui-flex>`:s?$`<wui-flex alignItems="center" justifyContent="center">
4638        <wui-flex justifyContent="center" alignItems="center" class="token-image error">
4639          <wui-icon name="close" color="error" size="inherit"></wui-icon>
4640        </wui-flex>
4641      </wui-flex>`:$`
4642      <wui-flex alignItems="center" justifyContent="center">
4643        <wui-flex class="token-image-container">
4644          <wui-pulse size="125px" rings="3" duration="4" opacity="0.5" variant="accent-primary">
4645            <wui-flex justifyContent="center" alignItems="center" class="token-image loading">
4646              <wui-icon name="paperPlaneTitle" color="accent-primary" size="inherit"></wui-icon>
4647            </wui-flex>
4648          </wui-pulse>
4649
4650          <wui-flex
4651            justifyContent="center"
4652            alignItems="center"
4653            class="token-badge-container loading"
4654          >
4655            <wui-flex
4656              alignItems="center"
4657              justifyContent="center"
4658              gap="01"
4659              padding="1"
4660              class="token-badge"
4661            >
4662              <wui-image
4663                src=${ve(vt.getNetworkImage(o))}
4664                class="chain-image"
4665                size="mdl"
4666              ></wui-image>
4667
4668              <wui-text variant="lg-regular" color="primary">${t} ${r}</wui-text>
4669            </wui-flex>
4670          </wui-flex>
4671        </wui-flex>
4672      </wui-flex>
4673    `}paymentTemplate(){return $`
4674      <wui-flex flexDirection="column" gap="2" .padding=${["0","6","0","6"]}>
4675        ${this.renderPayment()}
4676        <wui-separator></wui-separator>
4677        ${this.renderWallet()}
4678      </wui-flex>
4679    `}paymentLifecycleTemplate(){let t=this.getStepsWithStatus();return $`
4680      <wui-flex flexDirection="column" padding="4" gap="2" class="payment-lifecycle-container">
4681        <wui-flex alignItems="center" justifyContent="space-between">
4682          <wui-text variant="md-regular" color="secondary">PAYMENT CYCLE</wui-text>
4683
4684          ${this.renderPaymentCycleBadge()}
4685        </wui-flex>
4686
4687        <wui-flex flexDirection="column" gap="5" .padding=${["2","0","2","0"]}>
4688          ${t.map(r=>this.renderStep(r))}
4689        </wui-flex>
4690      </wui-flex>
4691    `}renderPaymentCycleBadge(){let t=this.quoteStatus==="failure"||this.quoteStatus==="timeout"||this.quoteStatus==="refund",r=this.quoteStatus==="success"||this.quoteStatus==="submitted";if(t)return $`
4692        <wui-flex
4693          justifyContent="center"
4694          alignItems="center"
4695          class="payment-step-badge error"
4696          gap="1"
4697        >
4698          <wui-icon name="close" color="error" size="xs"></wui-icon>
4699          <wui-text variant="sm-regular" color="error">Failed</wui-text>
4700        </wui-flex>
4701      `;if(r)return $`
4702        <wui-flex
4703          justifyContent="center"
4704          alignItems="center"
4705          class="payment-step-badge success"
4706          gap="1"
4707        >
4708          <wui-icon name="checkmark" color="success" size="xs"></wui-icon>
4709          <wui-text variant="sm-regular" color="success">Completed</wui-text>
4710        </wui-flex>
4711      `;let n=this.quote?.timeInSeconds??0;return $`
4712      <wui-flex alignItems="center" justifyContent="space-between" gap="3">
4713        <wui-flex
4714          justifyContent="center"
4715          alignItems="center"
4716          class="payment-step-badge loading"
4717          gap="1"
4718        >
4719          <wui-icon name="clock" color="default" size="xs"></wui-icon>
4720          <wui-text variant="sm-regular" color="primary">Est. ${n} sec</wui-text>
4721        </wui-flex>
4722
4723        <wui-icon name="chevronBottom" color="default" size="xxs"></wui-icon>
4724      </wui-flex>
4725    `}renderPayment(){let r=k.getAllRequestedCaipNetworks().find(i=>{let a=this.quote?.origin.currency.network;if(!a)return!1;let{chainId:c}=Qe.parseCaipNetworkId(a);return Qr.isLowerCaseMatch(i.id.toString(),c.toString())}),n=dt.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString(),o=w2(n),s=this.quote?.origin.currency.metadata.symbol??"Unknown";return $`
4726      <wui-flex
4727        alignItems="flex-start"
4728        justifyContent="space-between"
4729        .padding=${["3","0","3","0"]}
4730      >
4731        <wui-text variant="lg-regular" color="secondary">Payment Method</wui-text>
4732
4733        <wui-flex flexDirection="column" alignItems="flex-end" gap="1">
4734          <wui-flex alignItems="center" gap="01">
4735            <wui-text variant="lg-regular" color="primary">${o}</wui-text>
4736            <wui-text variant="lg-regular" color="secondary">${s}</wui-text>
4737          </wui-flex>
4738
4739          <wui-flex alignItems="center" gap="1">
4740            <wui-text variant="md-regular" color="secondary">on</wui-text>
4741            <wui-image
4742              src=${ve(vt.getNetworkImage(r))}
4743              size="xs"
4744            ></wui-image>
4745            <wui-text variant="md-regular" color="secondary">${r?.name}</wui-text>
4746          </wui-flex>
4747        </wui-flex>
4748      </wui-flex>
4749    `}renderWallet(){return $`
4750      <wui-flex
4751        alignItems="flex-start"
4752        justifyContent="space-between"
4753        .padding=${["3","0","3","0"]}
4754      >
4755        <wui-text variant="lg-regular" color="secondary"
4756          >${this.selectedExchange?"Exchange":"Wallet"}</wui-text
4757        >
4758
4759        ${this.renderWalletText()}
4760      </wui-flex>
4761    `}renderWalletText(){let{image:t}=this.getWalletProperties({namespace:this.namespace}),{address:r}=this.caipAddress?Qe.parseCaipAddress(this.caipAddress):{},n=this.selectedExchange?.name;return this.selectedExchange?$`
4762        <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
4763          <wui-text variant="lg-regular" color="primary">${n}</wui-text>
4764          <wui-image src=${ve(this.selectedExchange.imageUrl)} size="mdl"></wui-image>
4765        </wui-flex>
4766      `:$`
4767      <wui-flex alignItems="center" justifyContent="flex-end" gap="1">
4768        <wui-text variant="lg-regular" color="primary">
4769          ${pr.getTruncateString({string:this.profileName||r||n||"",charsStart:this.profileName?16:4,charsEnd:this.profileName?0:6,truncate:this.profileName?"end":"middle"})}
4770        </wui-text>
4771
4772        <wui-image src=${ve(t)} size="mdl"></wui-image>
4773      </wui-flex>
4774    `}getStepsWithStatus(){return this.quoteStatus==="failure"||this.quoteStatus==="timeout"||this.quoteStatus==="refund"?Nz.map(r=>({...r,status:"failed"})):Nz.map(r=>{let o=(DYe[r.id]??[]).includes(this.quoteStatus)?"completed":"pending";return{...r,status:o}})}renderStep({title:t,icon:r,status:n}){return $`
4775      <wui-flex alignItems="center" gap="3">
4776        <wui-flex justifyContent="center" alignItems="center" class="step-icon-container">
4777          <wui-icon name=${r} color="default" size="mdl"></wui-icon>
4778
4779          <wui-flex alignItems="center" justifyContent="center" class=${N6({"step-icon-box":!0,success:n==="completed"})}>
4780            ${this.renderStatusIndicator(n)}
4781          </wui-flex>
4782        </wui-flex>
4783
4784        <wui-text variant="md-regular" color="primary">${t}</wui-text>
4785      </wui-flex>
4786    `}renderStatusIndicator(t){return t==="completed"?$`<wui-icon size="sm" color="success" name="checkmark"></wui-icon>`:t==="failed"?$`<wui-icon size="sm" color="error" name="close"></wui-icon>`:t==="pending"?$`<wui-loading-spinner color="accent-primary" size=
4786"sm"></wui-loading-spinner>`:null}startPolling(){this.pollingInterval||(this.fetchQuoteStatus(),this.pollingInterval=setInterval(()=>{this.fetchQuoteStatus()},UYe))}stopPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null)}async fetchQuoteStatus(){let t=Se.state.requestId;if(!t||Rz.includes(this.quoteStatus))this.stopPolling();else try{await Se.fetchQuoteStatus({requestId:t}),Rz.includes(this.quoteStatus)&&this.stopPolling()}catch{this.stopPolling()}}initializeNamespace(){let t=k.state.activeChain;this.namespace=t,this.caipAddress=k.getAccountData(t)?.caipAddress,this.profileName=k.getAccountData(t)?.profileName??null,this.unsubscribe.push(k.subscribeChainProp("accountState",r=>{this.caipAddress=r?.caipAddress,this.profileName=r?.profileName??null},t))}getWalletProperties({namespace:t}){if(!t)return{name:void 0,image:void 0};let r=this.activeConnectorIds[t];if(!r)return{name:void 0,image:void 0};let n=X.getConnector({id:r,namespace:t});if(!n)return{name:void 0,image:void 0};let o=vt.getConnectorImage(n);return{name:n.name,image:o}}};mc.styles=V4e;vd([ie()],mc.prototype,"paymentAsset",void 0);vd([ie()],mc.prototype,"quoteStatus",void 0);vd([ie()],mc.prototype,"quote",void 0);vd([ie()],mc.prototype,"amount",void 0);vd([ie()],mc.prototype,"namespace",void 0);vd([ie()],mc.prototype,"caipAddress",void 0);vd([ie()],mc.prototype,"profileName",void 0);vd([ie()],mc.prototype,"activeConnectorIds",void 0);vd([ie()],mc.prototype,"selectedExchange",void 0);mc=vd([te("w3m-pay-loading-view")],mc)});var q4e,W4e=h(()=>{Tt();q4e=ce`
4787  button {
4788    display: flex;
4789    align-items: center;
4790    height: 40px;
4791    padding: ${({spacing:e})=>e[2]};
4792    border-radius: ${({borderRadius:e})=>e[4]};
4793    column-gap: ${({spacing:e})=>e[1]};
4794    background-color: transparent;
4795    transition: background-color ${({durations:e})=>e.lg}
4796      ${({easings:e})=>e["ease-out-power-2"]};
4797    will-change: background-color;
4798  }
4799
4800  wui-image,
4801  .icon-box {
4802    width: ${({spacing:e})=>e[6]};
4803    height: ${({spacing:e})=>e[6]};
4804    border-radius: ${({borderRadius:e})=>e[4]};
4805  }
4806
4807  wui-text {
4808    flex: 1;
4809  }
4810
4811  .icon-box {
4812    position: relative;
4813  }
4814
4815  .icon-box[data-active='true'] {
4816    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
4817  }
4818
4819  .circle {
4820    position: absolute;
4821    left: 16px;
4822    top: 15px;
4823    width: 8px;
4824    height: 8px;
4825    background-color: ${({tokens:e})=>e.core.textSuccess};
4826    box-shadow: 0 0 0 2px ${({tokens:e})=>e.theme.foregroundPrimary};
4827    border-radius: 50%;
4828  }
4829
4830  /* -- Hover & Active states ----------------------------------------------------------- */
4831  @media (hover: hover) {
4832    button:hover:enabled,
4833    button:active:enabled {
4834      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
4835    }
4836  }
4837`});var pl,Sa,K4e=h(()=>{le();Ue();Pr();Jn();t2();xs();Zg();kt();A6();Pt();W4e();pl=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Sa=class extends ne{constructor(){super(...arguments),this.address="",this.profileName="",this.alt="",this.imageSrc="",this.icon=void 0,this.iconSize="md",this.enableGreenCircle=!0,this.loading=!1,this.charsStart=4,this.charsEnd=6}render(){return $`
4838      <button>
4839        ${this.leftImageTemplate()} ${this.textTemplate()} ${this.rightImageTemplate()}
4840      </button>
4841    `}leftImageTemplate(){let t=this.icon?$`<wui-icon
4842          size=${ve(this.iconSize)}
4843          color="default"
4844          name=${this.icon}
4845          class="icon"
4846        ></wui-icon>`:$`<wui-image src=${this.imageSrc} alt=${this.alt}></wui-image>`;return $`
4847      <wui-flex
4848        alignItems="center"
4849        justifyContent="center"
4850        class="icon-box"
4851        data-active=${!!this.icon}
4852      >
4853        ${t}
4854        ${this.enableGreenCircle?$`<wui-flex class="circle"></wui-flex>`:null}
4855      </wui-flex>
4856    `}textTemplate(){return $`
4857      <wui-text variant="lg-regular" color="primary">
4858        ${pr.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?16:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"})}
4859      </wui-text>
4860    `}rightImageTemplate(){return $`<wui-icon name="chevronBottom" size="sm" color="default"></wui-icon>`}};Sa.styles=[ke,Zt,q4e];pl([V()],Sa.prototype,"address",void 0);pl([V()],Sa.prototype,"profileName",void 0);pl([V()],Sa.prototype,"alt",void 0);pl([V()],Sa.prototype,"imageSrc",void 0);pl([V()],Sa.prototype,"icon",void 0);pl([V()],Sa.prototype,"iconSize",void 0);pl([V({type:Boolean})],Sa.prototype,"enableGreenCircle",void 0);pl([V({type:Boolean})],Sa.prototype,"loading",void 0);pl([V({type:Number})],Sa.prototype,"charsStart",void 0);pl([V({type:Number})],Sa.prototype,"charsEnd",void 0);Sa=pl([te("wui-wallet-switch")],Sa)});var Z4e=h(()=>{K4e()});var G4e,Y4e=h(()=>{le();G4e=yr`
4861  :host {
4862    display: block;
4863  }
4864`});var LYe,Oz,J4e=h(()=>{le();He();Mr();_5();Mn();Y4e();LYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Oz=class extends ne{render(){return $`
4865      <wui-flex flexDirection="column" gap="4">
4866        <wui-flex alignItems="center" justifyContent="space-between">
4867          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
4868          <wui-shimmer width="60px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
4869        </wui-flex>
4870
4871        <wui-flex alignItems="center" justifyContent="space-between">
4872          <wui-text variant="md-regular" color="secondary">Network Fee</wui-text>
4873
4874          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
4875            <wui-shimmer
4876              width="75px"
4877              height="16px"
4878              borderRadius="4xs"
4879              variant="light"
4880            ></wui-shimmer>
4881
4882            <wui-flex alignItems="center" gap="01">
4883              <wui-shimmer width="14px" height="14px" rounded variant="light"></wui-shimmer>
4884              <wui-shimmer
4885                width="49px"
4886                height="14px"
4887                borderRadius="4xs"
4888                variant="light"
4889              ></wui-shimmer>
4890            </wui-flex>
4891          </wui-flex>
4892        </wui-flex>
4893
4894        <wui-flex alignItems="center" justifyContent="space-between">
4895          <wui-text variant="md-regular" color="secondary">Service Fee</wui-text>
4896          <wui-shimmer width="75px" height="16px" borderRadius="4xs" variant="light"></wui-shimmer>
4897        </wui-flex>
4898      </wui-flex>
4899    `}};Oz.styles=[G4e];Oz=LYe([te("w3m-pay-fees-skeleton")],Oz)});var Q4e,X4e=h(()=>{He();Q4e=ce`
4900  :host {
4901    display: block;
4902  }
4903
4904  wui-image {
4905    border-radius: ${({borderRadius:e})=>e.round};
4906  }
4907`});var e3e,eP,t3e=h(()=>{le();Ue();Pr();it();st();He();Mr();G7();Mn();ul();Ef();X4e();e3e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},eP=class extends ne{constructor(){super(),this.unsubscribe=[],this.quote=Se.state.quote,this.unsubscribe.push(Se.subscribeKey("quote",t=>this.quote=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=dt.formatNumber(this.quote?.origin.amount||"0",{decimals:this.quote?.origin.currency.metadata.decimals??0,round:6}).toString();return $`
4908      <wui-flex flexDirection="column" gap="4">
4909        <wui-flex alignItems="center" justifyContent="space-between">
4910          <wui-text variant="md-regular" color="secondary">Pay</wui-text>
4911          <wui-text variant="md-regular" color="primary">
4912            ${t} ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
4913          </wui-text>
4914        </wui-flex>
4915
4916        ${this.quote&&this.quote.fees.length>0?this.quote.fees.map(r=>this.renderFee(r)):null}
4917      </wui-flex>
4918    `}renderFee(t){let r=t.id==="network",n=dt.formatNumber(t.amount||"0",{decimals:t.currency.metadata.decimals??0,round:6}).toString();if(r){let s=k.getAllRequestedCaipNetworks().find(i=>Qr.isLowerCaseMatch(i.caipNetworkId,t.currency.network));return $`
4919        <wui-flex alignItems="center" justifyContent="space-between">
4920          <wui-text variant="md-regular" color="secondary">${t.label}</wui-text>
4921
4922          <wui-flex flexDirection="column" alignItems="flex-end" gap="2">
4923            <wui-text variant="md-regular" color="primary">
4924              ${n} ${t.currency.metadata.symbol||"Unknown"}
4925            </wui-text>
4926
4927            <wui-flex alignItems="center" gap="01">
4928              <wui-image
4929                src=${ve(vt.getNetworkImage(s))}
4930                size="xs"
4931              ></wui-image>
4932              <wui-text variant="sm-regular" color="secondary">
4933                ${s?.name||"Unknown"}
4934              </wui-text>
4935            </wui-flex>
4936          </wui-flex>
4937        </wui-flex>
4938      `}return $`
4939      <wui-flex alignItems="center" justifyContent="space-between">
4940        <wui-text variant="md-regular" color="secondary">${t.label}</wui-text>
4941        <wui-text variant="md-regular" color="primary">
4942          ${n} ${t.currency.metadata.symbol||"Unknown"}
4943        </wui-text>
4944      </wui-flex>
4945    `}};eP.styles=[Q4e];e3e([ie()],eP.prototype,"quote",void 0);eP=e3e([te("w3m-pay-fees")],eP)}
4945);var r3e,n3e=h(()=>{He();r3e=ce`
4946  :host {
4947    display: block;
4948    width: 100%;
4949  }
4950
4951  .disabled-container {
4952    padding: ${({spacing:e})=>e[2]};
4953    min-height: 168px;
4954  }
4955
4956  wui-icon {
4957    width: ${({spacing:e})=>e[8]};
4958    height: ${({spacing:e})=>e[8]};
4959  }
4960
4961  wui-flex > wui-text {
4962    max-width: 273px;
4963  }
4964`});var o3e,tP,s3e=h(()=>{le();Ue();He();g5();Mr();mf();Mn();Ef();n3e();o3e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},tP=class extends ne{constructor(){super(),this.unsubscribe=[],this.selectedExchange=Se.state.selectedExchange,this.unsubscribe.push(Se.subscribeKey("selectedExchange",t=>this.selectedExchange=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=!!this.selectedExchange;return $`
4965      <wui-flex
4966        flexDirection="column"
4967        alignItems="center"
4968        justifyContent="center"
4969        gap="3"
4970        class="disabled-container"
4971      >
4972        <wui-icon name="coins" color="default" size="inherit"></wui-icon>
4973
4974        <wui-text variant="md-regular" color="primary" align="center">
4975          You don't have enough funds to complete this transaction
4976        </wui-text>
4977
4978        ${t?null:$`<wui-button
4979              size="md"
4980              variant="neutral-secondary"
4981              @click=${this.dispatchConnectOtherWalletEvent.bind(this)}
4982              >Connect other wallet</wui-button
4983            >`}
4984      </wui-flex>
4985    `}dispatchConnectOtherWalletEvent(){this.dispatchEvent(new CustomEvent("connectOtherWallet",{detail:!0,bubbles:!0,composed:!0}))}};tP.styles=[r3e];o3e([V({type:Array})],tP.prototype,"selectedExchange",void 0);tP=o3e([te("w3m-pay-options-empty")],tP)});var i3e,a3e=h(()=>{He();i3e=ce`
4986  :host {
4987    display: block;
4988    width: 100%;
4989  }
4990
4991  .pay-options-container {
4992    max-height: 196px;
4993    overflow-y: auto;
4994    overflow-x: hidden;
4995    scrollbar-width: none;
4996  }
4997
4998  .pay-options-container::-webkit-scrollbar {
4999    display: none;
5000  }
5001
5002  .pay-option-container {
5003    border-radius: ${({borderRadius:e})=>e[4]};
5004    padding: ${({spacing:e})=>e[3]};
5005    min-height: 60px;
5006  }
5007
5008  .token-images-container {
5009    position: relative;
5010    justify-content: center;
5011    align-items: center;
5012  }
5013
5014  .chain-image {
5015    position: absolute;
5016    bottom: -3px;
5017    right: -5px;
5018    border: 2px solid ${({tokens:e})=>e.theme.foregroundSecondary};
5019  }
5020`});var MYe,Bz,c3e=h(()=>{le();He();Mr();_5();a3e();MYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Bz=class extends ne{render(){return $`
5021      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
5022        ${this.renderOptionEntry()} ${this.renderOptionEntry()} ${this.renderOptionEntry()}
5023      </wui-flex>
5024    `}renderOptionEntry(){return $`
5025      <wui-flex
5026        alignItems="center"
5027        justifyContent="space-between"
5028        gap="2"
5029        class="pay-option-container"
5030      >
5031        <wui-flex alignItems="center" gap="2">
5032          <wui-flex class="token-images-container">
5033            <wui-shimmer
5034              width="32px"
5035              height="32px"
5036              rounded
5037              variant="light"
5038              class="token-image"
5039            ></wui-shimmer>
5040            <wui-shimmer
5041              width="16px"
5042              height="16px"
5043              rounded
5044              variant="light"
5045              class="chain-image"
5046            ></wui-shimmer>
5047          </wui-flex>
5048
5049          <wui-flex flexDirection="column" gap="1">
5050            <wui-shimmer
5051              width="74px"
5052              height="16px"
5053              borderRadius="4xs"
5054              variant="light"
5055            ></wui-shimmer>
5056            <wui-shimmer
5057              width="46px"
5058              height="14px"
5059              borderRadius="4xs"
5060              variant="light"
5061            ></wui-shimmer>
5062          </wui-flex>
5063        </wui-flex>
5064      </wui-flex>
5065    `}};Bz.styles=[i3e];Bz=MYe([te("w3m-pay-options-skeleton")],Bz)});var l3e,u3e=h(()=>{He();l3e=ce`
5066  :host {
5067    display: block;
5068    width: 100%;
5069  }
5070
5071  .pay-options-container {
5072    max-height: 196px;
5073    overflow-y: auto;
5074    overflow-x: hidden;
5075    scrollbar-width: none;
5076    mask-image: var(--options-mask-image);
5077    -webkit-mask-image: var(--options-mask-image);
5078  }
5079
5080  .pay-options-container::-webkit-scrollbar {
5081    display: none;
5082  }
5083
5084  .pay-option-container {
5085    cursor: pointer;
5086    border-radius: ${({borderRadius:e})=>e[4]};
5087    padding: ${({spacing:e})=>e[3]};
5088    transition: background-color ${({durations:e})=>e.lg}
5089      ${({easings:e})=>e["ease-out-power-1"]};
5090    will-change: background-color;
5091  }
5092
5093  .token-images-container {
5094    position: relative;
5095    justify-content: center;
5096    align-items: center;
5097  }
5098
5099  .token-image {
5100    border-radius: ${({borderRadius:e})=>e.round};
5101    width: 32px;
5102    height: 32px;
5103  }
5104
5105  .chain-image {
5106    position: absolute;
5107    width: 16px;
5108    height: 16px;
5109    bottom: -3px;
5110    right: -5px;
5111    border-radius: ${({borderRadius:e})=>e.round};
5112    border: 2px solid ${({tokens:e})=>e.theme.backgroundPrimary};
5113  }
5114
5115  @media (hover: hover) and (pointer: fine) {
5116    .pay-option-container:hover {
5117      background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5118    }
5119  }
5120`});var rP,HYe,J6,d3e=h(()=>{le();Ue();Pr();it();st();He();Mr();Mn();u3e();rP=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},HYe=300,J6=class extends ne{constructor(){super(),this.unsubscribe=[],this.options=[],this.selectedPaymentAsset=null}disconnectedCallback(){this.unsubscribe.forEach(r=>r()),this.resizeObserver?.disconnect(),this.shadowRoot?.querySelector(".pay-options-container")?.removeEventListener("scroll",this.handleOptionsListScroll.bind(this))}firstUpdated(){let t=this.shadowRoot?.querySelector(".pay-options-container");t&&(requestAnimationFrame(this.handleOptionsListScroll.bind(this)),t?.addEventListener("scroll",this.handleOptionsListScroll.bind(this)),this.resizeObserver=new ResizeObserver(()=>{this.handleOptionsListScroll()}),this.resizeObserver?.observe(t),this.handleOptionsListScroll())}render(){return $`
5121      <wui-flex flexDirection="column" gap="2" class="pay-options-container">
5122        ${this.options.map(t=>this.payOptionTemplate(t))}
5123      </wui-flex>
5124    `}payOptionTemplate(t){let{network:r,metadata:n,asset:o,amount:s="0"}=t,a=k.getAllRequestedCaipNetworks().find(f=>f.caipNetworkId===r),c=`${r}:${o}`,l=`${this.selectedPaymentAsset?.network}:${this.selectedPaymentAsset?.asset}`,u=c===l,d=dt.bigNumber(s,{safe:!0}),p=d.gt(0);return $`
5125      <wui-flex
5126        alignItems="center"
5127        justifyContent="space-between"
5128        gap="2"
5129        @click=${()=>this.onSelect?.(t)}
5130        class="pay-option-container"
5131      >
5132        <wui-flex alignItems="center" gap="2">
5133          <wui-flex class="token-images-container">
5134            <wui-image
5135              src=${ve(n.logoURI)}
5136              class="token-image"
5137              size="3xl"
5138            ></wui-image>
5139            <wui-image
5140              src=${ve(vt.getNetworkImage(a))}
5141              class="chain-image"
5142              size="md"
5143            ></wui-image>
5144          </wui-flex>
5145
5146          <wui-flex flexDirection="column" gap="1">
5147            <wui-text variant="lg-regular" color="primary">${n.symbol}</wui-text>
5148            ${p?$`<wui-text variant="sm-regular" color="secondary">
5149                  ${d.round(6).toString()} ${n.symbol}
5150                </wui-text>`:null}
5151          </wui-flex>
5152        </wui-flex>
5153
5154        ${u?$`<wui-icon name="checkmark" size="md" color="success"></wui-icon>`:null}
5155      </wui-flex>
5156    `}handleOptionsListScroll(){let t=this.shadowRoot?.querySelector(".pay-options-container");if(!t)return;t.scrollHeight>HYe?(t.style.setProperty("--options-mask-image",`linear-gradient(
5157          to bottom,
5158          rgba(0, 0, 0, calc(1 - var(--options-scroll--top-opacity))) 0px,
5159          rgba(200, 200, 200, calc(1 - var(--options-scroll--top-opacity))) 1px,
5160          black 50px,
5161          black calc(100% - 50px),
5162          rgba(155, 155, 155, calc(1 - var(--options-scroll--bottom-opacity))) calc(100% - 1px),
5163          rgba(0, 0, 0, calc(1 - var(--options-scroll--bottom-opacity))) 100%
5164        )`),t.style.setProperty("--options-scroll--top-opacity",q_.interpolate([0,50],[0,1],t.scrollTop).toString()),t.style.setProperty("--options-scroll--bottom-opacity",q_.interpolate([0,50],[0,1],t.scrollHeight-t.scrollTop-t.offsetHeight).toString())):(t.style.setProperty("--options-mask-image","none"),t.style.setProperty("--options-scroll--top-opacity","0"),t.style.setProperty("--options-scroll--bottom-opacity","0"))}};J6.styles=[l3e];rP([V({type:Array})],J6.prototype,"options",void 0);rP([V()],J6.prototype,"selectedPaymentAsset",void 0);rP([V()],J6.prototype,"onSelect",void 0);J6=rP([te("w3m-pay-options")],J6)});var p3e,f3e=h(()=>{He();p3e=ce`
5165  .payment-methods-container {
5166    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5167    border-top-right-radius: ${({borderRadius:e})=>e[5]};
5168    border-top-left-radius: ${({borderRadius:e})=>e[5]};
5169  }
5170
5171  .pay-options-container {
5172    background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5173    border-radius: ${({borderRadius:e})=>e[5]};
5174    padding: ${({spacing:e})=>e[1]};
5175  }
5176
5177  w3m-tooltip-trigger {
5178    display: flex;
5179    align-items: center;
5180    justify-content: center;
5181    max-width: fit-content;
5182  }
5183
5184  wui-image {
5185    border-radius: ${({borderRadius:e})=>e.round};
5186  }
5187
5188  w3m-pay-options.disabled {
5189    opacity: 0.5;
5190    pointer-events: none;
5191  }
5192`});var wo,nP,$Ye,$n,h3e=h(()=>{le();Ue();y7();Pr();it();st();He();Mr();Mn();Z4e();ul();Ef();J4e();t3e();s3e();c3e();d3e();M5();Q7();f3e();wo=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},nP={eip155:"ethereum",solana:"solana",bip122:"bitcoin",ton:"ton"},$Ye={eip155:{icon:nP.eip155,label:"EVM"},solana:{icon:nP.solana,label:"Solana"},bip122:{icon:nP.bip122,label:"Bitcoin"},ton:{icon:nP.ton,label:"Ton"}},$n=class extends ne{constructor(){super(),this.unsubscribe=[],this.profileName=null,this.paymentAsset=Se.state.paymentAsset,this.namespace=void 0,this.caipAddress=void 0,this.amount=Se.state.amount,this.recipient=Se.state.recipient,this.activeConnectorIds=X.state.activeConnectorIds,this.selectedPaymentAsset=Se.state.selectedPaymentAsset,this.selectedExchange=Se.state.selectedExchange,this.isFetchingQuote=Se.state.isFetchingQuote,this.quoteError=Se.state.quoteError,this.quote=Se.state.quote,this.isFetchingTokenBalances=Se.state.isFetchingTokenBalances,this.tokenBalances=Se.state.tokenBalances,this.isPaymentInProgress=Se.state.isPaymentInProgress,this.exchangeUrlForQuote=Se.state.exchangeUrlForQuote,this.completedTransactionsCount=0,this.unsubscribe.push(Se.subscribeKey("paymentAsset",t=>this.paymentAsset=t)),this.unsubscribe.push(Se.subscribeKey("tokenBalances",t=>this.onTokenBalancesChanged(t))),this.unsubscribe.push(Se.subscribeKey("isFetchingTokenBalances",t=>this.isFetchingTokenBalances=t)),this.unsubscribe.push(X.subscribeKey("activeConnectorIds",t=>this.activeConnectorIds=t)),this.unsubscribe.push(Se.subscribeKey("selectedPaymentAsset",t=>this.selectedPaymentAsset=t)),this.unsubscribe.push(Se.subscribeKey("isFetchingQuote",t=>this.isFetchingQuote=t)),this.unsubscribe.push(Se.subscribeKey("quoteError",t=>this.quoteError=t)),this.unsubscribe.push(Se.subscribeKey("quote",t=>this.quote=t)),this.unsubscribe.push(Se.subscribeKey("amount",t=>this.amount=t)),this.unsubscribe.push(Se.subscribeKey("recipient",t=>this.recipient=t)),this.unsubscribe.push(Se.subscribeKey("isPaymentInProgress",t=>this.isPaymentInProgress=t)),this.unsubscribe.push(Se.subscribeKey("selectedExchange",t=>this.selectedExchange=t)),this.unsubscribe.push(Se.subscribeKey("exchangeUrlForQuote",t=>this.exchangeUrlForQuote=t)),this.resetQuoteState(),this.initializeNamespace(),this.fetchTokens()}disconnectedCallback(){super.disconnectedCallback(),this.resetAssetsState(),this.unsubscribe.forEach(t=>t())}updated(t){super.updated(t),t.has("selectedPaymentAsset")&&this.fetchQuote()}render(){return $`
5193      <wui-flex flexDirection="column">
5194        ${this.profileTemplate()}
5195
5196        <wui-flex
5197          flexDirection="column"
5198          gap="4"
5199          class="payment-methods-container"
5200          .padding=${["4","4","5","4"]}
5201        >
5202          ${this.paymentOptionsViewTemplate()} ${this.amountWithFeeTemplate()}
5203
5204          <wui-flex
5205            alignItems="center"
5206            justifyContent="space-between"
5207            .padding=${["1","0","1","0"]}
5208          >
5209            <wui-separator></wui-separator>
5210          </wui-flex>
5211
5212          ${this.paymentActionsTemplate()}
5213        </wui-flex>
5214      </wui-flex>
5215    `}profileTemplate(){if(this.selectedExchange){let i=dt.formatNumber(this.quote?.origin.amount,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return $`
5216        <wui-flex
5217          .padding=${["4","3","4","3"]}
5218          alignItems="center"
5219          justifyContent="space-between"
5220          gap="2"
5221        >
5222          <wui-text variant="lg-regular" color="secondary">Paying with</wui-text>
5223
5224          ${this.quote?$`<wui-text variant="lg-regular" color="primary">
5225                ${dt.bigNumber(i,{safe:!0}).round(6).toString()}
5226                ${this.quote.origin.currency.metadata.symbol}
5227              </wui-text>`:$`<wui-shimmer width="80px" height="18px" variant="light"></wui-shimmer>`}
5228        </wui-flex>
5229      `}let t=ee.getPlainAddress(this.caipAddress)??"",{name:r,image:n}=this.getWalletProperties({namespace:this.namespace}),{icon:o,label:s}=$Ye[this.namespace]??{};return $`
5230      <wui-flex
5231        .padding=${["4","3","4","3"]}
5232        alignItems="center"
5233        justifyContent="space-between"
5234        gap="2"
5235      >
5236        <wui-wallet-switch
5237          profileName=${ve(this.profileName)}
5238          address=${ve(t)}
5239          imageSrc=${ve(n)}
5240          alt=${ve(r)}
5241          @click=${this.onConnectOtherWallet.bind(this)}
5242          data-testid="wui-wallet-switch"
5243        ></wui-wallet-switch>
5244
5245        <wui-wallet-switch
5246          profileName=${ve(s)}
5247          address=${ve(t)}
5248          icon=${ve(o)}
5249          iconSize="xs"
5250          .enableGreenCircle=${!1}
5251          alt=${ve(s)}
5252          @click=${this.onConnectOtherWallet.bind(this)}
5253          data-testid="wui-wallet-switch"
5254        ></wui-wallet-switch>
5255      </wui-flex>
5256    `}initializeNamespace(){let t=k.state.activeChain;this.namespace=t,this.caipAddress=k.getAccountData(t)?.caipAddress,this.profileName=k.getAccountData(t)?.profileName??null,this.unsubscribe.push(k.subscribeChainProp("accountState",r=>this.onAccountStateChanged(r),t))}async fetchTokens(){if(this.namespace){let t;if(this.caipAddress){let{chainId:r,chainNamespace:n}=Qe.parseCaipAddress(this.caipAddress),o=`${n}:${r}`;t=k.getAllRequestedCaipNetworks().find(i=>i.caipNetworkId===o)}await Se.fetchTokens({caipAddress:this.caipAddress,caipNetwork:t,namespace:this.namespace})}}fetchQuote(){if(this.amount&&this.recipient&&this.selectedPaymentAsset&&this.paymentAsset){let{address:t}=this.caipAddress?Qe.parseCaipAddress(this.caipAddress):{};Se.fetchQuote({amount:this.amount.toString(),address:t,sourceToken:this.selectedPaymentAsset,toToken:this.paymentAsset,recipient:this.recipient})}}getWalletProperties({namespace:t}){if(!t)return{name:void 0,image:void 0};let r=this.activeConnectorIds[t];if(!r)return{name:void 0,image:void 0};let n=X.getConnector({id:r,namespace:t});if(!n)return{name:void 0,image:void 0};let o=vt.getConnectorImage(n);return{name:n.name,image:o}}paymentOptionsViewTemplate(){return $`
5257      <wui-flex flexDirection="column" gap="2">
5258        <wui-text variant="sm-regular" color="secondary">CHOOSE PAYMENT OPTION</wui-text>
5259        <wui-flex class="pay-options-container">${this.paymentOptionsTemplate()}</wui-flex>
5260      </wui-flex>
5261    `}paymentOptionsTemplate(){let t=this.getPaymentAssetFromTokenBalances();if(this.isFetchingTokenBalances)return $`<w3m-pay-options-skeleton></w3m-pay-options-skeleton>`;if(t.length===0)return $`<w3m-pay-options-empty
5262        @connectOtherWallet=${this.onConnectOtherWallet.bind(this)}
5263      ></w3m-pay-options-empty>`;let r={disabled:this.isFetchingQuote};return $`<w3m-pay-options
5264      class=${N6(r)}
5265      .options=${t}
5266      .selectedPaymentAsset=${ve(this.selectedPaymentAsset)}
5267      .onSelect=${this.onSelectedPaymentAssetChanged.bind(this)}
5268    ></w3m-pay-options>`}amountWithFeeTemplate(){return this.isFetchingQuote||!this.selectedPaymentAsset||this.quoteError?$`<w3m-pay-fees-skeleton></w3m-pay-fees-skeleton>`:$`<w3m-pay-fees></w3m-pay-fees>`}paymentActionsTemplate(){let t=this.isFetchingQuote||this.isFetchingTokenBalances,r=this.isFetchingQuote||this.isFetchingTokenBalances||!this.selectedPaymentAsset||!!this.quoteError,n=dt.formatNumber(this.quote?.origin.amount??0,{decimals:this.quote?.origin.currency.metadata.decimals??0}).toString();return this.selectedExchange?t||r?$`
5269          <wui-shimmer width="100%" height="48px" variant="light" ?rounded=${!0}></wui-shimmer>
5270        `:$`<wui-button
5271        size="lg"
5272        fullWidth
5273        variant="accent-secondary"
5274        @click=${this.onPayWithExchange.bind(this)}
5275      >
5276        ${`Continue in ${this.selectedExchange.name}`}
5277
5278        <wui-icon name="arrowRight" color="inherit" size="sm" slot="iconRight"></wui-icon>
5279      </wui-button>
5279`:$`
5280      <wui-flex alignItems="center" justifyContent="space-between">
5281        <wui-flex flexDirection="column" gap="1">
5282          <wui-text variant="md-regular" color="secondary">Order Total</wui-text>
5283
5284          ${t||r?$`<wui-shimmer width="58px" height="32px" variant="light"></wui-shimmer>`:$`<wui-flex alignItems="center" gap="01">
5285                <wui-text variant="h4-regular" color="primary">${w2(n)}</wui-text>
5286
5287                <wui-text variant="lg-regular" color="secondary">
5288                  ${this.quote?.origin.currency.metadata.symbol||"Unknown"}
5289                </wui-text>
5290              </wui-flex>`}
5291        </wui-flex>
5292
5293        ${this.actionButtonTemplate({isLoading:t,isDisabled:r})}
5294      </wui-flex>
5295    `}actionButtonTemplate(t){let r=J7(this.quote),{isLoading:n,isDisabled:o}=t,s="Pay";return r.length>1&&this.completedTransactionsCount===0&&(s="Approve"),$`
5296      <wui-button
5297        size="lg"
5298        variant="accent-primary"
5299        ?loading=${n||this.isPaymentInProgress}
5300        ?disabled=${o||this.isPaymentInProgress}
5301        @click=${()=>{r.length>0?this.onSendTransactions():this.onTransfer()}}
5302      >
5303        ${s}
5304        ${n?null:$`<wui-icon
5305              name="arrowRight"
5306              color="inherit"
5307              size="sm"
5308              slot="iconRight"
5309            ></wui-icon>`}
5310      </wui-button>
5311    `}getPaymentAssetFromTokenBalances(){return this.namespace?(this.tokenBalances[this.namespace]??[]).map(o=>{try{return N4e(o)}catch{return null}}).filter(o=>!!o).filter(o=>{let{chainId:s}=Qe.parseCaipNetworkId(o.network),{chainId:i}=Qe.parseCaipNetworkId(this.paymentAsset.network);return Qr.isLowerCaseMatch(o.asset,this.paymentAsset.asset)?!0:this.selectedExchange?!Qr.isLowerCaseMatch(s.toString(),i.toString()):!0}):[]}onTokenBalancesChanged(t){this.tokenBalances=t;let[r]=this.getPaymentAssetFromTokenBalances();r&&Se.setSelectedPaymentAsset(r)}async onConnectOtherWallet(){await X.connect(),await Oe.open({view:"PayQuote"})}onAccountStateChanged(t){let{address:r}=this.caipAddress?Qe.parseCaipAddress(this.caipAddress):{};if(this.caipAddress=t?.caipAddress,this.profileName=t?.profileName??null,r){let{address:n}=this.caipAddress?Qe.parseCaipAddress(this.caipAddress):{};n?Qr.isLowerCaseMatch(n,r)||(this.resetAssetsState(),this.resetQuoteState(),this.fetchTokens()):Oe.close()}}onSelectedPaymentAssetChanged(t){this.isFetchingQuote||Se.setSelectedPaymentAsset(t)}async onTransfer(){let t=L5(this.quote);if(t){if(!Qr.isLowerCaseMatch(this.selectedPaymentAsset?.asset,t.deposit.currency))throw new Error("Quote asset is not the same as the selected payment asset");let n=this.selectedPaymentAsset?.amount??"0",o=dt.formatNumber(t.deposit.amount,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!dt.bigNumber(n).gte(o)){Ze.showError("Insufficient funds");return}if(this.quote&&this.selectedPaymentAsset&&this.caipAddress&&this.namespace){let{address:i}=Qe.parseCaipAddress(this.caipAddress);await Se.onTransfer({chainNamespace:this.namespace,fromAddress:i,toAddress:t.deposit.receiver,amount:o,paymentAsset:this.selectedPaymentAsset}),Se.setRequestId(t.requestId),Z.push("PayLoading")}}}async onSendTransactions(){let t=this.selectedPaymentAsset?.amount??"0",r=dt.formatNumber(this.quote?.origin.amount??0,{decimals:this.selectedPaymentAsset?.metadata.decimals??0}).toString();if(!dt.bigNumber(t).gte(r)){Ze.showError("Insufficient funds");return}let o=J7(this.quote),[s]=J7(this.quote,this.completedTransactionsCount);s&&this.namespace&&(await Se.onSendTransaction({namespace:this.namespace,transactionStep:s}),this.completedTransactionsCount+=1,this.completedTransactionsCount===o.length&&(Se.setRequestId(s.requestId),Z.push("PayLoading")))}onPayWithExchange(){if(this.exchangeUrlForQuote){let t=ee.returnOpenHref("","popupWindow","scrollbar=yes,width=480,height=720");if(!t)throw new Error("Could not create popup window");t.location.href=this.exchangeUrlForQuote;let r=L5(this.quote);r&&Se.setRequestId(r.requestId),Se.initiatePayment(),Z.push("PayLoading")}}resetAssetsState(){Se.setSelectedPaymentAsset(null)}resetQuoteState(){Se.resetQuoteState()}};$n.styles=p3e;wo([ie()],$n.prototype,"profileName",void 0);wo([ie()],$n.prototype,"paymentAsset",void 0);wo([ie()],$n.prototype,"namespace",void 0);wo([ie()],$n.prototype,"caipAddress",void 0);wo([ie()],$n.prototype,"amount",void 0);wo([ie()],$n.prototype,"recipient",void 0);wo([ie()],$n.prototype,"activeConnectorIds",void 0);wo([ie()],$n.prototype,"selectedPaymentAsset",void 0);wo([ie()],$n.prototype,"selectedExchange",void 0);wo([ie()],$n.prototype,"isFetchingQuote",void 0);wo([ie()],$n.prototype,"quoteError",void 0);wo([ie()],$n.prototype,"quote",void 0);wo([ie()],$n.prototype,"isFetchingTokenBalances",void 0);wo([ie()],$n.prototype,"tokenBalances",void 0);wo([ie()],$n.prototype,"isPaymentInProgress",void 0);wo([ie()],$n.prototype,"exchangeUrlForQuote",void 0);wo([ie()],$n.prototype,"completedTransactionsCount",void 0);$n=wo([te("w3m-pay-quote-view")],$n)});var m3e=h(()=>{Ef();G6()});var g3e=h(()=>{});var y3e=h(()=>{U4e();j4e();h3e();m3e();Ef();g3e()});var w3e,b3e=h(()=>{He();w3e=ce`
5312  wui-image {
5313    border-radius: ${({borderRadius:e})=>e.round};
5314  }
5315
5316  .transfers-badge {
5317    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5318    border: 1px solid ${({tokens:e})=>e.theme.foregroundSecondary};
5319    border-radius: ${({borderRadius:e})=>e[4]};
5320  }
5321`});var kz,H5,x3e=h(()=>{le();Ue();Pr();st();y3e();He();Mr();Mn();b3e();kz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},H5=class extends ne{constructor(){super(),this.unsubscribe=[],this.paymentAsset=Se.state.paymentAsset,this.amount=Se.state.amount,this.unsubscribe.push(Se.subscribeKey("paymentAsset",t=>{this.paymentAsset=t}),Se.subscribeKey("amount",t=>{this.amount=t}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let r=k.getAllRequestedCaipNetworks().find(n=>n.caipNetworkId===this.paymentAsset.network);return $`<wui-flex
5322      alignItems="center"
5323      gap="1"
5324      .padding=${["1","2","1","1"]}
5325      class="transfers-badge"
5326    >
5327      <wui-image src=${ve(this.paymentAsset.metadata.logoURI)} size="xl"></wui-image>
5328      <wui-text variant="lg-regular" color="primary">
5329        ${this.amount} ${this.paymentAsset.metadata.symbol}
5330      </wui-text>
5331      <wui-text variant="sm-regular" color="secondary">
5332        on ${r?.name??"Unknown"}
5333      </wui-text>
5334    </wui-flex>`}};H5.styles=[w3e];kz([V()],H5.prototype,"paymentAsset",void 0);kz([V()],H5.prototype,"amount",void 0);H5=kz([te("w3m-pay-header")],H5)});var v3e,E3e=h(()=>{He();v3e=ce`
5335  :host {
5336    height: 60px;
5337  }
5338
5339  :host > wui-flex {
5340    box-sizing: border-box;
5341    background-color: var(--local-header-background-color);
5342  }
5343
5344  wui-text {
5345    background-color: var(--local-header-background-color);
5346  }
5347
5348  wui-flex.w3m-header-title {
5349    transform: translateY(0);
5350    opacity: 1;
5351  }
5352
5353  wui-flex.w3m-header-title[view-direction='prev'] {
5354    animation:
5355      slide-down-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
5356      slide-down-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
5357    animation-delay: 0ms, 200ms;
5358  }
5359
5360  wui-flex.w3m-header-title[view-direction='next'] {
5361    animation:
5362      slide-up-out 120ms forwards ${({easings:e})=>e["ease-out-power-2"]},
5363      slide-up-in 120ms forwards ${({easings:e})=>e["ease-out-power-2"]};
5364    animation-delay: 0ms, 200ms;
5365  }
5366
5367  wui-icon-button[data-hidden='true'] {
5368    opacity: 0 !important;
5369    pointer-events: none;
5370  }
5371
5372  @keyframes slide-up-out {
5373    from {
5374      transform: translateY(0px);
5375      opacity: 1;
5376    }
5377    to {
5378      transform: translateY(3px);
5379      opacity: 0;
5380    }
5381  }
5382
5383  @keyframes slide-up-in {
5384    from {
5385      transform: translateY(-3px);
5386      opacity: 0;
5387    }
5388    to {
5389      transform: translateY(0);
5390      opacity: 1;
5391    }
5392  }
5393
5394  @keyframes slide-down-out {
5395    from {
5396      transform: translateY(0px);
5397      opacity: 1;
5398    }
5399    to {
5400      transform: translateY(-3px);
5401      opacity: 0;
5402    }
5403  }
5404
5405  @keyframes slide-down-in {
5406    from {
5407      transform: translateY(3px);
5408      opacity: 0;
5409    }
5410    to {
5411      transform: translateY(0);
5412      opacity: 1;
5413    }
5414  }
5415`});function A3e(){let e=Z.state.data?.connector?.name,t=Z.state.data?.wallet?.name,r=Z.state.data?.network?.name,n=t??e,o=X.getConnectors(),s=o.length===1&&o[0]?.id==="w3m-email",i=k.getAccountData()?.socialProvider,a=i?i.charAt(0).toUpperCase()+i.slice(1):"Connect Social";return{Connect:`Connect ${s?"Email":""} Wallet`,Create:"Create Wallet",ChooseAccountName:void 0,Account:void 0,AccountSettings:void 0,AllWallets:"All Wallets",ApproveTransaction:"Approve Transaction",BuyInProgress:"Buy",UsageExceeded:"Usage Exceeded",ConnectingExter
5415nal:n??"Connect Wallet",ConnectingWalletConnect:n??"WalletConnect",ConnectingWalletConnectBasic:"WalletConnect",ConnectingSiwe:"Sign In",Convert:"Convert",ConvertSelectToken:"Select token",ConvertPreview:"Preview Convert",Downloads:n?`Get ${n}`:"Downloads",EmailLogin:"Email Login",EmailVerifyOtp:"Confirm Email",EmailVerifyDevice:"Register Device",GetWallet:"Get a Wallet",Networks:"Choose Network",OnRampProviders:"Choose Provider",OnRampActivity:"Activity",OnRampTokenSelect:"Select Token",OnRampFiatSelect:"Select Currency",Pay:"How you pay",ProfileWallets:"Wallets",SwitchNetwork:r??"Switch Network",Transactions:"Activity",UnsupportedChain:"Switch Network",UpgradeEmailWallet:"Upgrade Your Wallet",UpdateEmailWallet:"Edit Email",UpdateEmailPrimaryOtp:"Confirm Current Email",UpdateEmailSecondaryOtp:"Confirm New Email",WhatIsABuy:"What is Buy?",RegisterAccountName:"Choose Name",RegisterAccountNameSuccess:"",WalletReceive:"Receive",WalletCompatibleNetworks:"Compatible Networks",Swap:"Swap",SwapSelectToken:"Select Token",SwapPreview:"Preview Swap",WalletSend:"Send",WalletSendPreview:"Review Send",WalletSendSelectToken:"Select Token",WalletSendConfirmed:"Confirmed",WhatIsANetwork:"What is a network?",WhatIsAWallet:"What is a Wallet?",ConnectWallets:"Connect Wallet",ConnectSocials:"All Socials",ConnectingSocial:a,ConnectingMultiChain:"Select Chain",ConnectingFarcaster:"Farcaster",SwitchActiveChain:"Switch Chain",SmartSessionCreated:void 0,SmartSessionList:"Smart Sessions",SIWXSignMessage:"Sign In",PayLoading:"Processing payment...",PayQuote:"Payment Quote",DataCapture:"Profile",DataCaptureOtpConfirm:"Confirm Email",FundWallet:"Fund Wallet",PayWithExchange:"Deposit from Exchange",PayWithExchangeSelectAsset:"Select Asset",SmartAccountSettings:"Smart Account Settings"}}var Am,FYe,VYe,Ed,C3e=h(()=>{le();Ue();Pr();st();He();Mr();yz();J8e();Q8e();Mn();wz();x3e();E3e();Am=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},FYe=["SmartSessionList"],VYe={PayWithExchange:Ut.tokens.theme.foregroundPrimary};Ed=class extends ne{constructor(){super(),this.unsubscribe=[],this.heading=A3e()[Z.state.view],this.network=k.state.activeCaipNetwork,this.networkImage=vt.getNetworkImage(this.network),this.showBack=!1,this.prevHistoryLength=1,this.view=Z.state.view,this.viewDirection="",this.unsubscribe.push(Dn.subscribeNetworkImages(()=>{this.networkImage=vt.getNetworkImage(this.network)}),Z.subscribeKey("view",t=>{setTimeout(()=>{this.view=t,this.heading=A3e()[t]},bf.ANIMATION_DURATIONS.HeaderText),this.onViewChange(),this.onHistoryChange()}),k.subscribeKey("activeCaipNetwork",t=>{this.network=t,this.networkImage=vt.getNetworkImage(this.network)}))}disconnectCallback(){this.unsubscribe.forEach(t=>t())}render(){let t=VYe[Z.state.view]??Ut.tokens.theme.backgroundPrimary;return this.style.setProperty("--local-header-background-color",t),$`
5416      <wui-flex
5417        .padding=${["0","4","0","4"]}
5418        justifyContent="space-between"
5419        alignItems="center"
5420      >
5421        ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
5422      </wui-flex>
5423    `}onWalletHelp(){xe.sendEvent({type:"track",event:"CLICK_WALLET_HELP"}),Z.push("WhatIsAWallet")}async onClose(){await s3.safeClose()}rightHeaderTemplate(){let t=W?.state?.features?.smartSessions;return Z.state.view!=="Account"||!t?this.closeButtonTemplate():$`<wui-flex>
5424      <wui-icon-button
5425        icon="clock"
5426        size="lg"
5427        iconSize="lg"
5428        type="neutral"
5429        variant="primary"
5430        @click=${()=>Z.push("SmartSessionList")}
5431        data-testid="w3m-header-smart-sessions"
5432      ></wui-icon-button>
5433      ${this.closeButtonTemplate()}
5434    </wui-flex> `}closeButtonTemplate(){return $`
5435      <wui-icon-button
5436        icon="close"
5437        size="lg"
5438        type="neutral"
5439        variant="primary"
5440        iconSize="lg"
5441        @click=${this.onClose.bind(this)}
5442        data-testid="w3m-header-close"
5443      ></wui-icon-button>
5444    `}titleTemplate(){if(this.view==="PayQuote")return $`<w3m-pay-header></w3m-pay-header>`;let t=FYe.includes(this.view);return $`
5445      <wui-flex
5446        view-direction="${this.viewDirection}"
5447        class="w3m-header-title"
5448        alignItems="center"
5449        gap="2"
5450      >
5451        <wui-text
5452          display="inline"
5453          variant="lg-regular"
5454          color="primary"
5455          data-testid="w3m-header-text"
5456        >
5457          ${this.heading}
5458        </wui-text>
5459        ${t?$`<wui-tag variant="accent" size="md">Beta</wui-tag>`:null}
5460      </wui-flex>
5461    `}leftHeaderTemplate(){let{view:t}=Z.state,r=t==="Connect",n=W.state.enableEmbedded,o=t==="ApproveTransaction",s=t==="ConnectingSiwe",i=t==="Account",a=W.state.enableNetworkSwitch,c=o||s||r&&n;return i&&a?$`<wui-select
5462        id="dynamic"
5463        data-testid="w3m-account-select-network"
5464        active-network=${ve(this.network?.name)}
5464
5465        @click=${this.onNetworks.bind(this)}
5466        imageSrc=${ve(this.networkImage)}
5467      ></wui-select>`:this.showBack&&!c?$`<wui-icon-button
5468        data-testid="header-back"
5469        id="dynamic"
5470        icon="chevronLeft"
5471        size="lg"
5472        iconSize="lg"
5473        type="neutral"
5474        variant="primary"
5475        @click=${this.onGoBack.bind(this)}
5476      ></wui-icon-button>`:$`<wui-icon-button
5477      data-hidden=${!r}
5478      id="dynamic"
5479      icon="helpCircle"
5480      size="lg"
5481      iconSize="lg"
5482      type="neutral"
5483      variant="primary"
5484      @click=${this.onWalletHelp.bind(this)}
5485    ></wui-icon-button>`}onNetworks(){this.isAllowedNetworkSwitch()&&(xe.sendEvent({type:"track",event:"CLICK_NETWORKS"}),Z.push("Networks"))}isAllowedNetworkSwitch(){let t=k.getAllRequestedCaipNetworks(),r=t?t.length>1:!1,n=t?.find(({id:o})=>o===this.network?.id);return r||!n}onViewChange(){let{history:t}=Z.state,r=bf.VIEW_DIRECTION.Next;t.length<this.prevHistoryLength&&(r=bf.VIEW_DIRECTION.Prev),this.prevHistoryLength=t.length,this.viewDirection=r}async onHistoryChange(){let{history:t}=Z.state,r=this.shadowRoot?.querySelector("#dynamic");t.length>1&&!this.showBack&&r?(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!0,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"})):t.length<=1&&this.showBack&&r&&(await r.animate([{opacity:1},{opacity:0}],{duration:200,fill:"forwards",easing:"ease"}).finished,this.showBack=!1,r.animate([{opacity:0},{opacity:1}],{duration:200,fill:"forwards",easing:"ease"}))}onGoBack(){Z.goBack()}};Ed.styles=v3e;Am([ie()],Ed.prototype,"heading",void 0);Am([ie()],Ed.prototype,"network",void 0);Am([ie()],Ed.prototype,"networkImage",void 0);Am([ie()],Ed.prototype,"showBack",void 0);Am([ie()],Ed.prototype,"prevHistoryLength",void 0);Am([ie()],Ed.prototype,"view",void 0);Am([ie()],Ed.prototype,"viewDirection",void 0);Ed=Am([te("w3m-header")],Ed)});var S3e,I3e=h(()=>{Tt();S3e=ce`
5486  :host {
5487    display: flex;
5488    align-items: center;
5489    gap: ${({spacing:e})=>e[1]};
5490    padding: ${({spacing:e})=>e[2]} ${({spacing:e})=>e[3]}
5491      ${({spacing:e})=>e[2]} ${({spacing:e})=>e[2]};
5492    border-radius: ${({borderRadius:e})=>e[20]};
5493    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5494    box-shadow:
5495      0px 0px 8px 0px rgba(0, 0, 0, 0.1),
5496      inset 0 0 0 1px ${({tokens:e})=>e.theme.borderPrimary};
5497    max-width: 320px;
5498  }
5499
5500  wui-icon-box {
5501    border-radius: ${({borderRadius:e})=>e.round} !important;
5502    overflow: hidden;
5503  }
5504
5505  wui-loading-spinner {
5506    padding: ${({spacing:e})=>e[1]};
5507    background-color: ${({tokens:e})=>e.core.foregroundAccent010};
5508    border-radius: ${({borderRadius:e})=>e.round} !important;
5509  }
5510`});var Dz,$5,T3e=h(()=>{le();Ue();m5();xs();kt();Pt();O6();I3e();Dz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},$5=class extends ne{constructor(){super(...arguments),this.message="",this.variant="success"}render(){return $`
5511      ${this.templateIcon()}
5512      <wui-text variant="lg-regular" color="primary" data-testid="wui-snackbar-message"
5513        >${this.message}</wui-text
5514      >
5515    `}templateIcon(){let t={success:"success",error:"error",warning:"warning",info:"default"},r={success:"checkmark",error:"warning",warning:"warningCircle",info:"info"};return this.variant==="loading"?$`<wui-loading-spinner size="md" color="accent-primary"></wui-loading-spinner>`:$`<wui-icon-box
5516      size="md"
5517      color=${t[this.variant]}
5518      icon=${r[this.variant]}
5519    ></wui-icon-box>`}};$5.styles=[ke,S3e];Dz([V()],$5.prototype,"message",void 0);Dz([V()],$5.prototype,"variant",void 0);$5=Dz([te("wui-snackbar")],$5)});var _3e=h(()=>{T3e()});var P3e,N3e=h(()=>{le();P3e=yr`
5520  :host {
5521    display: block;
5522    position: absolute;
5523    opacity: 0;
5524    pointer-events: none;
5525    top: 11px;
5526    left: 50%;
5527    width: max-content;
5528  }
5529`});var R3e,oP,O3e=h(()=>{le();Ue();st();He();_3e();N3e();R3e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},oP=class extends ne{constructor(){super(),this.unsubscribe=[],this.timeout=void 0,this.open=Ze.state.open,this.unsubscribe.push(Ze.subscribeKey("open",t=>{this.open=t,this.onOpen()}))}disconnectedCallback(){clearTimeout(this.timeout),this.unsubscribe.forEach(t=>t())}render(){let{message:t,variant:r}=Ze.state;return $` <wui-snackbar message=${t} variant=${r}></wui-snackbar> `}onOpen(){clearTimeout(this.timeout),this.open?(this.animate([{opacity:0,transform:"translateX(-50%) scale(0.85)"},{opacity:1,transform:"translateX(-50%) scale(1)"}],{duration:150,fill:"forwards",easing:"ease"}),this.timeout&&clearTimeout(this.timeout),Ze.state.autoClose&&(this.timeout=setTimeout(()=>Ze.hide(),2500))):this.animate([{opacity:1,transform:"translateX(-50%) scale(1)"},{opacity:0,transform:"translateX(-50%) scale(0.85)"}],{duration:150,fill:"forwards",easing:"ease"})}};oP.styles=P3e;R3e([ie()],oP.prototype,"open",void 0);oP=R3e([te("w3m-snackbar")],oP)});var B3e,k3e=h(()=>{le();B3e=yr`
5530  :host {
5531    width: 100%;
5532    display: block;
5533  }
5534`});var Uz,F5,D3e=h(()=>{le();Ue();st();He();k3e();Uz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},F5=class extends ne{constructor(){super(),this.unsubscribe=[],this.text="",this.open=Ys.state.open,this.unsubscribe.push(Z.subscribeKey("view",()=>{Ys.hide()}),Oe.subscribeKey("open",t=>{t||Ys.hide()}),Ys.subscribeKey("open",t=>{this.open=t}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),Ys.hide()}render(){return $`
5535      <div
5536        @pointermove=${this.onMouseEnter.bind(this)}
5537        @pointerleave=${this.onMouseLeave.bind(this)}
5538      >
5539        ${this.renderChildren()}
5540      </div>
5541    `}renderChildren(){return $`<slot></slot> `}onMouseEnter(){let t=this.getBoundingClientRect();if(!this.open){let r=document.querySelector("w3m-modal"),n={width:t.width,height:t.height,left:t.left,top:t.top};if(r){let o=r.getBoundingClientRect();n.left=t.left-(window.innerWidth-o.width)/2,n.top=t.top-(window.innerHeight-o.height)/2}Ys.showTooltip({message:this.text,triggerRect:n,variant:"shade"})}}onMouseLeave(t){this.contains(t.relatedTarget)||Ys.hide()}};F5.styles=[B3e];Uz([V()],F5.prototype,"text",void 0);Uz([ie()],F5.prototype,"open",void 0);F5=Uz([te("w3m-tooltip-trigger")],F5)});var U3e,L3e=h(()=>{He();U3e=ce`
5542  :host {
5543    pointer-events: none;
5544  }
5545
5546  :host > wui-flex {
5547    display: var(--w3m-tooltip-display);
5548    opacity: var(--w3m-tooltip-opacity);
5549    padding: 9px ${({spacing:e})=>e[3]} 10px ${({spacing:e})=>e[3]};
5550    border-radius: ${({borderRadius:e})=>e[3]};
5551    color: ${({tokens:e})=>e.theme.backgroundPrimary};
5552    position: absolute;
5553    top: var(--w3m-tooltip-top);
5554    left: var(--w3m-tooltip-left);
5555    transform: translate(calc(-50% + var(--w3m-tooltip-parent-width)), calc(-100% - 8px));
5556    max-width: calc(var(--apkt-modal-width) - ${({spacing:e})=>e[5]});
5557    transition: opacity ${({durations:e})=>e.lg}
5558      ${({easings:e})=>e["ease-out-power-2"]};
5559    will-change: opacity;
5560    opacity: 0;
5561    animation-duration: ${({durations:e})=>e.xl};
5562    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
5563    animation-name: fade-in;
5564    animation-fill-mode: forwards;
5565  }
5566
5567  :host([data-variant='shade']) > wui-flex {
5568    background-color: ${({tokens:e})=>e.theme.foregroundPrimary};
5569  }
5570
5571  :host([data-variant='shade']) > wui-flex > wui-text {
5572    color: ${({tokens:e})=>e.theme.textSecondary};
5573  }
5574
5575  :host([data-variant='fill']) > wui-flex {
5576    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5577    border: 1px solid ${({tokens:e})=>e.theme.borderPrimary};
5578  }
5579
5580  wui-icon {
5581    position: absolute;
5582    width: 12px !important;
5583    height: 4px !important;
5584    color: ${({tokens:e})=>e.theme.foregroundPrimary};
5585  }
5586
5587  wui-icon[data-placement='top'] {
5588    bottom: 0px;
5589    left: 50%;
5590    transform: translate(-50%, 95%);
5591  }
5592
5593  wui-icon[data-placement='bottom'] {
5594    top: 0;
5595    left: 50%;
5596    transform: translate(-50%, -95%) rotate(180deg);
5597  }
5598
5599  wui-icon[data-placement='right'] {
5600    top: 50%;
5601    left: 0;
5602    transform: translate(-65%, -50%) rotate(90deg);
5603  }
5604
5605  wui-icon[data-placement='left'] {
5606    top: 50%;
5607    right: 0%;
5608    transform: translate(65%, -50%) rotate(270deg);
5609  }
5610
5611  @keyframes fade-in {
5612    from {
5613      opacity: 0;
5614    }
5615    to {
5616      opacity: 1;
5617    }
5618  }
5619`});var V5,b2,M3e=h(()=>{le();Ue();st();He();Mr();mf();Mn();L3e();V5=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},b2=class extends ne{constructor(){super(),this.unsubscribe=[],this.open=Ys.state.open,this.message=Ys.state.message,this.triggerRect=Ys.state.triggerRect,this.variant=Ys.state.variant,this.unsubscribe.push(Ys.subscribe(t=>{this.open=t.open,this.message=t.message,this.triggerRect=t.triggerRect,this.variant=t.variant}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){this.dataset.variant=this.variant;let t=this.triggerRect.top,r=this.triggerRect.left;return this.style.cssText=`
5620    --w3m-tooltip-top: ${t}px;
5621    --w3m-tooltip-left: ${r}px;
5622    --w3m-tooltip-parent-width: ${this.triggerRect.width/2}px;
5623    --w3m-tooltip-display: ${this.open?"flex":"none"};
5624    --w3m-tooltip-opacity: ${this.open?1:0};
5625    `,$`<wui-flex>
5626      <wui-icon data-placement="top" size="inherit" name="cursor"></wui-icon>
5627      <wui-text color="primary" variant="sm-regular">${this.message}</wui-text>
5628    </wui-flex>`}};b2.styles=[U3e];V5([ie()],b2.prototype,"open",void 0);V5([ie()],b2.prototype,"message",void 0);V5([ie()],b2.prototype,"triggerRect",void 0);V5([ie()],b2.prototype,"variant",void 0);b2=V5([te("w3m-tooltip")],b2)});var x2,Lz=h(()=>{it();st();wz();x2={getTabsByNamespace(e){return!!e&&e===j.CHAIN.EVM?W.state.remoteFeatures?.activity===!1?bf.ACCOUNT_TABS.filter(r=>r.label!=="Activity"):bf.ACCOUNT_TABS:[]},isValidReownName(e){return/^[a-zA-Z0-9]+$/gu.test(e)},isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/gu.test(e)},validateReownName(e){return e.replace(/\^/gu,"").toLowerCase().replace(/[^a-zA-Z0-9]/gu,"")},hasFooter(){let e=Z.state.view;if(bf.VIEWS_WITH_LEGAL_FOOTER.includes(e)){let{termsConditionsUrl:t,privacyPolicyUrl:r}=W.state,n=W.state.features?.legalCheckbox;return!(!t&&!r||n)}return bf.VIEWS_WITH_DEFAULT_FOOTER.includes(e)}}});var H3e,$3e=h(()=>{He();H3e=ce`
5629  :host wui-ux-by-reown {
5630    padding-top: 0;
5631  }
5632
5633  :host wui-ux-by-reown.branding-only {
5634    padding-top: ${({spacing:e})=>e[3]};
5635  }
5636
5637  a {
5638    text-decoration: none;
5639    color: ${({tokens:e})=>e.core.textAccentPrimary};
5640    font-weight: 500;
5641  }
5642`});var F3e,sP,V3e=h(()=>{le();Ue();st();He();Mr();Mn();oz();$3e();F3e=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},sP=class extends ne{constructor(){super(),this.unsubscribe=[],this.remoteFeatures=W.state.remoteFeatures,this.unsubscribe.push(W.subscribeKey("remoteFeatures",t=>this.remoteFeatures=t))}disconnectedCallback(){this.unsubscribe.forEach(t=>t())}render(){let{termsConditionsUrl:t,privacyPolicyUrl:r}=W.state,n=W.state.features?.legalCheckbox;return!t&&!r||n?$`
5643        <wui-flex flexDirection="column"> ${this.reownBrandingTemplate(!0)} </wui-flex>
5644      `:$`
5645      <wui-flex flexDirection="column">
5646        <wui-flex .padding=${["4","3","3","3"]} justifyContent="center">
5647          <wui-text color="secondary" variant="md-regular" align="center">
5648            By connecting your wallet, you agree to our <br />
5649            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
5650          </wui-text>
5651        </wui-flex>
5652        ${this.reownBrandingTemplate()}
5653      </wui-flex>
5654    `}andTemplate(){let{termsConditionsUrl:t,privacyPolicyUrl:r}=W.state;return t&&r?"and":""}termsTemplate(){let{termsConditionsUrl:t}=W.state;return t?$`<a href=${t} target="_blank" rel="noopener noreferrer"
5655      >Terms of Service</a
5656    >`:null}privacyTemplate(){let{privacyPolicyUrl:t}=W.state;return t?$`<a href=${t} target="_blank" rel="noopener noreferrer"
5657      >Privacy Policy</a
5658    >`:null}reownBrandingTemplate(t=!1){return this.remoteFeatures?.reownBranding?t?$`<wui-ux-by-reown class="branding-only"></wui-ux-by-reown>`:$`<wui-ux-by-reown></wui-ux-by-reown>`:null}};sP.styles=[H3e];F3e([ie()],sP.prototype,"remoteFeatures",void 0);sP=F3e([te("w3m-legal-footer")],sP)});var z3e,j3e=h(()=>{le();z3e=yr``});var zYe,Mz,q3e=h(()=>{le();st();He();Mr();mf();A7();Mn();D0();j3e();zYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Mz=class extends ne{render(){let{termsConditionsUrl:t,privacyPolicyUrl:r}=W.state;return!t&&!r?null:$`
5659      <wui-flex
5660        .padding=${["4","3","3","3"]}
5661        flexDirection="column"
5662        alignItems="center"
5663        justifyContent="center"
5664        gap="3"
5665      >
5666        <wui-text color="secondary" variant="md-regular" align="center">
5667          We work with the best providers to give you the lowest fees and best support. More options
5668          coming soon!
5669        </wui-text>
5670
5671        ${this.howDoesItWorkTemplate()}
5672      </wui-flex>
5673    `}howDoesItWorkTemplate(){return $` <wui-link @click=${this.onWhatIsBuy.bind(this)}>
5674      <wui-icon size="xs" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
5675      How does it work?
5676    </wui-link>`}onWhatIsBuy(){xe.sendEvent({type:"track",event:"SELECT_WHAT_IS_A_BUY",properties:{isSmartAccount:Dr(k.state.activeChain)===$r.ACCOUNT_TYPES.SMART_ACCOUNT}}),Z.push("WhatIsABuy")}};Mz.styles=[z3e];Mz=zYe([te("w3m-onramp-providers-footer")],Mz)});var W3e,K3e=h(()=>{He();W3e=ce`
5677  :host {
5678    display: block;
5679  }
5680
5681  div.container {
5682    position: absolute;
5683    bottom: 0;
5684    left: 0;
5685    right: 0;
5686    overflow: hidden;
5687    height: auto;
5688    display: block;
5689  }
5690
5691  div.container[status='hide'] {
5692    animation: fade-out;
5693    animation-duration: var(--apkt-duration-dynamic);
5694    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
5695    animation-fill-mode: both;
5696    animation-delay: 0s;
5697  }
5698
5699  div.container[status='show'] {
5700    animation: fade-in;
5701    animation-duration: var(--apkt-duration-dynamic);
5702    animation-timing-function: ${({easings:e})=>e["ease-out-power-2"]};
5703    animation-fill-mode: both;
5704    animation-delay: var(--apkt-duration-dynamic);
5705  }
5706
5707  @keyframes fade-in {
5708    from {
5709      opacity: 0;
5710      filter: blur(6px);
5711    }
5712    to {
5713      opacity: 1;
5714      filter: blur(0px);
5715    }
5716  }
5717
5718  @keyframes fade-out {
5719    from {
5720      opacity: 1;
5721      filter: blur(0px);
5722    }
5723    to {
5724      opacity: 0;
5725      filter: blur(6px);
5726    }
5727  }
5728`});var Hz,z5,$z=h(()=>{le();Ue();st();He();V3e();q3e();Lz();K3e();Hz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defin
5728eProperty(t,r,s),s},z5=class extends ne{constructor(){super(...arguments),this.resizeObserver=void 0,this.unsubscribe=[],this.status="hide",this.view=Z.state.view}firstUpdated(){this.status=x2.hasFooter()?"show":"hide",this.unsubscribe.push(Z.subscribeKey("view",t=>{this.view=t,this.status=x2.hasFooter()?"show":"hide",this.status==="hide"&&document.documentElement.style.setProperty("--apkt-footer-height","0px")})),this.resizeObserver=new ResizeObserver(t=>{for(let r of t)if(r.target===this.getWrapper()){let n=`${r.contentRect.height}px`;document.documentElement.style.setProperty("--apkt-footer-height",n)}}),this.resizeObserver.observe(this.getWrapper())}render(){return $`
5729      <div class="container" status=${this.status}>${this.templatePageContainer()}</div>
5730    `}templatePageContainer(){return x2.hasFooter()?$` ${this.templateFooter()}`:null}templateFooter(){switch(this.view){case"Networks":return this.templateNetworksFooter();case"Connect":case"ConnectWallets":case"OnRampFiatSelect":case"OnRampTokenSelect":return $`<w3m-legal-footer></w3m-legal-footer>`;case"OnRampProviders":return $`<w3m-onramp-providers-footer></w3m-onramp-providers-footer>`;default:return null}}templateNetworksFooter(){return $` <wui-flex
5731      class="footer-in"
5732      padding="3"
5733      flexDirection="column"
5734      gap="3"
5735      alignItems="center"
5736    >
5737      <wui-text variant="md-regular" color="secondary" align="center">
5738        Your connected wallet may not support some of the networks available for this dApp
5739      </wui-text>
5740      <wui-link @click=${this.onNetworkHelp.bind(this)}>
5741        <wui-icon size="sm" color="accent-primary" slot="iconLeft" name="helpCircle"></wui-icon>
5742        What is a network
5743      </wui-link>
5744    </wui-flex>`}onNetworkHelp(){xe.sendEvent({type:"track",event:"CLICK_NETWORK_HELP"}),Z.push("WhatIsANetwork")}getWrapper(){return this.shadowRoot?.querySelector("div.container")}};z5.styles=[W3e];Hz([ie()],z5.prototype,"status",void 0);Hz([ie()],z5.prototype,"view",void 0);z5=Hz([te("w3m-footer")],z5)});var Z3e,G3e=h(()=>{He();Z3e=ce`
5745  :host {
5746    display: block;
5747    width: inherit;
5748  }
5749`});var Fz,j5,Y3e=h(()=>{le();Ue();st();He();$z();G3e();Fz=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},j5=class extends ne{constructor(){super(),this.unsubscribe=[],this.viewState=Z.state.view,this.history=Z.state.history.join(","),this.unsubscribe.push(Z.subscribeKey("view",()=>{this.history=Z.state.history.join(","),document.documentElement.style.setProperty("--apkt-duration-dynamic","var(--apkt-durations-lg)")}))}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),document.documentElement.style.setProperty("--apkt-duration-dynamic","0s")}render(){return $`${this.templatePageContainer()}`}templatePageContainer(){return $`<w3m-router-container
5750      history=${this.history}
5751      .setView=${()=>{this.viewState=Z.state.view}}
5752    >
5753      ${this.viewTemplate(this.viewState)}
5754    </w3m-router-container>`}viewTemplate(t){switch(t){case"AccountSettings":return $`<w3m-account-settings-view></w3m-account-settings-view>`;case"Account":return $`<w3m-account-view></w3m-account-view>`;case"AllWallets":return $`<w3m-all-wallets-view></w3m-all-wallets-view>`;case"ApproveTransaction":return $`<w3m-approve-transaction-view></w3m-approve-transaction-view>`;case"BuyInProgress":return $`<w3m-buy-in-progress-view></w3m-buy-in-progress-view>`;case"ChooseAccountName":return $`<w3m-choose-account-name-view></w3m-choose-account-name-view>`;case"Connect":return $`<w3m-connect-view></w3m-connect-view>`;case"Create":return $`<w3m-connect-view walletGuide="explore"></w3m-connect-view>`;case"ConnectingWalletConnect":return $`<w3m-connecting-wc-view></w3m-connecting-wc-view>`;case"ConnectingWalletConnectBasic":return $`<w3m-connecting-wc-basic-view></w3m-connecting-wc-basic-view>`;
5754case"ConnectingExternal":return $`<w3m-connecting-external-view></w3m-connecting-external-view>`;case"ConnectingSiwe":return $`<w3m-connecting-siwe-view></w3m-connecting-siwe-view>`;case"ConnectWallets":return $`<w3m-connect-wallets-view></w3m-connect-wallets-view>`;case"ConnectSocials":return $`<w3m-connect-socials-view></w3m-connect-socials-view>`;case"ConnectingSocial":return $`<w3m-connecting-social-view></w3m-connecting-social-view>`;case"DataCapture":return $`<w3m-data-capture-view></w3m-data-capture-view>`;case"DataCaptureOtpConfirm":return $`<w3m-data-capture-otp-confirm-view></w3m-data-capture-otp-confirm-view>`;case"Downloads":return $`<w3m-downloads-view></w3m-downloads-view>`;case"EmailLogin":return $`<w3m-email-login-view></w3m-email-login-view>`;case"EmailVerifyOtp":return $`<w3m-email-verify-otp-view></w3m-email-verify-otp-view>`;case"EmailVerifyDevice":return $`<w3m-email-verify-device-view></w3m-email-verify-device-view>`;case"GetWallet":return $`<w3m-get-wallet-view></w3m-get-wallet-view>`;case"Networks":return $`<w3m-networks-view></w3m-networks-view>`;case"SwitchNetwork":return $`<w3m-network-switch-view></w3m-network-switch-view>`;case"ProfileWallets":return $`<w3m-profile-wallets-view></w3m-profile-wallets-view>`;case"Transactions":return $`<w3m-transactions-view></w3m-transactions-view>`;case"OnRampProviders":return $`<w3m-onramp-providers-view></w3m-onramp-providers-view>`;case"OnRampTokenSelect":return $`<w3m-onramp-token-select-view></w3m-onramp-token-select-view>`;case"OnRampFiatSelect":return $`<w3m-onramp-fiat-select-view></w3m-onramp-fiat-select-view>`;case"UpgradeEmailWallet":return $`<w3m-upgrade-wallet-view></w3m-upgrade-wallet-view>`;case"UpdateEmailWallet":return $`<w3m-update-email-wallet-view></w3m-update-email-wallet-view>`;case"UpdateEmailPrimaryOtp":return $`<w3m-update-email-primary-otp-view></w3m-update-email-primary-otp-view>`;case"UpdateEmailSecondaryOtp":return $`<w3m-update-email-secondary-otp-view></w3m-update-email-secondary-otp-view>`;case"UnsupportedChain":return $`<w3m-unsupported-chain-view></w3m-unsupported-chain-view>`;case"Swap":return $`<w3m-swap-view></w3m-swap-view>`;case"SwapSelectToken":return $`<w3m-swap-select-token-view></w3m-swap-select-token-view>`;case"SwapPreview":return $`<w3m-swap-preview-view></w3m-swap-preview-view>`;case"WalletSend":return $`<w3m-wallet-send-view></w3m-wallet-send-view>`;case"WalletSendSelectToken":return $`<w3m-wallet-send-select-token-view></w3m-wallet-send-select-token-view>`;case"WalletSendPreview":return $`<w3m-wallet-send-preview-view></w3m-wallet-send-preview-view>`;case"WalletSendConfirmed":return $`<w3m-send-confirmed-view></w3m-send-confirmed-view>`;case"WhatIsABuy":return $`<w3m-what-is-a-buy-view></w3m-what-is-a-buy-view>`;case"WalletReceive":return $`<w3m-wallet-receive-view></w3m-wallet-receive-view>`;case"WalletCompatibleNetworks":return $`<w3m-wallet-compatible-networks-view></w3m-wallet-compatible-networks-view>`;case"WhatIsAWallet":return $`<w3m-what-is-a-wallet-view></w3m-what-is-a-wallet-view>`;case"ConnectingMultiChain":return $`<w3m-connecting-multi-chain-view></w3m-connecting-multi-chain-view>`;case"WhatIsANetwork":return $`<w3m-what-is-a-network-view></w3m-what-is-a-network-view>`;case"ConnectingFarcaster":return $`<w3m-connecting-farcaster-view></w3m-connecting-farcaster-view>`;case"SwitchActiveChain":return $`<w3m-switch-active-chain-view></w3m-switch-active-chain-view>`;case"RegisterAccountName":return $`<w3m-register-account-name-view></w3m-register-account-name-view>`;case"RegisterAccountNameSuccess":return $`<w3m-register-account-name-success-view></w3m-register-account-name-success-view>`;case"SmartSessionCreated":return $`<w3m-smart-session-created-view></w3m-smart-session-created-view>`;case"SmartSessionList":return $`<w3m-smart-session-list-view></w3m-smart-session-list-view>`;case"SIWXSignMessage":return $`<w3m-siwx-sign-message-view></w3m-siwx-sign-message-view>`;case"Pay":return $`<w3m-pay-view></w3m-pay-view>`;case"PayLoading":return $`<w3m-pay-loading-view></w3m-pay-loading-view>`;case"PayQuote":return $`<w3m-pay-quote-view></w3m-pay-quote-view>`;case"FundWallet":return $`<w3m-fund-wallet-view></w3m-fund-wallet-view>`;case"PayWithExchange":return $`<w3m-deposit-from-exchange-view></w3m-deposit-from-exchange-view>`;case"PayWithExchangeSelectAsset":return $`<w3m-deposit-from-exchange-select-asset-view></w3m-deposit-from-exchange-select-asset-view>`;case"UsageExceeded":return $`<w3m-usage-exceeded-view></w3m-usage-exceeded-view>`;case"SmartAccountSettings":return $`<w3m-smart-account-settings-view></w3m-smart-account-settings-view>`;default:return $`<w3m-connect-view></w3m-connect-view>`}}};j5.styles=[Z3e];Fz([ie()],j5.prototype,"viewState",void 0);Fz([ie()],j5.prototype,"history",void 0);j5=Fz([te("w3m-router")],j5)});var J3e,Q3e=h(()=>{He();J3e=ce`
5755  :host {
5756    z-index: ${({tokens:e})=>e.core.zIndex};
5757    display: block;
5758    backface-visibility: hidden;
5759    will-change: opacity;
5760    position: fixed;
5761    top: 0;
5762    left: 0;
5763    right: 0;
5764    bottom: 0;
5765    pointer-events: none;
5766    opacity: 0;
5767    background-color: ${({tokens:e})=>e.theme.overlay};
5768    backdrop-filter: blur(0px);
5769    transition:
5770      opacity ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
5771      backdrop-filter ${({durations:e})=>e.lg}
5772        ${({easings:e})=>e["ease-out-power-2"]};
5773    will-change: opacity;
5774  }
5775
5776  :host(.open) {
5777    opacity: 1;
5778    backdrop-filter: blur(8px);
5779  }
5780
5781  :host(.appkit-modal) {
5782    position: relative;
5783    pointer-events: unset;
5784    background: none;
5785    width: 100%;
5786    opacity: 1;
5787  }
5788
5789  wui-card {
5790    max-width: var(--apkt-modal-width);
5791    width: 100%;
5792    position: relative;
5793    outline: none;
5794    transform: translateY(4px);
5795    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.05);
5796    transition:
5797      transform ${({durations:e})=>e.lg}
5798        ${({easings:e})=>e["ease-out-power-2"]},
5799      border-radius ${({durations:e})=>e.lg}
5800        ${({easings:e})=>e["ease-out-power-1"]},
5801      background-color ${({durations:e})=>e.lg}
5802        ${({easings:e})=>e["ease-out-power-1"]},
5803      box-shadow ${({durations:e})=>e.lg}
5804        ${({easings:e})=>e["ease-out-power-1"]};
5805    will-change: border-radius, background-color, transform, box-shadow;
5806    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5807    padding: var(--local-modal-padding);
5808    box-sizing: border-box;
5809  }
5810
5811  :host(.open) wui-card {
5812    transform: translateY(0px);
5813  }
5814
5815  wui-card::before {
5816    z-index: 1;
5817    pointer-events: none;
5818    content: '';
5819    position: absolute;
5820    inset: 0;
5821    border-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
5822    transition: box-shadow ${({durations:e})=>e.lg}
5823      ${({easings:e})=>e["ease-out-power-2"]};
5824    transition-delay: ${({durations:e})=>e.md};
5825    will-change: box-shadow;
5826  }
5827
5828  :host([data-mobile-fullscreen='true']) wui-card::before {
5829    border-radius: 0px;
5830  }
5831
5832  :host([data-border='true']) wui-card::before {
5833    box-shadow: inset 0px 0px 0px 4px ${({tokens:e})=>e.theme.foregroundSecondary};
5834  }
5835
5836  :host([data-border='false']) wui-card::before {
5837    box-shadow: inset 0px 0px 0px 1px ${({tokens:e})=>e.theme.borderPrimaryDark};
5838  }
5839
5840  :host([data-border='true']) wui-card {
5841    animation:
5842      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
5843      card-background-border var(--apkt-duration-dynamic)
5844        ${({easings:e})=>e["ease-out-power-2"]};
5845    animation-fill-mode: backwards, both;
5846    animation-delay: var(--apkt-duration-dynamic);
5847  }
5848
5849  :host([data-border='false']) wui-card {
5850    animation:
5851      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
5852      card-background-default var(--apkt-duration-dynamic)
5853        ${({easings:e})=>e["ease-out-power-2"]};
5854    animation-fill-mode: backwards, both;
5855    animation-delay: 0s;
5856  }
5857
5858  :host(.appkit-modal) wui-card {
5859    max-width: var(--apkt-modal-width);
5860  }
5861
5862  wui-card[shake='true'] {
5863    animation:
5864      fade-in ${({durations:e})=>e.lg} ${({easings:e})=>e["ease-out-power-2"]},
5865      w3m-shake ${({durations:e})=>e.xl}
5866        ${({easings:e})=>e["ease-out-power-2"]};
5867  }
5868
5869  wui-flex {
5870    overflow-x: hidden;
5871    overflow-y: auto;
5872    display: flex;
5873    align-items: center;
5874    justify-content: center;
5875    width: 100%;
5876    height: 100%;
5877  }
5878
5879  @media (max-height: 700px) and (min-width: 431px) {
5880    wui-flex {
5881      align-items: flex-start;
5882    }
5883
5884    wui-card {
5885      margin: var(--apkt-spacing-6) 0px;
5886    }
5887  }
5888
5889  @media (max-width: 430px) {
5890    :host([data-mobile-fullscreen='true']) {
5891      height: 100dvh;
5892    }
5893    :host([data-mobile-fullscreen='true']) wui-flex {
5894      align-items: stretch;
5895    }
5896    :host([data-mobile-fullscreen='true']) wui-card {
5897      max-width: 100%;
5898      height: 100%;
5899      border-radius: 0;
5900      border: none;
5901    }
5902    :host(:not([data-mobile-fullscreen='true'])) wui-flex {
5903      align-items: flex-end;
5904    }
5905
5906    :host(:not([data-mobile-fullscreen='true'])) wui-card {
5907      max-width: 100%;
5908      border-bottom: none;
5909    }
5910
5911    :host(:not([data-mobile-fullscreen='true'])) wui-card[data-embedded='true'] {
5912      border-bottom-left-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
5913      border-bottom-right-radius: clamp(0px, var(--apkt-borderRadius-8), 44px);
5914    }
5915
5916    :host(:not([data-mobile-fullscreen='true'])) wui-card:not([data-embedded='true']) {
5917      border-bottom-left-radius: 0px;
5918      border-bottom-right-radius: 0px;
5919    }
5920
5921    wui-card[shake='true'] {
5922      animation: w3m-shake 0.5s ${({easings:e})=>e["ease-out-power-2"]};
5923    }
5924  }
5925
5926  @keyframes fade-in {
5927    0% {
5928      transform: scale(0.99) translateY(4px);
5929    }
5930    100% {
5931      transform: scale(1) translateY(0);
5932    }
5933  }
5934
5935  @keyframes w3m-shake {
5936    0% {
5937      transform: scale(1) rotate(0deg);
5938    }
5939    20% {
5940      transform: scale(1) rotate(-1deg);
5941    }
5942    40% {
5943      transform: scale(1) rotate(1.5deg);
5944    }
5945    60% {
5946      transform: scale(1) rotate(-1.5deg);
5947    }
5948    80% {
5949      transform: scale(1) rotate(1deg);
5950    }
5951    100% {
5952      transform: scale(1) rotate(0deg);
5953    }
5954  }
5955
5956  @keyframes card-background-border {
5957    from {
5958      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5959    }
5960    to {
5961      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5962    }
5963  }
5964
5965  @keyframes card-background-default {
5966    from {
5967      background-color: ${({tokens:e})=>e.theme.foregroundSecondary};
5968    }
5969    to {
5970      background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
5971    }
5972  }
5973`});var Ad,X3e,jYe,$i,Vz,zz,eve=h(()=>{le();Ue();Pr();st();He();U8e();Mr();j8e();C3e();
5973O3e();D3e();M3e();Lz();$z();Y3e();Q3e();Ad=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},X3e="scroll-lock",jYe={PayWithExchange:"0",PayWithExchangeSelectAsset:"0",Pay:"0",PayQuote:"0",PayLoading:"0"},$i=class extends ne{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.hasPrefetched=!1,this.enableEmbedded=W.state.enableEmbedded,this.open=Oe.state.open,this.caipAddress=k.state.activeCaipAddress,this.caipNetwork=k.state.activeCaipNetwork,this.shake=Oe.state.shake,this.filterByNamespace=X.state.filterByNamespace,this.padding=Ut.spacing[1],this.mobileFullScreen=W.state.enableMobileFullScreen,this.initializeTheming(),de.prefetchAnalyticsConfig(),this.unsubscribe.push(Oe.subscribeKey("open",t=>t?this.onOpen():this.onClose()),Oe.subscribeKey("shake",t=>this.shake=t),k.subscribeKey("activeCaipNetwork",t=>this.onNewNetwork(t)),k.subscribeKey("activeCaipAddress",t=>this.onNewAddress(t)),W.subscribeKey("enableEmbedded",t=>this.enableEmbedded=t),X.subscribeKey("filterByNamespace",t=>{this.filterByNamespace!==t&&!k.getAccountData(t)?.caipAddress&&(de.fetchRecommendedWallets(),this.filterByNamespace=t)}),Z.subscribeKey("view",()=>{this.dataset.border=x2.hasFooter()?"true":"false",this.padding=jYe[Z.state.view]??Ut.spacing[1]}))}firstUpdated(){if(this.dataset.border=x2.hasFooter()?"true":"false",this.mobileFullScreen&&this.setAttribute("data-mobile-fullscreen","true"),this.caipAddress){if(this.enableEmbedded){Oe.close(),this.prefetch();return}this.onNewAddress(this.caipAddress)}this.open&&this.onOpen(),this.enableEmbedded&&this.prefetch()}disconnectedCallback(){this.unsubscribe.forEach(t=>t()),this.onRemoveKeyboardListener()}render(){return this.style.setProperty("--local-modal-padding",this.padding),this.enableEmbedded?$`${this.contentTemplate()}
5974        <w3m-tooltip></w3m-tooltip> `:this.open?$`
5975          <wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
5976            ${this.contentTemplate()}
5977          </wui-flex>
5978          <w3m-tooltip></w3m-tooltip>
5979        `:null}contentTemplate(){return $` <wui-card
5980      shake="${this.shake}"
5981      data-embedded="${ve(this.enableEmbedded)}"
5982      role="alertdialog"
5983      aria-modal="true"
5984      tabindex="0"
5985      data-testid="w3m-modal-card"
5986    >
5987      <w3m-header></w3m-header>
5988      <w3m-router></w3m-router>
5989      <w3m-footer></w3m-footer>
5990      <w3m-snackbar></w3m-snackbar>
5991      <w3m-alertbar></w3m-alertbar>
5992    </wui-card>`}async onOverlayClick(t){if(t.target===t.currentTarget){if(this.mobileFullScreen)return;await this.handleClose()}}async handleClose(){await s3.safeClose()}initializeTheming(){let{themeVariables:t,themeMode:r}=Gr.state,n=pr.getColorTheme(r);aV(t,n)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),Ze.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){let t=document.createElement("style");t.dataset.w3m=X3e,t.textContent=`
5993      body {
5994        touch-action: none;
5995        overflow: hidden;
5996        overscroll-behavior: contain;
5997      }
5998      w3m-modal {
5999        pointer-events: auto;
6000      }
6001    `,document.head.appendChild(t)}onScrollUnlock(){let t=document.head.querySelector(`style[data-w3m="${X3e}"]`);t&&t.remove()}onAddKeyboardListener(){this.abortController=new AbortController;let t=this.shadowRoot?.querySelector("wui-card");t?.focus(),window.addEventListener("keydown",r=>{if(r.key==="Escape")this.handleClose();else if(r.key==="Tab"){let{tagName:n}=r.target;n&&!n.includes("W3M-")&&!n.includes("WUI-")&&t?.focus()}},this.abortController)}onRemoveKeyboardListener(){this.abortController?.abort(),this.abortController=void 0}async onNewAddress(t){let r=k.state.isSwitchingNamespace,n=Z.state.view==="ProfileWallets";!t&&!r&&!n&&Oe.close(),await ho.initializeIfEnabled(t),this.caipAddress=t,k.setIsSwitchingNamespace(!1)}onNewNetwork(t){let n=this.caipNetwork?.caipNetworkId?.toString(),o=t?.caipNetworkId?.toString(),s=n!==o,i=Z.state.view==="UnsupportedChain",a=Oe.state.open,c=!1;this.enableEmbedded&&Z.state.view==="SwitchNetwork"&&(c=!0),s&&et.resetState(),a&&i&&(c=!0),c&&Z.state.view!=="SIWXSignMessage"&&Z.goBack(),this.caipNetwork=t}prefetch(){this.hasPrefetched||(de.prefetch(),de.fetchWalletsByPage({page:1}),this.hasPrefetched=!0)}};$i.styles=J3e;Ad([V({type:Boolean})],$i.prototype,"enableEmbedded",void 0);Ad([ie()],$i.prototype,"open",void 0);Ad([ie()],$i.prototype,"caipAddress",void 0);Ad([ie()],$i.prototype,"caipNetwork",void 0);Ad([ie()],$i.prototype,"shake",void 0);Ad([ie()],$i.prototype,"filterByNamespace",void 0);Ad([ie()],$i.prototype,"padding",void 0);Ad([ie()],$i.prototype,"mobileFullScreen",void 0);Vz=class extends $i{};Vz=Ad([te("w3m-modal")],Vz);zz=class extends $i{};zz=Ad([te("appkit-modal")],zz)});var tve,rve=h(()=>{He();tve=ce`
6002  .icon-box {
6003    width: 64px;
6004    height: 64px;
6005    border-radius: ${({borderRadius:e})=>e[5]};
6006    background-color: ${({colors:e})=>e.semanticError010};
6007  }
6008`});var qYe,iP,nve=h(()=>{le();st();He();g5();Mr();mf();Mn();rve();qYe=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},iP=class extends ne{constructor(){super()}render(){return $`
6009      <wui-flex
6010        flexDirection="column"
6011        alignItems="center"
6012        gap="4"
6013        .padding="${["1","3","4","3"]}"
6014      >
6015        <wui-flex justifyContent="center" alignItems="center" class="icon-box">
6016          <wui-icon size="xxl" color="error" name="warningCircle"></wui-icon>
6017        </wui-flex>
6018
6019        <wui-text variant="lg-medium" color="primary" align="center">
6020          The app isn't responding as expected
6021        </wui-text>
6022        <wui-text variant="md-regular" color="secondary" align="center">
6023          Try again or reach out to the app team for help.
6024        </wui-text>
6025
6026        <wui-button
6027          variant="neutral-secondary"
6028          size="md"
6029          @click=${this.onTryAgainClick.bind(this)}
6030          data-testid="w3m-usage-exceeded-button"
6031        >
6032          <wui-icon color="inherit" slot="iconLeft" name="refresh"></wui-icon>
6033          Try Again
6034        </wui-button>
6035      </wui-flex>
6036    `}onTryAgainClick(){Z.goBack()}};iP.styles=tve;iP=qYe([te("w3m-usage-exceeded-view")],iP)});var ove,sve=h(()=>{He();ove=ce`
6037  :host {
6038    width: 100%;
6039  }
6040`});var Uo,Fn,ive=h(()=>{le();Ue();Pr();st();He();_V();sve();Uo=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Fn=class extends ne{constructor(){super(...arguments),this.hasImpressionSent=!1,this.walletImages=[],this.imageSrc="",this.name="",this.size="md",this.tabIdx=void 0,this.disabled=!1,this.showAllWallets=!1,this.loading=!1,this.loadingSpinnerColor="accent-100",this.rdnsId="",this.displayIndex=void 0,this.walletRank=void 0,this.namespaces=[]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.cleanupIntersectionObserver()}updated(t){super.updated(t),(t.has("name")||t.has("imageSrc")||t.has("walletRank"))&&(this.hasImpressionSent=!1),t.has("walletRank")&&this.walletRank&&!this.intersectionObserver&&this.setupIntersectionObserver()}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(r=>{r.isIntersecting&&!this.loading&&!this.hasImpressionSent&&this.sendImpressionEvent()})},{threshold:.1}),this.intersectionObserver.observe(this)}cleanupIntersectionObserver(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=void 0)}sendImpressionEvent(){!this.name||this.hasImpressionSent||!this.walletRank||(this.hasImpressionSent=!0,(this.rdnsId||this.name)&&xe.sendWalletImpressionEvent({name:this.name,walletRank:this.walletRank,rdnsId:this.rdnsId,view:Z.state.view,displayIndex:this.displayIndex}))}handleGetWalletNamespaces(){return Object.keys(gg.state.adapters).length>1?this.namespaces:[]}render(){return $`
6041      <wui-list-wallet
6042        .walletImages=${this.walletImages}
6043        imageSrc=${ve(this.imageSrc)}
6044        name=${this.name}
6045        size=${ve(this.size)}
6046        tagLabel=${ve(this.tagLabel)}
6047        .tagVariant=${this.tagVariant}
6048        .walletIcon=${this.walletIcon}
6049        .tabIdx=${this.tabIdx}
6050        .disabled=${this.disabled}
6051        .showAllWallets=${this.showAllWallets}
6052        .loading=${this.loading}
6053        loadingSpinnerColor=${this.loadingSpinnerColor}
6054        .namespaces=${this.handleGetWalletNamespaces()}
6055      ></wui-list-wallet>
6056    `}};Fn.styles=ove;Uo([V({type:Array})],Fn.prototype,"walletImages",void 0);Uo([V()],Fn.prototype,"imageSrc",void 0);Uo([V()],Fn.prototype,"name",void 0);Uo([V()],Fn.prototype,"size",void 0);Uo([V()],Fn.prototype,"tagLabel",void 0);Uo([V()],Fn.prototype,"tagVariant",void 0);Uo([V()],Fn.prototype,"walletIcon",void 0);Uo([V()],Fn.prototype,"tabIdx",void 0);Uo([V({type:Boolean})],Fn.prototype,"disabled",void 0);Uo([V({type:Boolean})],Fn.prototype,"showAllWallets",void 0);Uo([V({type:Boolean})],Fn.prototype,"loading",void 0);Uo([V({type:String})],Fn.prototype,"loadingSpinnerColor",void 0);Uo([V()],Fn.prototype,"rdnsId",void 0);Uo([V()],Fn.prototype,"displayIndex",void 0);Uo([V()],Fn.prototype,"walletRank",void 0);Uo([V({type:Array})],Fn.prototype,"namespaces",void 0);Fn=Uo([te("w3m-list-wallet")],Fn)});var ave,cve=h(()=>{He();ave=ce`
6057  :host {
6058    --local-duration-height: 0s;
6059    --local-duration: ${({durations:e})=>e.lg};
6060    --local-transition: ${({easings:e})=>e["ease-out-power-2"]};
6061  }
6062
6063  .container {
6064    display: block;
6065    overflow: hidden;
6066    overflow: hidden;
6067    position: relative;
6068    height: var(--local-container-height);
6069    transition: height var(--local-duration-height) var(--local-transition);
6070    will-change: height, padding-bottom;
6071  }
6072
6073  .container[data-mobile-fullscreen='true'] {
6074    overflow: scroll;
6075  }
6076
6077  .page {
6078    position: absolute;
6079    top: 0;
6080    left: 0;
6081    right: 0;
6082    width: 100%;
6083    height: auto;
6084    width: inherit;
6085    box-sizing: border-box;
6086    display: flex;
6087    flex-direction: column;
6088    background-color: ${({tokens:e})=>e.theme.backgroundPrimary};
6089    border-bottom-left-radius: var(--local-border-bottom-radius);
6090    border-bottom-right-radius: var(--local-border-bottom-radius);
6091    transition: border-bottom-left-radius var(--local-duration) var(--local-transition);
6092  }
6093
6094  .page[data-mobile-fullscreen='true'] {
6095    height: 100%;
6096  }
6097
6098  .page-content {
6099    display: flex;
6100    flex-direction: column;
6101    min-height: 100%;
6102  }
6103
6104  .footer {
6105    height: var(--apkt-footer-height);
6106  }
6107
6108  div.page[view-direction^='prev-'] .page-content {
6109    animation:
6110      slide-left-out var(--local-duration) forwards var(--local-transition),
6111      slide-left-in var(--local-duration) forwards var(--local-transition);
6112    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
6113  }
6114
6115  div.page[view-direction^='next-'] .page-content {
6116    animation:
6117      slide-right-out var(--local-duration) forwards var(--local-transition),
6118      slide-right-in var(--local-duration) forwards var(--local-transition);
6119    animation-delay: 0ms, var(--local-duration, ${({durations:e})=>e.lg});
6120  }
6121
6122  @keyframes slide-left-out {
6123    from {
6124      transform: translateX(0px) scale(1);
6125      opacity: 1;
6126      filter: blur(0px);
6127    }
6128    to {
6129      transform: translateX(8px) scale(0.99);
6130      opacity: 0;
6131      filter: blur(4px);
6132    }
6133  }
6134
6135  @keyframes slide-left-in {
6136    from {
6137      transform: translateX(-8px) scale(0.99);
6138      opacity: 0;
6139      filter: blur(4px);
6140    }
6141    to {
6142      transform: translateX(0) translateY(0) scale(1);
6143      opacity: 1;
6144      filter: blur(0px);
6145    }
6146  }
6147
6148  @keyframes slide-right-out {
6149    from {
6150      transform: translateX(0px) scale(1);
6151      opacity: 1;
6152      filter: blur(0px);
6153    }
6154    to {
6155      transform: translateX(-8px) scale(0.99);
6156      opacity: 0;
6157      filter: blur(4px);
6158    }
6159  }
6160
6161  @keyframes slide-right-in {
6162    from {
6163      transform: translateX(8px) scale(0.99);
6164      opacity: 0;
6165      filter: blur(4px);
6166    }
6167    to {
6168      transform: translateX(0) translateY(0) scale(1);
6169      opacity: 1;
6170      filter: blur(0px);
6171    }
6172  }
6173`});var Cd,WYe,Ia,lve=h(()=>{le();Ue();Pr();st();He();cve();Cd=function(e,t,r,n){var o=arguments.length,s=o<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},WYe=60,Ia=class extends ne{constructor(){super(...arguments),this.resizeObserver=void 0,this.transitionDuration="0.15s",this.transitionFunction="",this.history="",this.view="",this.setView=void 0,this.viewDirection="",this.historyState="",this.previousHeight="0px",this.mobileFullScreen=W.state.enableMobileFullScreen,this.onViewportResize=()=>{this.updateContainerHeight()}}updated(t){if(t.has("history")){let r=this.history;this.historyState!==""&&this.historyState!==r&&this.onViewChange(r)}t.has("transitionDuration")&&this.style.setProperty("--local-duration",this.transitionDuration),t.has("transitionFunction")&&this.style.setProperty("--local-transition",this.transitionFunction)}firstUpdated(){this.transitionFunction&&this.style.setProperty("--local-transition",this.transitionFunction),this.style.setProperty("--local-duration",this.transitionDuration),this.historyState=this.history,this.resizeObserver=new ResizeObserver(t=>{for(let r of t)if(r.target===this.getWrapper()){let n=r.contentRect.height,o=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0");
6173if(this.mobileFullScreen){let s=window.visualViewport?.height||window.innerHeight,i=this.getHeaderHeight();n=s-i-o,this.style.setProperty("--local-border-bottom-radius","0px")}else n=n+o,this.style.setProperty("--local-border-bottom-radius",o?"var(--apkt-borderRadius-5)":"0px");this.style.setProperty("--local-container-height",`${n}px`),this.previousHeight!=="0px"&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${n}px`}}),this.resizeObserver.observe(this.getWrapper()),this.updateContainerHeight(),window.addEventListener("resize",this.onViewportResize),window.visualViewport?.addEventListener("resize",this.onViewportResize)}disconnectedCallback(){let t=this.getWrapper();t&&this.resizeObserver&&this.resizeObserver.unobserve(t),window.removeEventListener("resize",this.onViewportResize),window.visualViewport?.removeEventListener("resize",this.onViewportResize)}render(){return $`
6174      <div class="container" data-mobile-fullscreen="${ve(this.mobileFullScreen)}">
6175        <div
6176          class="page"
6177          data-mobile-fullscreen="${ve(this.mobileFullScreen)}"
6178          view-direction="${this.viewDirection}"
6179        >
6180          <div class="page-content">
6181            <slot></slot>
6182          </div>
6183        </div>
6184      </div>
6185    `}onViewChange(t){let r=t.split(",").filter(Boolean),n=this.historyState.split(",").filter(Boolean),o=n.length,s=r.length,i=r[r.length-1]||"",a=pr.cssDurationToNumber(this.transitionDuration),c="";s>o?c="next":s<o?c="prev":s===o&&r[s-1]!==n[o-1]&&(c="next"),this.viewDirection=`${c}-${i}`,setTimeout(()=>{this.historyState=t,this.setView?.(i)},a),setTimeout(()=>{this.viewDirection=""},a*2)}getWrapper(){return this.shadowRoot?.querySelector("div.page")}updateContainerHeight(){let t=this.getWrapper();if(!t)return;let r=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--apkt-footer-height")||"0"),n=0;if(this.mobileFullScreen){let o=window.visualViewport?.height||window.innerHeight,s=this.getHeaderHeight();n=o-s-r,this.style.setProperty("--local-border-bottom-radius","0px")}else n=t.getBoundingClientRect().height+r,this.style.setProperty("--local-border-bottom-radius",r?"var(--apkt-borderRadius-5)":"0px");this.style.setProperty("--local-container-height",`${n}px`),this.previousHeight!=="0px"&&this.style.setProperty("--local-duration-height",this.transitionDuration),this.previousHeight=`${n}px`}getHeaderHeight(){return WYe}};Ia.styles=[ave];Cd([V({type:String})],Ia.prototype,"transitionDuration",void 0);Cd([V({type:String})],Ia.prototype,"transitionFunction",void 0);Cd([V({type:String})],Ia.prototype,"history",void 0);Cd([V({type:String})],Ia.prototype,"view",void 0);Cd([V({attribute:!1})],Ia.prototype,"setView",void 0);Cd([ie()],Ia.prototype,"viewDirection",void 0);Cd([ie()],Ia.prototype,"historyState",void 0);Cd([ie()],Ia.prototype,"previousHeight",void 0);Cd([ie()],Ia.prototype,"mobileFullScreen",void 0);Ia=Cd([te("w3m-router-container")],Ia)});var uve={};Ce(uve,{AppKitModal:()=>zz,W3mListWallet:()=>Fn,W3mModal:()=>Vz,W3mModalBase:()=>$i,W3mRouterContainer:()=>Ia,W3mUsageExceededView:()=>iP});var dve=h(()=>{eve();nve();ive();lve()});var pve,q5,fve=h(()=>{st();Age();pve=!1,q5=class extends u7{async open(t){X.isConnected()||await super.open(t)}async close(){if(await super.close(),this.options.manualWCControl){let t=k.getAccountData(this.activeChainNamespace)?.address;J.finalizeWcConnection(t)}}async syncIdentity(t){return Promise.resolve()}async syncBalance(t){return Promise.resolve()}async injectModalUi(){if(!pve&&ee.isClient()){if(await Promise.resolve().then(()=>(O8e(),R8e)),await Promise.resolve().then(()=>(dve(),uve)),!document.querySelector("w3m-modal")){let r=document.createElement("w3m-modal");!W.state.disableAppend&&!W.state.enableEmbedded&&document.body.insertAdjacentElement("beforeend",r)}pve=!0}}}});var hve,mve=h(()=>{hve="1.8.19"});var gve={};Ce(gve,{AppKit:()=>q5,createAppKit:()=>KYe});function KYe(e){return new q5({...e,basic:!0,sdkVersion:`html-core-${hve}`})}var yve=h(()=>{fve();mve()});var wve=Lt(Cs(),1);dP();var Gd=Lt(Sd(),1),vc=Lt(_2(),1),JG=Lt(wP(),1);var oE=BigInt(4294967295),Ij=BigInt(32);function bP(e,t=!1){return t?{h:Number(e&oE),l:Number(e>>Ij&oE)}:{h:Number(e>>Ij&oE)|0,l:Number(e&oE)|0}}function sE(e,t=!1){let r=e.length,n=new Uint32Array(r),o=new Uint32Array(r);for(let s=0;s<r;s++){let{h:i,l:a}=bP(e[s],t);[n[s],o[s]]=[i,a]}return[n,o]}var xP=(e,t,r)=>e>>>r,vP=(e,t,r)=>e<<32-r|t>>>r,hl=(e,t,r)=>e>>>r|t<<32-r,ml=(e,t,r)=>e<<32-r|t>>>r,Sm=(e,t,r)=>e<<64-r|t>>>r-32,Im=(e,t,r)=>e>>>r-32|t<<64-r,Tj=(e,t)=>t,_j=(e,t)=>e,Pj=(e,t,r)=>e<<r|t>>>32-r,Nj=(e,t,r)=>t<<r|e>>>32-r,Rj=(e,t,r)=>t<<r-32|e>>>64-r,Oj=(e,t,r)=>e<<r-32|t>>>64-r;function Fi(e,t,r,n){let o=(t>>>0)+(n>>>0);return{h:e+r+(o/2**32|0)|0,l:o|0}}var tx=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),rx=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Bj=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),kj=(e,t,r,n,o)=>t+r+n+o+(e/2**32|0)|0,Dj=(e,t,r,n,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(o>>>0),Uj=(e,t,r,n,o,s)=>t+r+n+o+s+(e/2**32|0)|0;var Tm=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function Td(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Lo(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function mn(e,...t){if(!Td(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function _m(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Lo(e.outputLen),Lo(e.blockLen)}function Ta(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function P2(e,t){mn(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Pm(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Qn(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function iE(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function gc(e,t){return e<<32-t|e>>>t}var Hj=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function $j(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}var yl=Hj?e=>e:e=>$j(e);function N5e(e){for(let t=0;t<e.length;t++)e[t]=$j(e[t]);return e}var wl=Hj?e=>e:N5e,Fj=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",R5e=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function _a(e){if(mn(e),Fj)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=R5e[e[r]];return t}var Id={_0:48,_9:57,A:65,F:70,a:97,f:102};function Mj(e){if(e>=Id._0&&e<=Id._9)return e-Id._0;if(e>=Id.A&&e<=Id.F)return e-(Id.A-10);if(e>=Id.a&&e<=Id.f)return e-(Id.a-10)}function Nm(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(Fj)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=Mj(e.charCodeAt(s)),a=Mj(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function EP(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Mo(e){return typeof e=="string"&&(e=EP(e)),mn(e),e}function bo(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];mn(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}var gl=class{};function Rm(e){let t=n=>
vendor: 7,737 bytes, lines 6185-6186
6185e().update(Mo(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Vj(e){let t=(n,o)=>e(o).update(Mo(n)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}function Ss(e=32){if(Tm&&typeof Tm.getRandomValues=="function")return Tm.getRandomValues(new Uint8Array(e));if(Tm&&typeof Tm.randomBytes=="function")return Uint8Array.from(Tm.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}var O5e=BigInt(0),nx=BigInt(1),B5e=BigInt(2),k5e=BigInt(7),D5e=BigInt(256),U5e=BigInt(113),qj=[],Wj=[],Kj=[];for(let e=0,t=nx,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],qj.push(2*(5*n+r)),Wj.push((e+1)*(e+2)/2%64);let o=O5e;for(let s=0;s<7;s++)t=(t<<nx^(t>>k5e)*U5e)%D5e,t&B5e&&(o^=nx<<(nx<<BigInt(s))-nx);Kj.push(o)}var Zj=sE(Kj,!0),L5e=Zj[0],M5e=Zj[1],zj=(e,t,r)=>r>32?Rj(e,t,r):Pj(e,t,r),jj=(e,t,r)=>r>32?Oj(e,t,r):Nj(e,t,r);function H5e(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let i=0;i<10;i++)r[i]=e[i]^e[i+10]^e[i+20]^e[i+30]^e[i+40];for(let i=0;i<10;i+=2){let a=(i+8)%10,c=(i+2)%10,l=r[c],u=r[c+1],d=zj(l,u,1)^r[a],p=jj(l,u,1)^r[a+1];for(let f=0;f<50;f+=10)e[i+f]^=d,e[i+f+1]^=p}let o=e[2],s=e[3];for(let i=0;i<24;i++){let a=Wj[i],c=zj(o,s,a),l=jj(o,s,a),u=qj[i];o=e[u],s=e[u+1],e[u]=c,e[u+1]=l}for(let i=0;i<50;i+=10){for(let a=0;a<10;a++)r[a]=e[i+a];for(let a=0;a<10;a++)e[i+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=L5e[n],e[1]^=M5e[n]}Qn(r)}var AP=class e extends gl{constructor(t,r,n,o=!1,s=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=s,Lo(n),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Pm(this.state)}clone(){return this._cloneInto()}keccak(){wl(this.state32),H5e(this.state32,this.rounds),wl(this.state32),this.posOut=0,this.pos=0}update(t){Ta(this),t=Mo(t),mn(t);let{blockLen:r,state:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(r-this.pos,o-s);for(let a=0;a<i;a++)n[this.pos++]^=t[s++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:n,blockLen:o}=this;t[n]^=r,(r&128)!==0&&n===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){Ta(this,!1),mn(t),this.finish();let r=this.state,{blockLen:n}=this;for(let o=0,s=t.length;o<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-o);t.set(r.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return Lo(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(P2(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Qn(this.state)}_cloneInto(t){let{blockLen:r,suffix:n,outputLen:o,rounds:s,enableXOF:i}=this;return t||(t=new e(r,n,o,i,s)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=s,t.suffix=n,t.outputLen=o,t.enableXOF=i,t.destroyed=this.destroyed,t}},$5e=(e,t,r)=>Rm(()=>new AP(t,e,r));var aE=$5e(1,136,256/8);var Gj="0.1.1";function Yj(){return Gj}var er=class e extends Error{constructor(t,r={}){let n=(()=>{if(r.cause instanceof e){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:r.cause?.message?r.cause.message:r.details})(),o=r.cause instanceof e&&r.cause.docsPath||r.docsPath,i=`https://oxlib.sh${o??""}`,a=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||o?["",n?`Details: ${n}`:void 0,o?`See: ${i}`:void 0]:[]].filter(c=>typeof c=="string").join(`
6186`);super(a,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${Yj()}`}),this.cause=r.cause,this.details=n,this.docs=i,this.docsPath=o,this.shortMessage=t}walk(t){return Jj(this,t)}};function Jj(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Jj(e.cause,t):t?null:e}function F5e(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);let o=BigInt(32),s=BigInt(4294967295),i=Number(r>>o&s),a=Number(r&s),c=n?4:0,l=n?0:4;e.setUint32(t+c,i,n),e.setUint32(t+l,a,n)}function Qj(e,t,r){return e&t^~e&r}function Xj(e,t,r){return e&t^e&r^t&r}var ox=class extends gl{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=iE(this.buffer)}update(t){Ta(this),t=Mo(t),mn(t);let{view:r,buffer:n,blockLen:o}=this,s=t.length;for(let i=0;i<s;){let a=Math.min(o-this.pos,s-i);if(a===o){let c=iE(t);for(;o<=s-i;i+=o)this.process(c,i);continue}n.set(t.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Ta(this),P2(t,this),this.finished=!0;let{buffer:r,view:n,blockLen:o,isLE:s}=this,{pos:i}=this;r[i++]=128,Qn(this.buffer.subarray(i)),this.padOffset>o-i&&(this.process(n,0),i=0);for(let d=i;d<o;d++)r[d]=0;F5e(n,o-8,BigInt(this.length*8),s),this.process(n,0);let a=iE(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let l=c/4,u=this.get();if(l>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)a.setUint32(4*d,u[d],s)}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:r,buffer:n,length:o,finished:s,destroyed:i,pos:a}=this;return t.destroyed=i,t.finished=s,t.length=o,t.pos=a,o%r&&t.buffer.set(n),t}clone(){return this._cloneInto()}},_d=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var xo=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),vo=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var V5e=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756
vendor: 2,003 bytes, line 6186
6186734187,3204031479,3329325298]),Af=new Uint32Array(64),cE=class extends ox{constructor(t=32){super(64,t,8,!1),this.A=_d[0]|0,this.B=_d[1]|0,this.C=_d[2]|0,this.D=_d[3]|0,this.E=_d[4]|0,this.F=_d[5]|0,this.G=_d[6]|0,this.H=_d[7]|0}get(){let{A:t,B:r,C:n,D:o,E:s,F:i,G:a,H:c}=this;return[t,r,n,o,s,i,a,c]}set(t,r,n,o,s,i,a,c){this.A=t|0,this.B=r|0,this.C=n|0,this.D=o|0,this.E=s|0,this.F=i|0,this.G=a|0,this.H=c|0}process(t,r){for(let d=0;d<16;d++,r+=4)Af[d]=t.getUint32(r,!1);for(let d=16;d<64;d++){let p=Af[d-15],f=Af[d-2],m=gc(p,7)^gc(p,18)^p>>>3,g=gc(f,17)^gc(f,19)^f>>>10;Af[d]=g+Af[d-7]+m+Af[d-16]|0}let{A:n,B:o,C:s,D:i,E:a,F:c,G:l,H:u}=this;for(let d=0;d<64;d++){let p=gc(a,6)^gc(a,11)^gc(a,25),f=u+p+Qj(a,c,l)+V5e[d]+Af[d]|0,g=(gc(n,2)^gc(n,13)^gc(n,22))+Xj(n,o,s)|0;u=l,l=c,c=a,a=i+f|0,i=s,s=o,o=n,n=f+g|0}n=n+this.A|0,o=o+this.B|0,s=s+this.C|0,i=i+this.D|0,a=a+this.E|0,c=c+this.F|0,l=l+this.G|0,u=u+this.H|0,this.set(n,o,s,i,a,c,l,u)}roundClean(){Qn(Af)}destroy(){this.set(0,0,0,0,0,0,0,0),Qn(this.buffer)}};var eq=sE(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e3585
61865771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),z5e=eq[0],j5e=eq[1],Cf=new Uint32Array(80),Sf=new Uint32Array(80),sx=class extends ox{constructor(t=64){super(128,t,16,!1),this.Ah=vo[0]|0,this.Al=vo[1]|0,this.Bh=vo[2]|0,this.Bl=vo[3]|0,this.Ch=vo[4]|0,this.Cl=vo[5]|0,this.Dh=vo[6]|0,this.Dl=vo[7]|0,this.Eh=vo[8]|0,this.El=vo[9]|0,this.Fh=vo[10]|0,this.Fl=vo[11]|0,this.Gh=vo[12]|0,this.Gl=vo[13]|0,this.Hh=vo[14]|0,this.Hl=vo[15]|0}get(){let{Ah:t,Al:r,Bh:n,Bl:o,Ch:s,Cl:i,Dh:a,Dl:c,Eh:l,El:u,Fh:d,Fl:p,Gh:f,Gl:m,Hh:g,Hl:y}=this;return[t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y]}set(t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=o|0,this.Ch=s|0,this.Cl=i|0,this.Dh=a|0,this.Dl=c|0,this.Eh=l|0,this.El=u|0,this.Fh=d|0,this.Fl=p|0,this.Gh=f|0,this.Gl=m|0,this.Hh=g|0,this.Hl=y|0}process(t,r){for(let w=0;w<16;w++,r+=4)Cf[w]=t.getUint32(r),Sf[w]=t.getUint32(r+=4);for(let w=16;w<80;w++){let x=Cf[w-15]|0,S=Sf[w-15]|0,P=hl(x,S,1)^hl(x,S,8)^xP(x,S,7),D=ml(x,S,1)^ml(x,S,8)^vP(x,S,7),U=Cf[w-2]|0,N=Sf[w-2]|0,L=hl(U,N,19)^Sm(U,N,61)^xP(U,N,6),I=ml(U,N,19)^Im(U,N,61)^vP(U,N,6),R=Bj(D,I,Sf[w-7],Sf[w-16]),A=kj(R,P,L,Cf[w-7],Cf[w-16]);Cf[w]=A|0,Sf[w]=R|0}let{Ah:n,Al:o,Bh:s,Bl:i,Ch:a,Cl:c,Dh:l,Dl:u,Eh:d,El:p,Fh:f,Fl:m,Gh:g,Gl:y,Hh:b,Hl:C}=this;for(let w=0;w<80;w++){let x=hl(d,p,14)^hl(d,p,18)^Sm(d,p,41),S=ml(d,p,14)^ml(d,p,18)^Im(d,p,41),P=d&f^~d&g,D=p&m^~p&y,U=Dj(C,S,D,j5e[w],Sf[w]),N=Uj(U,b,x,P,z5e[w],Cf[w]),L=U|0,I=hl(n,o,28)^Sm(n,o,34)^Sm(n,o,39),R=ml(n,o,28)^Im(n,o,34)^Im(n,o,39),A=n&s^n&a^s&a,T=o&i^o&c^i&c;b=g|0,C=y|0,g=f|0,y=m|0,f=d|0,m=p|0,{h:d,l:p}=Fi(l|0,u|0,N|0,L|0),l=a|0,u=c|0,a=s|0,c=i|0,s=n|0,i=o|0;let v=tx(L,R,T);n=rx(v,N,I,A),o=v|0}({h:n,l:o}=Fi(this.Ah|0,this.Al|0,n|0,o|0)),{h:s,l:i}=Fi(this.Bh|0,this.Bl|0,s|0,i|0),{h:a,l:c}=Fi(this.Ch|0,this.Cl|0,a|0,c|0),{h:l,l:u}=Fi(this.Dh|0,this.Dl|0,l|0,u|0),{h:d,l:p}=Fi(this.Eh|0,this.El|0,d|0,p|0),{h:f,l:m}=Fi(this.Fh|0,this.Fl|0,f|0,m|0),{h:g,l:y}=Fi(this.Gh|0,this.Gl|0,g|0,y|0),{h:b,l:C}=Fi(this.Hh|0,this.Hl|0,b|0,C|0),this.set(n,o,s,i,a,c,l,u,d,p,f,m,g,y,b,C)}roundClean(){Qn(Cf,Sf)}destroy(){Qn(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},CP=class extends sx{constructor(){super(48),this.Ah=xo[0]|0,this.Al=xo[1]|0,this.Bh=xo[2]|0,this.Bl=xo[3]|0,this.Ch=xo[4]|0,this.Cl=xo[5]|0,this.Dh=xo[6]|0,this.Dl=xo[7]|0,this.Eh=xo[8]|0,this.El=xo[9]|0,this.Fh=xo[10]|0,this.Fl=xo[11]|0,this.Gh=xo[12]|0,this.Gl=xo[13]|0,this.Hh=xo[14]|0,this.Hl=xo[15]|0}};var Ho=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);var SP=class extends sx{constructor(){super(32),this.Ah=Ho[0]|0,this.Al=Ho[
61861]|0,this.Bh=Ho[2]|0,this.Bl=Ho[3]|0,this.Ch=Ho[4]|0,this.Cl=Ho[5]|0,this.Dh=Ho[6]|0,this.Dl=Ho[7]|0,this.Eh=Ho[8]|0,this.El=Ho[9]|0,this.Fh=Ho[10]|0,this.Fl=Ho[11]|0,this.Gh=Ho[12]|0,this.Gl=Ho[13]|0,this.Hh=Ho[14]|0,this.Hl=Ho[15]|0}},Pd=Rm(()=>new cE);var lE=Rm(()=>new sx),tq=Rm(()=>new CP),rq=Rm(()=>new SP);var ix=Pd;var PP=BigInt(0),_P=BigInt(1);function R2(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function NP(e){if(!R2(e))throw new Error("Uint8Array expected")}function O2(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function ax(e){let t=e.toString(16);return t.length&1?"0"+t:t}function sq(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?PP:BigInt("0x"+e)}var iq=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",q5e=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function B2(e){if(NP(e),iq)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=q5e[e[r]];return t}var Nd={_0:48,_9:57,A:65,F:70,a:97,f:102};function nq(e){if(e>=Nd._0&&e<=Nd._9)return e-Nd._0;if(e>=Nd.A&&e<=Nd.F)return e-(Nd.A-10);if(e>=Nd.a&&e<=Nd.f)return e-(Nd.a-10)}function cx(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(iq)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let o=0,s=0;o<r;o++,s+=2){let i=nq(e.charCodeAt(s)),a=nq(e.charCodeAt(s+1));if(i===void 0||a===void 0){let c=e[s]+e[s+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+s)}n[o]=i*16+a}return n}function Rd(e){return sq(B2(e))}function RP(e){return NP(e),sq(B2(Uint8Array.from(e).reverse()))}function Om(e,t){return cx(e.toString(16).padStart(t*2,"0"))}function OP(e,t){return Om(e,t).reverse()}function ni(e,t,r){let n;if(typeof t=="string")try{n=cx(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(R2(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function lx(...e){let t=0;for(let n=0;n<e.length;n++){let o=e[n];NP(o),t+=o.length}let r=new Uint8Array(t);for(let n=0,o=0;n<e.length;n++){let s=e[n];r.set(s,o),o+=s.length}return r}var IP=e=>typeof e=="bigint"&&PP<=e;function uE(e,t,r){return IP(e)&&IP(t)&&IP(r)&&t<=e&&e<r}function Bm(e,t,r,n){if(!uE(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function aq(e){let t;for(t=0;e>PP;e>>=_P,t+=1);return t}var km=e=>(_P<<BigInt(e))-_P,TP=e=>new Uint8Array(e),oq=e=>Uint8Array.from(e);function cq(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=TP(e),o=TP(e),s=0,i=()=>{n.fill(1),o.fill(0),s=0},a=(...d)=>r(o,n,...d),c=(d=TP(0))=>{o=a(oq([0]),d),n=a(),d.length!==0&&(o=a(oq([1]),d),n=a())},l=()=>{if(s++>=1e3)throw new Error("drbg: tried 1000 values");let d=0,p=[];for(;d<t;){n=a();let f=n.slice();p.push(f),d+=n.length}return lx(...p)};return(d,p)=>{i(),c(d);let f;for(;!(f=p(l()));)c();return i(),f}}var W5e={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||R2(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function Dm(e,t,r={}){let n=(o,s,i)=>{let a=W5e[s];if(typeof a!="function")throw new Error("invalid validator function");let c=e[o];if(!(i&&c===void 0)&&!a(c,e))throw new Error("param "+String(o)+" is invalid. Expected "+s+", got "+c)};for(let[o,s]of Object.entries(t))n(o,s,!1);for(let[o,s]of Object.entries(r))n(o,s,!0);return e}function BP(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}function lq(e,t){if(kP(e)>t)throw new dE({givenSize:kP(e),maxSize:t})}var Od={zero:48,nine:57,A:65,F:70,a:97,f:102};function DP(e){if(e>=Od.zero&&e<=Od.nine)return e-Od.zero;if(e>=Od.A&&e<=Od.F)return e-(Od.A-10);if(e>=Od.a&&e<=Od.f)return e-(Od.a-10)}function uq(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new pE({size:e.length,targetSize:n,type:"Bytes"});let o=new Uint8Array(n);for(let s=0;s<n;s++){let i=r==="right";o[i?s:n-s-1]=e[i?s:e.length-s-1]}return o}function fE(e,t){if(Pa(e)>t)throw new hE({givenSize:Pa(e),maxSize:t})}function dq(e,t){if(typeof t=="number"&&t>0&&t>Pa(e)-1)throw new ux({offset:t,position:"start",size:Pa(e)})}function pq(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Pa(e)!==r-t)throw new ux({offset:r,position:"end",size:Pa(e)})}function UP(e,t={}){let{dir:r,size:n=32}=t;if(n===0)return e;let o=e.replace("0x","");if(o.length>n*2)throw new mE({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function fq(e,t={}){let{dir:r="left"}=t,n=e.replace("0x",""),o=0;for(let s=0;s<n.length-1&&n[r==="left"?s:n.length-s-1].toString()==="0";s++)o++;return n=r==="left"?n.slice(o):n.slice(0,n.length-o),n==="0"?"0x":r==="right"&&n.length%2===1?`0x${n}0`:`0x${n}`}var Z5e="#__bigint";function If(e,t,r){return JSON.stringify(e,(n,o)=>typeof t=="function"?t(n,o):typeof o=="bigint"?o.toString()+Z5e:o,r)}var G5e=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Y5e(e,t={}){let{strict:r=!1}=t;if(!e)throw new gE(e);if(typeof e!="string")throw new gE(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new yE(e);if(!e.startsWith("0x"))throw new yE(e)}function wE(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function bl(e){return e instanceof Uint8Array?Vi(e):Array.isArray(e)?Vi(new Uint8Array(e)):e}function Vi(e,t={}){let r="";for(let o=0;o<e.length;o++)r+=G5e[e[o]];let n=`0x${r}`;return typeof t.size=="number"?(fE(n,t.size),MP(n,t.size)):n}function zi(e,t={}){let{signed:r,size:n}=t,o=BigInt(e),s;n?r?s=(1n<<BigInt(n)*8n-1n)-1n:s=2n**(BigInt(n)*8n)-1n:typeof e=="number"&&(s=BigInt(Number.MAX_SAFE_INTEGER));let i=typeof s=="bigint"&&r?-s-1n:0;if(s&&o>s||o<i){let l=typeof e=="bigint"?"n":"";throw new LP({max:s?`${s}${l}`:void 0,min:`${i}${l}`,signed:r,size:n,value:`${e}${l}`})}let c=`0x${(r&&o<0?(1n<<BigInt(n*8))+BigInt(o):o).toString(16)}`;return n?J5e(c,n):c}function J5e(e,t){return UP(e,{dir:"left",size:t})}function MP(e,t){return UP(e,{dir:"right",size:t})}function yc(e,t,r,n={}){let{strict:o}=n;dq(e,t);let s=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return o&&pq(s,t,r),s}function Pa(e){return Math.ceil((e.length-2)/2)}function HP(e){return fq(e,{dir:"left"})}function $P(e,t={}){let{strict:r=!1}=t;try{return Y5e(e,{strict:r}),!0}catch{return!1}}var LP=class extends er{constructor({max:t,min:r,signed:n,size:o,value:s}){super(`Number \`${s}\` is not in safe${o?` ${o*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};var gE=class extends er{constructor(t){super(`Value \`${typeof t=="object"?If(t):t}\` of type \`${typeof t}
6186\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}},yE=class extends er{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}};var hE=class extends er{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},ux=class extends er{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},mE=class extends er{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};var Q5e=new TextEncoder;function X5e(e){if(!(e instanceof Uint8Array)){if(!e)throw new k2(e);if(typeof e!="object")throw new k2(e);if(!("BYTES_PER_ELEMENT"in e))throw new k2(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new k2(e)}}function D2(e){return e instanceof Uint8Array?e:typeof e=="string"?px(e):eEe(e)}function eEe(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function px(e,t={}){let{size:r}=t,n=e;r&&(fE(e,r),n=MP(e,r));let o=n.slice(2);o.length%2&&(o=`0${o}`);let s=o.length/2,i=new Uint8Array(s);for(let a=0,c=0;a<s;a++){let l=DP(o.charCodeAt(c++)),u=DP(o.charCodeAt(c++));if(l===void 0||u===void 0)throw new er(`Invalid byte sequence ("${o[c-2]}${o[c-1]}" in "${o}").`);i[a]=l*16+u}return i}function mq(e,t={}){let{size:r}=t,n=Q5e.encode(e);return typeof r=="number"?(lq(n,r),tEe(n,r)):n}function tEe(e,t){return uq(e,{dir:"right",size:t})}function kP(e){return e.length}function gq(e){try{return X5e(e),!0}catch{return!1}}var k2=class extends er{constructor(t){super(`Value \`${typeof t=="object"?If(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}},dE=class extends er{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}};var pE=class extends er{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};function FP(e,t={}){let{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=aE(D2(e));return r==="Bytes"?n:Vi(n)}var bE=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let n=this.keys().next().value;n&&this.delete(n)}return this}};var rEe={checksum:new bE(8192)},xE=rEe.checksum;function bq(e,t={}){let{compressed:r}=t,{prefix:n,x:o,y:s}=e;if(r===!1||typeof o=="bigint"&&typeof s=="bigint"){if(n!==4)throw new vE({prefix:n,cause:new jP});return}if(r===!0||typeof o=="bigint"&&typeof s>"u"){if(n!==3&&n!==2)throw new vE({prefix:n,cause:new zP});return}throw new VP({publicKey:e})}function WP(e){let t=(()=>{if($P(e))return xq(e);if(gq(e))return nEe(e);let{prefix:r,x:n,y:o}=e;return typeof n=="bigint"&&typeof o=="bigint"?{prefix:r??4,x:n,y:o}:{prefix:r,x:n}})();return bq(t),t}function nEe(e){return xq(Vi(e))}function xq(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new qP({publicKey:e});if(e.length===130){let n=BigInt(yc(e,0,32)),o=BigInt(yc(e,32,64));return{prefix:4,x:n,y:o}}if(e.length===132){let n=Number(yc(e,0,1)),o=BigInt(yc(e,1,33)),s=BigInt(yc(e,33,65));return{prefix:n,x:o,y:s}}let t=Number(yc(e,0,1)),r=BigInt(yc(e,1,33));return{prefix:t,x:r}}
6186function vq(e,t={}){return px(fx(e,t))}function fx(e,t={}){bq(e);let{prefix:r,x:n,y:o}=e,{includePrefix:s=!0}=t;return wE(s?zi(r,{size:1}):"0x",zi(n,{size:32}),typeof o=="bigint"?zi(o,{size:32}):"0x")}var VP=class extends er{constructor({publicKey:t}){super(`Value \`${If(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}},vE=class extends er{constructor({prefix:t,cause:r}){super(`Prefix "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}},zP=class extends er{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}},jP=class extends er{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}},qP=class extends er{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${Pa(bl(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};var oEe=/^0x[a-fA-F0-9]{40}$/;function EE(e,t={}){let{strict:r=!0}=t;if(!oEe.test(e))throw new AE({address:e,cause:new ZP});if(r){if(e.toLowerCase()===e)return;if(Eq(e)!==e)throw new AE({address:e,cause:new GP})}}function Eq(e){if(xE.has(e))return xE.get(e);EE(e,{strict:!1});let t=e.substring(2).toLowerCase(),r=FP(mq(t),{as:"Bytes"}),n=t.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&n[s]&&(n[s]=n[s].toUpperCase()),(r[s>>1]&15)>=8&&n[s+1]&&(n[s+1]=n[s+1].toUpperCase());let o=`0x${n.join("")}`;return xE.set(e,o),o}function sEe(e,t={}){let{checksum:r=!1}=t;return EE(e),r?Eq(e):e}function Aq(e,t={}){let r=FP(`0x${fx(e).slice(4)}`).substring(26);return sEe(`0x${r}`,t)}function Cq(e,t){return EE(e,{strict:!1}),EE(t,{strict:!1}),e.toLowerCase()===t.toLowerCase()}var AE=class extends er{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}},ZP=class extends er{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}},GP=class extends er{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}};var eQe=2n**(8n-1n)-1n,tQe=2n**(16n-1n)-1n,rQe=2n**(24n-1n)-1n,nQe=2n**(32n-1n)-1n,oQe=2n**(40n-1n)-1n,sQe=2n**(48n-1n)-1n,iQe=2n**(56n-1n)-1n,aQe=2n**(64n-1n)-1n,cQe=2n**(72n-1n)-1n,lQe=2n**(80n-1n)-1n,uQe=2n**(88n-1n)-1n,dQe=2n**(96n-1n)-1n,pQe=2n**(104n-1n)-1n,fQe=2n**(112n-1n)-1n,hQe=2n**(120n-1n)-1n,mQe=2n**(128n-1n)-1n,gQe=2n**(136n-1n)-1n,yQe=2n**(144n-1n)-1n,wQe=2n**(152n-1n)-1n,bQe=2n**(160n-1n)-1n,xQe=2n**(168n-1n)-1n,vQe=2n**(176n-1n)-1n,EQe=2n**(184n-1n)-1n,AQe=2n**(192n-1n)-1n,CQe=2n**(200n-1n)-1n,SQe=2n**(208n-1n)-1n,IQe=2n**(216n-1n)-1n,TQe=2n**(224n-1n)-1n,_Qe=2n**(232n-1n)-1n,PQe=2n**(240n-1n)-1n,NQe=2n**(248n-1n)-1n,RQe=2n**(256n-1n)-1n,OQe=-(2n**(8n-1n)),BQe=-(2n**(16n-1n)),kQe=-(2n**(24n-1n)),DQe=-(2n**(32n-1n)),UQe=-(2n**(40n-1n)),LQe=-(2n**(48n-1n)),MQe=-(2n**(56n-1n)),HQe=-(2n**(64n-1n)),$Qe=-(2n**(72n-1n)),FQe=-(2n**(80n-1n)),VQe=-(2n**(88n-1n)),zQe=-(2n**(96n-1n)),jQe=-(2n**(104n-1n)),qQe=-(2n**(112n-1n)),WQe=-(2n**(120n-1n)),KQe=-(2n**(128n-1n)),ZQe=-(2n**(136n-1n)),GQe=-(2n**(144n-1n)),YQe=-(2n**(152n-1n)),JQe=-(2n**(160n-1n)),QQe=-(2n**(168n-1n)),XQe=-(2n**(176n-1n)),eXe=-(2n**(184n-1n)),tXe=-(2n**(192n-1n)),rXe=-(2n**(200n-1n)),nXe=-(2n**(208n-1n)),oXe=-(2n**(216n-1n)),sXe=-(2n**(224n-1n)),iXe=-(2n**(232n-1n)),aXe=-(2n**(240n-1n)),cXe=-(2n**(248n-1n)),lXe=-(2n**(256n-1n)),uXe=2n**8n-1n,dXe=2n**16n-1n,pXe=2n**24n-1n,fXe=2n**32n-1n,hXe=2n**40n-1n,mXe=2n**48n-1n,gXe=2n**56n-1n,yXe=2n**64n-1n,wXe=2n**72n-1n,bXe=2n**80n-1n,xXe=2n**88n-1n,vXe=2n**96n-1n,EXe=2n**104n-1n,AXe=2n**112n-1n,CXe
vendor: 9,420 bytes, line 6186
6186=2n**120n-1n,SXe=2n**128n-1n,IXe=2n**136n-1n,TXe=2n**144n-1n,_Xe=2n**152n-1n,PXe=2n**160n-1n,NXe=2n**168n-1n,RXe=2n**176n-1n,OXe=2n**184n-1n,BXe=2n**192n-1n,kXe=2n**200n-1n,DXe=2n**208n-1n,UXe=2n**216n-1n,LXe=2n**224n-1n,MXe=2n**232n-1n,HXe=2n**240n-1n,$Xe=2n**248n-1n,YP=2n**256n-1n;var OE={};Ce(OE,{InvalidRError:()=>TE,InvalidSError:()=>_E,InvalidSerializedSizeError:()=>IE,InvalidVError:()=>PE,InvalidYParityError:()=>Hm,MissingPropertiesError:()=>U2,assert:()=>NE,extract:()=>EEe,from:()=>fN,fromBytes:()=>Wq,fromDerBytes:()=>AEe,fromDerHex:()=>Kq,fromHex:()=>pN,fromLegacy:()=>Zq,fromRpc:()=>Gq,fromTuple:()=>CEe,toBytes:()=>SEe,toDerBytes:()=>IEe,toDerHex:()=>TEe,toHex:()=>Yq,toLegacy:()=>_Ee,toRpc:()=>PEe,toTuple:()=>NEe,vToYParity:()=>RE,validate:()=>REe,yParityToV:()=>hN});var CE=class extends gl{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,_m(t);let n=Mo(r);if(this.iHash=t.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;let o=this.blockLen,s=new Uint8Array(o);s.set(n.length>o?t.create().update(n).digest():n);for(let i=0;i<s.length;i++)s[i]^=54;this.iHash.update(s),this.oHash=t.create();for(let i=0;i<s.length;i++)s[i]^=106;this.oHash.update(s),Qn(s)}update(t){return Ta(this),this.iHash.update(t),this}digestInto(t){Ta(this),mn(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:r,iHash:n,finished:o,destroyed:s,blockLen:i,outputLen:a}=this;return t=t,t.finished=o,t.destroyed=s,t.blockLen=i,t.outputLen=a,t.oHash=r._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},Tf=(e,t,r)=>new CE(e,t).update(r).digest();Tf.create=(e,t)=>new CE(e,t);var Is=BigInt(0),Fo=BigInt(1),Mm=BigInt(2),iEe=BigInt(3),_q=BigInt(4),Pq=BigInt(5),Nq=BigInt(8);function $o(e,t){let r=e%t;return r>=Is?r:t+r}function ji(e,t,r){let n=e;for(;t-- >Is;)n*=n,n%=r;return n}function SE(e,t){if(e===Is)throw new Error("invert: expected non-zero number");if(t<=Is)throw new Error("invert: expected positive modulus, got "+t);let r=$o(e,t),n=t,o=Is,s=Fo,i=Fo,a=Is;for(;r!==Is;){let l=n/r,u=n%r,d=o-i*l,p=s-a*l;n=r,r=u,o=i,s=a,i=d,a=p}if(n!==Fo)throw new Error("invert: does not exist");return $o(o,t)}function Rq(e,t){let r=(e.ORDER+Fo)/_q,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function aEe(e,t){let r=(e.ORDER-Pq)/Nq,n=e.mul(t,Mm),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,Mm),o),a=e.mul(s,e.sub(i,e.ONE));if(!e.eql(e.sqr(a),t))throw new Error("Cannot find square root");return a}function cEe(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-Fo,r=0;for(;t%Mm===Is;)t/=Mm,r++;let n=Mm,o=hx(e);for(;Tq(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return Rq;let s=o.pow(n,t),i=(t+Fo)/Mm;return function(c,l){if(c.is0(l))return l;if(Tq(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,s),p=c.pow(l,t),f=c.pow(l,i);for(;!c.eql(p,c.ONE);){if(c.is0(p))return c.ZERO;let m=1,g=c.sqr(p);for(;!c.eql(g,c.ONE);)if(m++,g=c.sqr(g),m===u)throw new Error("Cannot find square root");let y=Fo<<BigInt(u-m-1),b=c.pow(d,y);u=m,d=c.sqr(b),p=c.mul(p,d),f=c.mul(f,b)}return f}}function lEe(e){return e%_q===iEe?Rq:e%Nq===Pq?aEe:cEe(e)}var uEe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function JP(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=uEe.reduce((n,o)=>(n[o]="function",n),t);return Dm(e,r)}function dEe(e,t,r){if(r<Is)throw new Error("invalid exponent, negatives unsupported");if(r===Is)return e.ONE;if(r===Fo)return t;let n=e.ONE,o=t;for(;r>Is;)r&Fo&&(n=e.mul(n,o)),o=e.sqr(o),r>>=Fo;return n}function QP(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(n[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(n[c]=e.mul(i,n[c]),e.mul(i,a)),s),n}function Tq(e,t){let r=(e.ORDER-Fo)/Mm,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function XP(e,t){t!==void 0&&Lo(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function hx(e,t,r=!1,n={}){if(e<=Is)throw new Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=XP(e,t);if(s>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let i,a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:km(o),ZERO:Is,ONE:Fo,create:c=>$o(c,e),isValid:c=>{if(typeof c!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof c);return Is<=c&&c<e},is0:c=>c===Is,isOdd:c=>(c&Fo)===Fo,neg:c=>$o(-c,e),eql:(c,l)=>c===l,sqr:c=>$o(c*c,e),add:(c,l)=>$o(c+l,e),sub:(c,l)=>$o(c-l,e),mul:(c,l)=>$o(c*l,e),pow:(c,l)=>dEe(a,c,l),div:(c,l)=>$o(c*SE(l,e),e),sqrN:c=>c*c,addN:(c,l)=>c+l,subN:(c,l)=>c-l,mulN:(c,l)=>c*l,inv:c=>SE(c,e),sqrt:n.sqrt||(c=>(i||(i=lEe(e)),i(a,c))),toBytes:c=>r?OP(c,s):Om(c,s),fromBytes:c=>{if(c.length!==s)throw new Error("Field.fromBytes: expected "+s+" bytes, got "+c.length);return r?RP(c):Rd(c)},invertBatch:c=>QP(a,c),cmov:(c,l,u)=>u?l:c});return Object.freeze(a)}function Oq(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function eN(e){let t=Oq(e);return t+Math.ceil(t/2)}function Bq(e,t,r=!1){let n=e.length,o=Oq(t),s=eN(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);let i=r?RP(e):Rd(e),a=$o(i,t-Fo)+Fo;return r?OP(a,o):Om(a,o)}var kq=BigInt(0),sN=BigInt(1);function tN(e,t){let r=t.negate();return e?r:t}function Uq(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function rN(e,t){Uq(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,s=km(e),i=BigInt(e);return{windows:r,windowSize:n,mask:s,maxNumber:o,shiftBy:i}}function Dq(e,t,r){let{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r,a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=sN);let l=t*n,u=l+Math.abs(a)-1,d=a===0,p=a<0,f=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:l}}function pEe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function fEe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}var nN=new WeakMap,Lq=new WeakMap;function oN(e){return Lq.get(e)||1}function Mq(e,t){return{constTimeNegate:tN,hasPrecomputes(r){return oN(r)!==1},unsafeLadder(r,n,o=e.ZERO){let s=r;for(;n>kq;)n&sN&&(o=o.add(s)),s=s.double(),n>>=sN;return o},precomputeWindow(r,n){let{windows:o,windowSize:s}=rN(n,t),i=[],a=r,c=a;for(let l=0;l<o;l++){c=a,i.push(c);for(let u=1;u<s;u++)c=c.add(a),i.push(c);a=c.double()}return i},wNAF(r,n,o){let s=e.ZERO,i=e.BASE,a=rN(r,t);for(let c=0;c<a.windows;c++){let{nextN:l,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:m}=Dq(o,c,a);o=l,d?i=i.add(tN(f,n[m])):s=s.add(tN(p,n[u]))}return{p:s,f:i}},wNAFUnsafe(r,n,o,s=e.ZERO){let i=rN(r,t);for(let a=0;a<i.windows&&o!==kq;a++){let{nextN:c,offset:l,isZero:u,isNeg:d}=Dq(o,a,i);if(o=c,!u){let p=n[l];s=s.add(d?p.negate():p)}}return s},getPrecomputes(r,n,o){let s=nN.get(n);return s||(s=this.precomputeWindow(n,r),r!==1&&nN.set(n,o(s))),s},wNAFCached(r,n,o){let s=oN(r);return this.wNAF(s,this.getPrecomputes(s,r,o),n)},wNAFCachedUnsafe(r,n,o,s){let i=oN(r);return i===1?this.unsafeLadder(r,n,s):this.wNAFUnsafe(i,this.getPrecomputes(i,r,o),n,s)},setWindowSize(r,n){Uq(n,t),Lq.set(r,n),nN.delete(r)}}}function Hq(e,t,r,n){pEe(r,e),fEe(n,t);let o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");let i=e.ZERO,a=aq(BigInt(o)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=km(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c,p=i;for(let f=d;f>=0;f-=c){u.fill(i);for(let g=0;g<s;g++){let y=n[g],b=Number(y>>BigInt(f)&l);u[b]=u[b].add(r[g])}let m=i;for(let g=u.length-1,y=i;g>0;g--)y=y.add(u[g]),m=m.add(y);if(p=p.add(m),f!==0)for(let g=0;g<c;g++)p=p.double()}return p}function iN(e){return JP(e.Fp),Dm(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...XP(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function $q(e){e.lowS!==void 0&&O2("lowS",e.lowS),e.prehash!==void 0&&O2("prehash",e.prehash)}function hEe(e){let t=iN(e);Dm(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof r!="object"||typeof r.beta!="bigint"||typeof r.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}
vendor: 11,037 bytes, line 6186
6186var lN=class extends Error{constructor(t=""){super(t)}},Bd={Err:lN,_tlv:{encode:(e,t)=>{let{Err:r}=Bd;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=ax(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?ax(o.length/2|128):"";return ax(e)+s+o+t},decode(e,t){let{Err:r}=Bd,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],s=!!(o&128),i=0;if(!s)i=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=t.subarray(n,n+c);if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of l)i=i<<8|u;if(n+=c,i<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+i)}}},_int:{encode(e){let{Err:t}=Bd;if(e<kd)throw new t("integer: negative integers are not allowed");let r=ax(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=Bd;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Rd(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=Bd,o=ni("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=Bd,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),s=n+o;return t.encode(48,s)}};function aN(e,t){return B2(Om(e,t))}var kd=BigInt(0),Xn=BigInt(1),QXe=BigInt(2),cN=BigInt(3),mEe=BigInt(4);function gEe(e){let t=hEe(e),{Fp:r}=t,n=hx(t.n,t.nBitLength),o=t.toBytes||((w,x,S)=>{let P=x.toAffine();return lx(Uint8Array.from([4]),r.toBytes(P.x),r.toBytes(P.y))}),s=t.fromBytes||(w=>{let x=w.subarray(1),S=r.fromBytes(x.subarray(0,r.BYTES)),P=r.fromBytes(x.subarray(r.BYTES,2*r.BYTES));return{x:S,y:P}});function i(w){let{a:x,b:S}=t,P=r.sqr(w),D=r.mul(P,w);return r.add(r.add(D,r.mul(w,x)),S)}function a(w,x){let S=r.sqr(x),P=i(w);return r.eql(S,P)}if(!a(t.Gx,t.Gy))throw new Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,cN),mEe),l=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,l)))throw new Error("bad curve params: a or b");function u(w){return uE(w,Xn,t.n)}function d(w){let{allowedPrivateKeyLengths:x,nByteLength:S,wrapPrivateKey:P,n:D}=t;if(x&&typeof w!="bigint"){if(R2(w)&&(w=B2(w)),typeof w!="string"||!x.includes(w.length))throw new Error("invalid private key");w=w.padStart(S*2,"0")}let U;try{U=typeof w=="bigint"?w:Rd(ni("private key",w,S))}catch{throw new Error("invalid private key, expected hex or "+S+" bytes, got "+typeof w)}return P&&(U=$o(U,D)),Bm("private key",U,Xn,D),U}function p(w){if(!(w instanceof g))throw new Error("ProjectivePoint expected")}let f=BP((w,x)=>{let{px:S,py:P,pz:D}=w;if(r.eql(D,r.ONE))return{x:S,y:P};let U=w.is0();x==null&&(x=U?r.ONE:r.inv(D));let N=r.mul(S,x),L=r.mul(P,x),I=r.mul(D,x);if(U)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:N,y:L}}),m=BP(w=>{if(w.is0()){if(t.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}let{x,y:S}=w.toAffine();if(!r.isValid(x)||!r.isValid(S))throw new Error("bad point: x or y not FE");if(!a(x,S))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(x,S,P){if(x==null||!r.isValid(x))throw new Error("x required");if(S==null||!r.isValid(S)||r.is0(S))throw new Error("y required");if(P==null||!r.isValid(P))throw new Error("z required");this.px=x,this.py=S,this.pz=P,Object.freeze(this)}static fromAffine(x){let{x:S,y:P}=x||{};if(!x||!r.isValid(S)||!r.isValid(P))throw new Error("invalid affine point");if(x instanceof g)throw new Error("projective point not allowed");let D=U=>r.eql(U,r.ZERO);return D(S)&&D(P)?g.ZERO:new g(S,P,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){let S=QP(r,x.map(P=>P.pz));return x.map((P,D)=>P.toAffine(S[D])).map(g.fromAffine)}static fromHex(x){let S=g.fromAffine(s(ni("pointHex",x)));return S.assertValidity(),S}static fromPrivateKey(x){return g.BASE.multiply(d(x))}static msm(x,S){return Hq(g,n,x,S)}_setWindowSize(x){C.setWindowSize(this,x)}assertValidity(){m(this)}hasEvenY(){let{y:x}=this.toAffine();if(r.isOdd)return!r.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.eql(r.mul(S,L),r.mul(U,D)),R=r.eql(r.mul(P,L),r.mul(N,D));return I&&R}negate(){return new g(this.px,r.neg(this.py),this.pz)}double(){let{a:x,b:S}=t,P=r.mul(S,cN),{px:D,py:U,pz:N}=this,L=r.ZERO,I=r.ZERO,R=r.ZERO,A=r.mul(D,D),T=r.mul(U,U),v=r.mul(N,N),E=r.mul(D,U);return E=r.add(E,E),R=r.mul(D,N),R=r.add(R,R),L=r.mul(x,R),I=r.mul(P,v),I=r.add(L,I),L=r.sub(T,I),I=r.add(T,I),I=r.mul(L,I),L=r.mul(E,L),R=r.mul(P,R),v=r.mul(x,v),E=r.sub(A,v),E=r.mul(x,E),E=r.add(E,R),R=r.add(A,A),A=r.add(R,A),A=r.add(A,v),A=r.mul(A,E),I=r.add(I,A),v=r.mul(U,N),v=r.add(v,v),A=r.mul(v,E),L=r.sub(L,A),R=r.mul(v,T),R=r.add(R,R),R=r.add(R,R),new g(L,I,R)}add(x){p(x);let{px:S,py:P,pz:D}=this,{px:U,py:N,pz:L}=x,I=r.ZERO,R=r.ZERO,A=r.ZERO,T=t.a,v=r.mul(t.b,cN),E=r.mul(S,U),O=r.mul(P,N),B=r.mul(D,L),_=r.add(S,P),M=r.add(U,N);_=r.mul(_,M),M=r.add(E,O),_=r.sub(_,M),M=r.add(S,D);let F=r.add(U,L);return M=r.mul(M,F),F=r.add(E,B),M=r.sub(M,F),F=r.add(P,D),I=r.add(N,L),F=r.mul(F,I),I=r.add(O,B),F=r.sub(F,I),A=r.mul(T,M),I=r.mul(v,B),A=r.add(I,A),I=r.sub(O,A),A=r.add(O,A),R=r.mul(I,A),O=r.add(E,E),O=r.add(O,E),B=r.mul(T,B),M=r.mul(v,M),O=r.add(O,B),B=r.sub(E,B),B=r.mul(T,B),M=r.add(M,B),E=r.mul(O,M),R=r.add(R,E),E=r.mul(F,M),I=r.mul(_,I),I=r.sub(I,E),E=r.mul(_,O),A=r.mul(F,A),A=r.add(A,E),new g(I,R,A)}subtract(x){return this.add(x.negate())}is0(){return this.equals(g.ZERO)}wNAF(x){return C.wNAFCached(this,x,g.normalizeZ)}multiplyUnsafe(x){let{endo:S,n:P}=t;Bm("scalar",x,kd,P);let D=g.ZERO;if(x===kd)return D;if(this.is0()||x===Xn)return this;if(!S||C.hasPrecomputes(this))return C.wNAFCachedUnsafe(this,x,g.normalizeZ);let{k1neg:U,k1:N,k2neg:L,k2:I}=S.splitScalar(x),R=D,A=D,T=this;for(;N>kd||I>kd;)N&Xn&&(R=R.add(T)),I&Xn&&(A=A.add(T)),T=T.double(),N>>=Xn,I>>=Xn;return U&&(R=R.negate()),L&&(A=A.negate()),A=new g(r.mul(A.px,S.beta),A.py,A.pz),R.add(A)}multiply(x){let{endo:S,n:P}=t;Bm("scalar",x,Xn,P);let D,U;if(S){let{k1neg:N,k1:L,k2neg:I,k2:R}=S.splitScalar(x),{p:A,f:T}=this.wNAF(L),{p:v,f:E}=this.wNAF(R);A=C.constTimeNegate(N,A),v=C.constTimeNegate(I,v),v=new g(r.mul(v.px,S.beta),v.py,v.pz),D=A.add(v),U=T.add(E)}else{let{p:N,f:L}=this.wNAF(x);D=N,U=L}return g.normalizeZ([D,U])[0]}multiplyAndAddUnsafe(x,S,P){let D=g.BASE,U=(L,I)=>I===kd||I===Xn||!L.equals(D)?L.multiplyUnsafe(I):L.multiply(I),N=U(this,S).add(U(x,P));return N.is0()?void 0:N}toAffine(x){return f(this,x)}isTorsionFree(){let{h:x,isTorsionFree:S}=t;if(x===Xn)return!0;if(S)return S(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:x,clearCofactor:S}=t;return x===Xn?this:S?S(g,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return O2("isCompressed",x),this.assertValidity(),o(g,this,x)}toHex(x=!0){return O2("isCompressed",x),B2(this.toRawBytes(x))}}g.BASE=new g(t.Gx,t.Gy,r.ONE),g.ZERO=new g(r.ZERO,r.ONE,r.ZERO);let{endo:y,nBitLength:b}=t,C=Mq(g,y?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:d,weierstrassEquation:i,isWithinCurveOrder:u}}function yEe(e){let t=iN(e);return Dm(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function Fq(e){let t=yEe(e),{Fp:r,n,nByteLength:o,nBitLength:s}=t,i=r.BYTES+1,a=2*r.BYTES+1;function c(v){return $o(v,n)}function l(v){return SE(v,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:d,weierstrassEquation:p,isWithinCurveOrder:f}=gEe({...t,toBytes(v,E,O){let B=E.toAffine(),_=r.toBytes(B.x),M=lx;return O2("isCompressed",O),O?M(Uint8Array.from([E.hasEvenY()?2:3]),_):M(Uint8Array.from([4]),_,r.toBytes(B.y))},fromBytes(v){let E=v.length,O=v[0],B=v.subarray(1);if(E===i&&(O===2||O===3)){let _=Rd(B);if(!uE(_,Xn,r.ORDER))throw new Error("Point is not on curve");let M=p(_),F;try{F=r.sqrt(M)}catch(Q){let Y=Q instanceof Error?": "+Q.message:"";throw new Error("Point is not on curve"+Y)}let q=(F&Xn)===Xn;return(O&1)===1!==q&&(F=r.neg(F)),{x:_,y:F}}else if(E===a&&O===4){let _=r.fromBytes(B.subarray(0,r.BYTES)),M=r.fromBytes(B.subarray(r.BYTES,2*r.BYTES));return{x:_,y:M}}else{let _=i,M=a;throw new Error("invalid Point, expected length of "+_+", or uncompressed "+M+", got "+E)}}});function m(v){let E=n>>Xn;return v>E}function g(v){return m(v)?c(-v):v}let y=(v,E,O)=>Rd(v.slice(E,O));class b{constructor(E,O,B){Bm("r",E,Xn,n),Bm("s",O,Xn,n),this.r=E,this.s=O,B!=null&&(this.recovery=B),Object.freeze(this)}static fromCompact(E){let O=o;return E=ni("compactSignature",E,O*2),new b(y(E,0,O),y(E,O,2*O))}static fromDER(E){let{r:O,s:B}=Bd.toSig(ni("DER",E));return new b(O,B)}assertValidity(){}addRecoveryBit(E){return new b(this.r,this.s,E)}recoverPublicKey(E){let{r:O,s:B,recovery:_}=this,M=D(ni("msgHash",E));if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");let F=_===2||_===3?O+t.n:O;if(F>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");let q=(_&1)===0?"02":"03",oe=u.fromHex(q+aN(F,r.BYTES)),Q=l(F),Y=c(-M*Q),pe=c(B*Q),he=u.BASE.multiplyAndAddUnsafe(oe,Y,pe);if(!he)throw new Error("point at infinify");return he.assertValidity(),he}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return cx(this.toDERHex())}toDERHex(){return Bd.hexFromSig(this)}toCompactRawBytes(){return cx(this.toCompactHex())}toCompactHex(){let E=o;return aN(this.r,E)+aN(this.s,E)}}let C={isValidPrivateKey(v){try{return d(v),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let v=eN(t.n);return Bq(t.randomBytes(v),t.n)},precompute(v=8,E=u.BASE){return E._setWindowSize(v),E.multiply(BigInt(3)),E}};function w(v,E=!0){return u.fromPrivateKey(v).toRawBytes(E)}function x(v){if(typeof v=="bigint")return!1;if(v instanceof u)return!0;let O=ni("key",v).length,B=r.BYTES,_=B+1,M=2*B+1;if(!(t.allowedPrivateKeyLengths||o===_))return O===_||O===M}function S(v,E,O=!0){if(x(v)===!0)throw new Error("first arg must be private key");if(x(E)===!1)throw new Error("second arg must be public key");return u.fromHex(E).multiply(d(v)).toRawBytes(O)}let P=t.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");
6186let E=Rd(v),O=v.length*8-s;return O>0?E>>BigInt(O):E},D=t.bits2int_modN||function(v){return c(P(v))},U=km(s);function N(v){return Bm("num < 2^"+s,v,kd,U),Om(v,o)}function L(v,E,O=I){if(["recovered","canonical"].some(me=>me in O))throw new Error("sign() legacy options not supported");let{hash:B,randomBytes:_}=t,{lowS:M,prehash:F,extraEntropy:q}=O;M==null&&(M=!0),v=ni("msgHash",v),$q(O),F&&(v=ni("prehashed msgHash",B(v)));let oe=D(v),Q=d(E),Y=[N(Q),N(oe)];if(q!=null&&q!==!1){let me=q===!0?_(r.BYTES):q;Y.push(ni("extraEntropy",me))}let pe=lx(...Y),he=oe;function Te(me){let _e=P(me);if(!f(_e))return;let wt=l(_e),Nt=u.BASE.multiply(_e).toAffine(),bt=c(Nt.x);if(bt===kd)return;let ar=c(wt*c(he+bt*Q));if(ar===kd)return;let Ar=(Nt.x===bt?0:2)|Number(Nt.y&Xn),fl=ar;return M&&m(ar)&&(fl=g(ar),Ar^=1),new b(bt,fl,Ar)}return{seed:pe,k2sig:Te}}let I={lowS:t.lowS,prehash:!1},R={lowS:t.lowS,prehash:!1};function A(v,E,O=I){let{seed:B,k2sig:_}=L(v,E,O),M=t;return cq(M.hash.outputLen,M.nByteLength,M.hmac)(B,_)}u.BASE._setWindowSize(8);function T(v,E,O,B=R){let _=v;E=ni("msgHash",E),O=ni("publicKey",O);let{lowS:M,prehash:F,format:q}=B;if($q(B),"strict"in B)throw new Error("options.strict was renamed to lowS");if(q!==void 0&&q!=="compact"&&q!=="der")throw new Error("format must be compact or der");let oe=typeof _=="string"||R2(_),Q=!oe&&!q&&typeof _=="object"&&_!==null&&typeof _.r=="bigint"&&typeof _.s=="bigint";if(!oe&&!Q)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,pe;try{if(Q&&(Y=new b(_.r,_.s)),oe){try{q!=="compact"&&(Y=b.fromDER(_))}catch(Ar){if(!(Ar instanceof Bd.Err))throw Ar}!Y&&q!=="der"&&(Y=b.fromCompact(_))}pe=u.fromHex(O)}catch{return!1}if(!Y||M&&Y.hasHighS())return!1;F&&(E=t.hash(E));let{r:he,s:Te}=Y,me=D(E),_e=l(Te),wt=c(me*_e),Nt=c(he*_e),bt=u.BASE.multiplyAndAddUnsafe(pe,wt,Nt)?.toAffine();return bt?c(bt.x)===he:!1}return{CURVE:t,getPublicKey:w,getSharedSecret:S,sign:A,verify:T,ProjectivePoint:u,Signature:b,utils:C}}function wEe(e){return{hash:e,hmac:(t,...r)=>Tf(e,t,bo(...r)),randomBytes:Ss}}function Vq(e,t){let r=n=>Fq({...e,...wEe(n)});return{...r(t),create:r}}var qq=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),zq=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),bEe=BigInt(0),xEe=BigInt(1),uN=BigInt(2),jq=(e,t)=>(e+t/uN)/t;function vEe(e){let t=qq,r=BigInt(3),n=BigInt(6),o=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=ji(u,r,t)*u%t,p=ji(d,r,t)*u%t,f=ji(p,uN,t)*l%t,m=ji(f,o,t)*f%t,g=ji(m,s,t)*m%t,y=ji(g,a,t)*g%t,b=ji(y,c,t)*y%t,C=ji(b,a,t)*g%t,w=ji(C,r,t)*u%t,x=ji(w,i,t)*m%t,S=ji(x,n,t)*l%t,P=ji(S,uN,t);if(!dN.eql(dN.sqr(P),e))throw new Error("Cannot find square root");return P}var dN=hx(qq,void 0,void 0,{sqrt:vEe}),qi=Vq({a:bEe,b:BigInt(7),Fp:dN,n:zq,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=zq,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xEe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),s=r,i=BigInt("0x100000000000000000000000000000000"),a=jq(s*e,t),c=jq(-n*e,t),l=$o(e-a*r-c*o,t),u=$o(-a*n-c*s,t),d=l>i,p=u>i;if(d&&(l=t-l),p&&(u=t-u),l>i||u>i)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:l,k2neg:p,k2:u}}}},Pd);function NE(e,t={}){let{recovered:r}=t;if(typeof e.r>"u")throw new U2({signature:e});if(typeof e.s>"u")throw new U2({signature:e});if(r&&typeof e.yParity>"u")throw new U2({signature:e});if(e.r<0n||e.r>YP)throw new TE({value:e.r});if(e.s<0n||e.s>YP)throw new _E({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Hm({value:e.yParity})}function Wq(e){return pN(Vi(e))}function pN(e){if(e.length!==130&&e.length!==132)throw new IE({signature:e});let t=BigInt(yc(e,0,32)),r=BigInt(yc(e,32,64)),n=(()=>{let o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return RE(o)}catch{throw new Hm({value:o})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function EEe(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return fN(e)}function fN(e){let t=typeof e=="string"?pN(e):e instanceof Uint8Array?Wq(e):typeof e.r=="string"?Gq(e):e.v?Zq(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return NE(t),t}function AEe(e){return Kq(Vi(e))}function Kq(e){let{r:t,s:r}=qi.Signature.fromDER(bl(e).slice(2));return{r:t,s:r}}function Zq(e){return{r:e.r,s:e.s,yParity:RE(e.v)}}function Gq(e){let t=(()=>{let r=e.v?Number(e.v):void 0,n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=RE(r)),typeof n!="number")throw new Hm({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function CEe(e){let[t,r,n]=e;return fN({r:r==="0x"?0n:BigInt(r),s:n==="0x"?0n:BigInt(n),yParity:t==="0x"?0:Number(t)})}function SEe(e){return px(Yq(e))}function Yq(e){NE(e);let t=e.r,r=e.s;return wE(zi(t,{size:32}),zi(r,{size:32}),typeof e.yParity=="number"?zi(hN(e.yParity),{size:1}):"0x")}function IEe(e){return new qi.Signature(e.r,e.s).toDERRawBytes()}function TEe(e){return`0x${new qi.Signature(e.r,e.s).toDERHex()}`}function _Ee(e){return{r:e.r,s:e.s,v:hN(e.yParity)}}function PEe(e){let{r:t,s:r,yParity:n}=e;return{r:zi(t,{size:32}),s:zi(r,{size:32}),yParity:n===0?"0x0":"0x1"}}function NEe(e){let{r:t,s:r,yParity:n}=e;return[n?"0x01":"0x",t===0n?"0x":HP(zi(t)),r===0n?"0x":HP(zi(r))]}function REe(e,t={}){try{return NE(e,t),!0}catch{return!1}}function RE(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new PE({value:e})}function hN(e){if(e===0)return 27;if(e===1)return 28;throw new Hm({value:e})}var IE=class extends er{constructor({signature:t}){super(`Value \`${t}
vendor: 4,380 bytes, line 6186
6186\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${Pa(bl(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}},U2=class extends er{constructor({signature:t}){super(`Signature \`${If(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}},TE=class extends er{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}},_E=class extends er{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}},Hm=class extends er{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}},PE=class extends er{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}};var Jq=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);var Vn=Uint32Array.from([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Pe=new Uint32Array(32);function _f(e,t,r,n,o,s){let i=o[s],a=o[s+1],c=Pe[2*e],l=Pe[2*e+1],u=Pe[2*t],d=Pe[2*t+1],p=Pe[2*r],f=Pe[2*r+1],m=Pe[2*n],g=Pe[2*n+1],y=tx(c,u,i);l=rx(y,l,d,a),c=y|0,{Dh:g,Dl:m}={Dh:g^l,Dl:m^c},{Dh:g,Dl:m}={Dh:Tj(g,m),Dl:_j(g,m)},{h:f,l:p}=Fi(f,p,g,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^p},{Bh:d,Bl:u}={Bh:hl(d,u,24),Bl:ml(d,u,24)},Pe[2*e]=c,Pe[2*e+1]=l,Pe[2*t]=u,Pe[2*t+1]=d,Pe[2*r]=p,Pe[2*r+1]=f,Pe[2*n]=m,Pe[2*n+1]=g}function Pf(e,t,r,n,o,s){let i=o[s],a=o[s+1],c=Pe[2*e],l=Pe[2*e+1],u=Pe[2*t],d=Pe[2*t+1],p=Pe[2*r],f=Pe[2*r+1],m=Pe[2*n],g=Pe[2*n+1],y=tx(c,u,i);l=rx(y,l,d,a),c=y|0,{Dh:g,Dl:m}={Dh:g^l,Dl:m^c},{Dh:g,Dl:m}={Dh:hl(g,m,16),Dl:ml(g,m,16)},{h:f,l:p}=Fi(f,p,g,m),{Bh:d,Bl:u}={Bh:d^f,Bl:u^p},{Bh:d,Bl:u}={Bh:Sm(d,u,63),Bl:Im(d,u,63)},Pe[2*e]=c,Pe[2*e+1]=l,Pe[2*t]=u,Pe[2*t+1]=d,Pe[2*r]=p,Pe[2*r+1]=f,Pe[2*n]=m,Pe[2*n+1]=g}function OEe(e,t={},r,n,o){if(Lo(r),e<0||e>r)throw new Error("outputLen bigger than keyLen");let{key:s,salt:i,personalization:a}=t;if(s!==void 0&&(s.length<1||s.length>r))throw new Error("key length must be undefined or 1.."+r);if(i!==void 0&&i.length!==n)throw new Error("salt must be undefined or "+n);if(a!==void 0&&a.length!==o)throw new Error("personalization must be undefined or "+o)}var mN=class extends gl{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,Lo(t),Lo(r),this.blockLen=t,this.outputLen=r,this.buffer=new Uint8Array(t),this.buffer32=Pm(this.buffer)}update(t){Ta(this),t=Mo(t),mn(t);let{blockLen:r,buffer:n,buffer32:o}=this,s=t.length,i=t.byteOffset,a=t.buffer;for(let c=0;c<s;){this.pos===r&&(wl(o),this.compress(o,0,!1),wl(o),this.pos=0);let l=Math.min(r-this.pos,s-c),u=i+c;if(l===r&&!(u%4)&&c+l<s){let d=new Uint32Array(a,u,Math.floor((s-c)/4));wl(d);for(let p=0;c+r<s;p+=o.length,c+=r)this.length+=r,this.compress(d,p,!1);wl(d);continue}n.set(t.subarray(c,c+l),this.pos),this.pos+=l,this.length+=l,c+=l}return this}digestInto(t){Ta(this),P2(t,this);let{pos:r,buffer32:n}=this;this.finished=!0,Qn(this.buffer.subarray(r)),wl(n),this.compress(n,0,!0),wl(n);let o=Pm(t);
6186this.get().forEach((s,i)=>o[i]=yl(s))}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){let{buffer:r,length:n,finished:o,destroyed:s,outputLen:i,pos:a}=this;return t||(t=new this.constructor({dkLen:i})),t.set(...this.get()),t.buffer.set(r),t.destroyed=s,t.finished=o,t.length=n,t.pos=a,t.outputLen=i,t}clone(){return this._cloneInto()}},gN=class extends mN{constructor(t={}){let r=t.dkLen===void 0?64:t.dkLen;super(128,r),this.v0l=Vn[0]|0,this.v0h=Vn[1]|0,this.v1l=Vn[2]|0,this.v1h=Vn[3]|0,this.v2l=Vn[4]|0,this.v2h=Vn[5]|0,this.v3l=Vn[6]|0,this.v3h=Vn[7]|0,this.v4l=Vn[8]|0,this.v4h=Vn[9]|0,this.v5l=Vn[10]|0,this.v5h=Vn[11]|0,this.v6l=Vn[12]|0,this.v6h=Vn[13]|0,this.v7l=Vn[14]|0,this.v7h=Vn[15]|0,OEe(r,t,64,16,16);let{key:n,personalization:o,salt:s}=t,i=0;if(n!==void 0&&(n=Mo(n),i=n.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,s!==void 0){s=Mo(s);let a=Pm(s);this.v4l^=yl(a[0]),this.v4h^=yl(a[1]),this.v5l^=yl(a[2]),this.v5h^=yl(a[3])}if(o!==void 0){o=Mo(o);let a=Pm(o);this.v6l^=yl(a[0]),this.v6h^=yl(a[1]),this.v7l^=yl(a[2]),this.v7h^=yl(a[3])}if(n!==void 0){let a=new Uint8Array(this.blockLen);a.set(n),this.update(a)}}get(){let{v0l:t,v0h:r,v1l:n,v1h:o,v2l:s,v2h:i,v3l:a,v3h:c,v4l:l,v4h:u,v5l:d,v5h:p,v6l:f,v6h:m,v7l:g,v7h:y}=this;return[t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y]}set(t,r,n,o,s,i,a,c,l,u,d,p,f,m,g,y){this.v0l=t|0,this.v0h=r|0,this.v1l=n|0,this.v1h=o|0,this.v2l=s|0,this.v2h=i|0,this.v3l=a|0,this.v3h=c|0,this.v4l=l|0,this.v4h=u|0,this.v5l=d|0,this.v5h=p|0,this.v6l=f|0,this.v6h=m|0,this.v7l=g|0,this.v7h=y|0}compress(t,r,n){this.get().forEach((c,l)=>Pe[l]=c),Pe.set(Vn,16);let{h:o,l:s}=bP(BigInt(this.length));Pe[24]=Vn[8]^s,Pe[25]=Vn[9]^o,n&&(Pe[28]=~Pe[28],Pe[29]=~Pe[29]);let i=0,a=Jq;for(let c=0;c<12;c++)_f(0,4,8,12,t,r+2*a[i++]),Pf(0,4,8,12,t,r+2*a[i++]),_f(1,5,9,13,t,r+2*a[i++]),Pf(1,5,9,13,t,r+2*a[i++]),_f(2,6,10,14,t,r+2*a[i++]),Pf(2,6,10,14,t,r+2*a[i++]),_f(3,7,11,15,t,r+2*a[i++]),Pf(3,7,11,15,t,r+2*a[i++]),_f(0,5,10,15,t,r+2*a[i++]),Pf(0,5,10,15,t,r+2*a[i++]),_f(1,6,11,12,t,r+2*a[i++]),Pf(1,6,11,12,t,r+2*a[i++]),_f(2,7,8,13,t,r+2*a[i++]),Pf(2,7,8,13,t,r+2*a[i++]),_f(3,4,9,14,t,r+2*a[i++]),Pf(3,4,9,14,t,r+2*a[i++]);this.v0l^=Pe[0]^Pe[16],this.v0h^=Pe[1]^Pe[17],this.v1l^=Pe[2]^Pe[18],this.v1h^=Pe[3]^Pe[19],this.v2l^=Pe[4]^Pe[20],this.v2h^=Pe[5]^Pe[21],this.v3l^=Pe[6]^Pe[22],this.v3h^=Pe[7]^Pe[23],this.v4l^=Pe[8]^Pe[24],this.v4h^=Pe[9]^Pe[25],this.v5l^=Pe[10]^Pe[26],this.v5h^=Pe[11]^Pe[27],this.v6l^=Pe[12]^Pe[28],this.v6h^=Pe[13]^Pe[29],this.v7l^=Pe[14]^Pe[30],this.v7h^=Pe[15]^Pe[31],Qn(Pe)}destroy(){this.destroyed=!0,Qn(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Qq=Vj(e=>new gN(e));var ME={};Ce(ME,{createKeyPair:()=>qEe,getPublicKey:()=>fW,getSharedSecret:()=>WEe,noble:()=>jEe,randomPrivateKey:()=>hW,recoverAddress:()=>mW,recoverPublicKey:()=>gW,sign:()=>KEe,verify:()=>ZEe});var pW=!1;var jEe=qi;function qEe(e={}){let{as:t="Hex"}=e,r=hW({as:t}),n=fW({privateKey:r});return{privateKey:r,publicKey:n}}function fW(e){let{privateKey:t}=e,r=qi.ProjectivePoint.fromPrivateKey(bl(t).slice(2));return WP(r)}function WEe(e){let{as:t="Hex",privateKey:r,publicKey:n}=e,i=qi.ProjectivePoint.fromHex(fx(n).slice(2)).multiply(qi.utils.normPrivateKeyToScalar(bl(r).slice(2))).toRawBytes(!0);return t==="Hex"?Vi(i):i}function hW(e={}){let{as:t="Hex"}=e,r=qi.utils.randomPrivateKey();return t==="Hex"?Vi(r):r}function mW(e){return Aq(gW(e))}function gW(e){let{payload:t,signature:r}=e,{r:n,s:o,yParity:s}=r,a=new qi.Signature(BigInt(n),BigInt(o)).addRecoveryBit(s).recoverPublicKey(bl(t).substring(2));return WP(a)}function KEe(e){let{extraEntropy:t=pW,hash:r,payload:n,privateKey:o}=e,{r:s,s:i,recovery:a}=qi.sign(D2(n),D2(o),{extraEntropy:typeof t=="boolean"?t:bl(t).slice(2),lowS:!0,...r?{prehash:!0}:{}});return{r:s,s:i,yParity:a}}function ZEe(e){let{address:t,hash:r,payload:n,publicKey:o,signature:s}=e;return t?Cq(t,mW({payload:n,signature:s})):qi.verify(s,D2(n),vq(o),...r?[{prehash:!0,lowS:!0}]:[])}NN();wN();Nx();zE();var BK=e=>Uint8Array.from(e.split("").map(t=>t.charCodeAt(0))),DCe=BK("expand 16-byte k"),UCe=BK("expand 32-byte k"),LCe=Dd(DCe),MCe=Dd(UCe);function $e(e,t){return e<<t|e>>>32-t}function nR(e){return e.byteOffset%4===0}var iA=64,HCe=16,kK=2**32-1,OK=new Uint32Array;function $Ce(e,t,r,n,o,s,i,a){let c=o.length,l=new Uint8Array(iA),u=Dd(l),d=nR(o)&&nR(s),p=d?Dd(o):OK,f=d?Dd(s):OK;for(let m=0;m<c;i++){if(e(t,r,n,u,i,a),i>=kK)throw new Error("arx: counter overflow");let g=Math.min(iA,c-m);if(d&&g===iA){let y=m/4;
vendor: 7,185 bytes, line 6186
6186if(m%4!==0)throw new Error("arx: invalid block position");for(let b=0,C;b<HCe;b++)C=y+b,f[C]=p[C]^u[b];m+=iA;continue}for(let y=0,b;y<g;y++)b=m+y,s[b]=o[b]^l[y];m+=g}}function oR(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:o,counterRight:s,rounds:i}=xW({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!="function")throw new Error("core must be a function");return $E(o),$E(i),HE(s),HE(r),(a,c,l,u,d=0)=>{Vo(a),Vo(c),Vo(l);let p=l.length;if(u===void 0&&(u=new Uint8Array(p)),Vo(u),$E(d),d<0||d>=kK)throw new Error("arx: counter overflow");if(u.length<p)throw new Error(`arx: output (${u.length}) is shorter than data (${p})`);let f=[],m=a.length,g,y;if(m===32)f.push(g=VE(a)),y=MCe;else if(m===16&&r)g=new Uint8Array(32),g.set(a),g.set(a,16),y=LCe,f.push(g);else throw new Error(`arx: invalid 32-byte key, got length=${m}`);nR(c)||f.push(c=VE(c));let b=Dd(g);if(n){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");n(y,b,Dd(c.subarray(0,16)),b),c=c.subarray(16)}let C=16-o;if(C!==c.length)throw new Error(`arx: nonce must be ${C} or 16 bytes`);if(C!==12){let x=new Uint8Array(12);x.set(c,s?0:12-c.length),c=x,f.push(c)}let w=Dd(c);return $Ce(e,y,b,w,l,u,d,i),Ud(...f),u}}zE();var Eo=(e,t)=>e[t++]&255|(e[t++]&255)<<8,sR=class{constructor(t){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,t=FE(t),Vo(t,32);let r=Eo(t,0),n=Eo(t,2),o=Eo(t,4),s=Eo(t,6),i=Eo(t,8),a=Eo(t,10),c=Eo(t,12),l=Eo(t,14);this.r[0]=r&8191,this.r[1]=(r>>>13|n<<3)&8191,this.r[2]=(n>>>10|o<<6)&7939,this.r[3]=(o>>>7|s<<9)&8191,this.r[4]=(s>>>4|i<<12)&255,this.r[5]=i>>>1&8190,this.r[6]=(i>>>14|a<<2)&8191,this.r[7]=(a>>>11|c<<5)&8065,this.r[8]=(c>>>8|l<<8)&8191,this.r[9]=l>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Eo(t,16+2*u)}process(t,r,n=!1){let o=n?0:2048,{h:s,r:i}=this,a=i[0],c=i[1],l=i[2],u=i[3],d=i[4],p=i[5],f=i[6],m=i[7],g=i[8],y=i[9],b=Eo(t,r+0),C=Eo(t,r+2),w=Eo(t,r+4),x=Eo(t,r+6),S=Eo(t,r+8),P=Eo(t,r+10),D=Eo(t,r+12),U=Eo(t,r+14),N=s[0]+(b&8191),L=s[1]+((b>>>13|C<<3)&8191),I=s[2]+((C>>>10|w<<6)&8191),R=s[3]+((w>>>7|x<<9)&8191),A=s[4]+((x>>>4|S<<12)&8191),T=s[5]+(S>>>1&8191),v=s[6]+((S>>>14|P<<2)&8191),E=s[7]+((P>>>11|D<<5)&8191),O=s[8]+((D>>>8|U<<8)&8191),B=s[9]+(U>>>5|o),_=0,M=_+N*a+L*(5*y)+I*(5*g)+R*(5*m)+A*(5*f);_=M>>>13,M&=8191,M+=T*(5*p)+v*(5*d)+E*(5*u)+O*(5*l)+B*(5*c),_+=M>>>13,M&=8191;let F=_+N*c+L*a+I*(5*y)+R*(5*g)+A*(5*m);_=F>>>13,F&=8191,F+=T*(5*f)+v*(5*p)+E*(5*d)+O*(5*u)+B*(5*l),_+=F>>>13,F&=8191;let q=_+N*l+L*c+I*a+R*(5*y)+A*(5*g);_=q>>>13,q&=8191,q+=T*(5*m)+v*(5*f)+E*(5*p)+O*(5*d)+B*(5*u),_+=q>>>13,q&=8191;let oe=_+N*u+L*l+I*c+R*a+A*(5*y);_=oe>>>13,oe&=8191,oe+=T*(5*g)+v*(5*m)+E*(5*f)+O*(5*p)+B*(5*d),_+=oe>>>13,oe&=8191;let Q=_+N*d+L*u+I*l+R*c+A*a;_=Q>>>13,Q&=8191,Q+=T*(5*y)+v*(5*g)+E*(5*m)+O*(5*f)+B*(5*p),_+=Q>>>13,Q&=8191;let Y=_+N*p+L*d+I*u+R*l+A*c;_=Y>>>13,Y&=8191,Y+=T*a+v*(5*y)+E*(5*g)+O*(5*m)+B*(5*f),_+=Y>>>13,Y&=8191;let pe=_+N*f+L*p+I*d+R*u+A*l;_=pe>>>13,pe&=8191,pe+=T*c+v*a+E*(5*y)+O*(5*g)+B*(5*m),_+=pe>>>13,pe&=8191;let he=_+N*m+L*f+I*p+R*d+A*u;_=he>>>13,he&=8191,he+=T*l+v*c+E*a+O*(5*y)+B*(5*g),_+=he>>>13,he&=8191;let Te=_+N*g+L*m+I*f+R*p+A*d;_=Te>>>13,Te&=8191,Te+=T*u+v*l+E*c+O*a+B*(5*y),_+=Te>>>13,Te&=8191;let me=_+N*y+L*g+I*m+R*f+A*p;_=me>>>13,me&=8191,me+=T*d+v*u+E*l+O*c+B*a,_+=me>>>13,me&=8191,_=(_<<2)+_|0,_=_+M|0,M=_&8191,_=_>>>13,F+=_,s[0]=M,s[1]=F,s[2]=q,s[3]=oe,s[4]=Q,s[5]=Y,s[6]=pe,s[7]=he,s[8]=Te,s[9]=me}finalize(){let{h:t,pad:r}=this,n=new Uint16Array(10),o=t[1]>>>13;t[1]&=8191;for(let a=2;a<10;a++)t[a]+=o,o=t[a]>>>13,t[a]&=8191;t[0]+=o*5,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,n[0]=t[0]+5,o=n[0]>>>13,n[0]&=8191;for(let a=1;a<10;a++)n[a]=t[a]+o,o=n[a]>>>13,n[a]&=8191;n[9]-=8192;let s=(o^1)-1;for(let a=0;a<10;a++)n[a]&=s;s=~s;for(let a=0;a<10;a++)t[a]=t[a]&s|n[a];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let i=t[0]+r[0];t[0]=i&65535;for(let a=1;a<8;a++)i=(t[a]+r[a]|0)+(i>>>16)|0,t[a]=i&65535;Ud(n)}update(t){bN(this),t=FE(t),Vo(t);let{buffer:r,blockLen:n}=this,o=t.length;for(let s=0;s<o;){let i=Math.min(n-this.pos,o-s);if(i===n){for(;n<=o-s;s+=n)this.process(t,s);continue}r.set(t.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(r,0,!1),this.pos=0)}return this}destroy(){Ud(this.h,this.r,this.buffer,this.pad)}digestInto(t){bN(this),bW(t,this),this.finished=!0;let{buffer:r,h:n}=this,{pos:o}=this;if(o){for(r[o++]=1;o<16;o++)r[o]=0;this.process(r,0,!0)}this.finalize();let s=0;for(let i=0;i<8;i++)t[s++]=n[i]>>>0,t[s++]=n[i]>>>8;return t}digest(){let{buffer:t,outputLen:r}=this;this.digestInto(t);let n=t.slice(0,r);return this.destroy(),n}};function FCe(e){let t=(n,o)=>e(o).update(FE(n)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=n=>e(n),t}var DK=FCe(e=>new sR(e));zE();function MK(e,t,r,n,o,s=20){let i=e[0],a=e[1],c=e[2],l=e[3],u=t[0],d=t[1],p=t[2],f=t[3],m=t[4],g=t[5],y=t[6],b=t[7],C=o,w=r[0],x=r[1],S=r[2],P=i,D=a,U=c,N=l,L=u,I=d,R=p,A=f,T=m,v=g,E=y,O=b,B=C,_=w,M=x,F=S;for(let oe=0;oe<s;oe+=2)P=P+L|0,B=$e(B^P,16),T=T+B|0,L=$e(L^T,12),P=P+L|0,B=$e(B^P,8),T=T+B|0,L=$e(L^T,7),D=D+I|0,_=$e(_^D,16),v=v+_|0,I=$e(I^v,12),D=D+I|0,_=$e(_^D,8),v=v+_|0,I=$e(I^v,7),U=U+R|0,M=$e(M^U,16),E=E+M|0,R=$e(R^E,12),U=U+R|0,M=$e(M^U,8),E=E+M|0,R=$e(R^E,7),N=N+A|0,F=$e(F^N,16),O=O+F|0,A=$e(A^O,12),N=N+A|0,F=$e(F^N,8),O=O+F|0,A=$e(A^O,7),P=P+I|0,F=$e(F^P,16),E=E+F|0,I=$e(I^E,12),P=P+I|0,F=$e(F^P,8),E=E+F|0,I=$e(I^E,7),D=D+R|0,B=$e(B^D,16),O=O+B|0,R=$e(R^O,12),D=D+R|0,B=$e(B^D,8),O=O+B|0,R=$e(R^O,7),U=U+A|0,_=$e(_^U,16),T=T+_|0,A=$e(A^T,12),U=U+A|0,_=$e(_^U,8),T=T+_|0,A=$e(A^T,7),N=N+L|0,M=$e(M^N,16),v=v+M|0,L=$e(L^v,12),N=N+L|0,M=$e(M^N,8),v=v+M|0,L=$e(L^v,7);let q=0;n[q++]=i+P|0,n[q++]=a+D|0,n[q++]=c+U|0,n[q++]=l+N|0,n[q++]=u+L|0,n[q++]=d+I|0,n[q++]=p+R|0,n[q++]=f+A|0,n[q++]=m+T|0,n[q++]=g+v|0,n[q++]=y+E|0,n[q++]=b+O|0,n[q++]=C+B|0,n[q++]=w+_|0,n[q++]=x+M|0,n[q++]=S+F|0}function VCe(e,t,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],c=t[0],l=t[1],u=t[2],d=t[3],p=t[4],f=t[5],m=t[6],g=t[7],y=r[0],b=r[1],C=r[2],w=r[3];for(let S=0;S<20;S+=2)o=o+c|0,y=$e(y^o,16),p=p+y|0,c=$e(c^p,12),o=o+c|0,y=$e(y^o,8),p=p+y|0,c=$e(c^p,7),s=s+l|0,b=$e(b^s,16),f=f+b|0,l=$e(l^f,12),s=s+l|0,b=$e(b^s,8),f=f+b|0,l=$e(l^f,7),i=i+u|0,C=$e(C^i,16),m=m+C|0,u=$e(u^m,12),i=i+u|0,C=$e(C^i,8),m=m+C|0,u=$e(u^m,7),a=a+d|0,w=$e(w^a,16),g=g+w|0,d=$e(d^g,12),a=a+d|0,w=$e(w^a,8),g=g+w|0,d=$e(d^g,7),o=o+l|0,w=$e(w^o,16),m=m+w|0,l=$e(l^m,12),o=o+l|0,w=$e(w^o,8),m=m+w|0,l=$e(l^m,7),s=s+u|0,y=$e(y^s,16),g=g+y|0,u=$e(u^g,12),s=s+u|0,y=$e(y^s,8),g=g+y|0,u=$e(u^g,7),i=i+d|0,b=$e(b^i,16),p=p+b|0,d=$e(d^p,12),i=i+d|0,b=$e(b^i,8),p=p+b|0,d=$e(d^p,7),a=a+c|0,C=$e(C^a,16),f=f+C|0,c=$e(c^f,12),a=a+c|0,C=$e(C^a,8),f=f+C|0,c=$e(c^f,7);let x=0;n[x++]=o,n[x++]=s,n[x++]=i,n[x++]=a,n[x++]=y,n[x++]=b,n[x++]=C,n[x++]=w}var zCe=oR(MK,{counterRight:!1,counterLength:4,allowShortKeys:!1}
6186),jCe=oR(MK,{counterRight:!1,counterLength:8,extendNonceFn:VCe,allowShortKeys:!1});var qCe=new Uint8Array(16),UK=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(qCe.subarray(r))},WCe=new Uint8Array(32);function LK(e,t,r,n,o){let s=e(t,r,WCe),i=DK.create(s);o&&UK(i,o),UK(i,n);let a=EW(n.length,o?o.length:0,!0);i.update(a);let c=i.digest();return Ud(s,a),c}var HK=e=>(t,r,n)=>({encrypt(s,i){let a=s.length;i=vN(a+16,i,!1),i.set(s);let c=i.subarray(0,-16);e(t,r,c,c,1);let l=LK(e,t,r,c,n);return i.set(l,a),Ud(l),i},decrypt(s,i){i=vN(s.length-16,i,!1);let a=s.subarray(0,-16),c=s.subarray(-16),l=LK(e,t,r,a,n);if(!vW(c,l))throw new Error("invalid tag");return i.set(s.subarray(0,-16)),e(t,r,i,i,1),Ud(l),i}}),iR=xN({blockSize:64,nonceLength:12,tagLength:16},HK(zCe)),_nt=xN({blockSize:64,nonceLength:24,tagLength:16},HK(jCe));function KCe(e,t,r){return _m(e),r===void 0&&(r=new Uint8Array(e.outputLen)),Tf(e,Mo(r),Mo(t))}var aR=Uint8Array.from([0]),$K=Uint8Array.of();function ZCe(e,t,r,n=32){_m(e),Lo(n);let o=e.outputLen;if(n>255*o)throw new Error("Length should be <= 255*HashLen");let s=Math.ceil(n/o);r===void 0&&(r=$K);let i=new Uint8Array(s*o),a=Tf.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let u=0;u<s;u++)aR[0]=u+1,c.update(u===0?$K:l).update(r).update(aR).digestInto(l),i.set(l,o*u),a._cloneInto(c);return a.destroy(),c.destroy(),Qn(l,aR),i.slice(0,n)}var FK=(e,t,r,n,o)=>ZCe(e,KCe(e,t,r),n,o);var uR=BigInt(0),lR=BigInt(1);function Md(e,t=""){if(typeof e!="boolean"){let r=t&&`"${t}"`;throw new Error(r+"expected boolean, got type="+typeof e)}return e}function Wi(e,t,r=""){let n=Td(e),o=e?.length,s=t!==void 0;if(!n||s&&o!==t){let i=r&&`"${r}" `,a=s?` of length ${t}`:"",c=n?`length=${o}`:`type=${typeof e}`;throw new Error(i+"expected Uint8Array"+a+", got "+c)}return e}function Rx(e){let t=e.toString(16);return t.length&1?"0"+t:t}function VK(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?uR:BigInt("0x"+e)}function z2(e){return VK(_a(e))}function Ra(e){return mn(e),VK(_a(Uint8Array.from(e).reverse()))}function aA(e,t){return Nm(e.toString(16).padStart(t*2,"0"))}function Ox(e,t){return aA(e,t).reverse()}function tr(e,t,r){let n;if(typeof t=="string")try{n=Nm(t)}catch(s){throw new Error(e+" must be hex string or Uint8Array, cause: "+s)}else if(Td(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");let o=n.length;if(typeof r=="number"&&o!==r)throw new Error(e+" of length "+r+" expected, got "+o);return n}function zK(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}function dR(e){return Uint8Array.from(e)}var cR=e=>typeof e=="bigint"&&uR<=e;function jK(e,t,r){return cR(e)&&cR(t)&&cR(r)&&t<=e&&e<r}function Of(e,t,r,n){if(!jK(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function cA(e){let t;for(t=0;e>uR;e>>=lR,t+=1);return t}var Bf=e=>(lR<<BigInt(e))-lR;function qK(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=f=>new Uint8Array(f),o=f=>Uint8Array.of(f),s=n(e),i=n(e),a=0,c=()=>{s.fill(1),i.fill(0),a=0},l=(...f)=>r(i,s,...f),u=(f=n(0))=>{i=l(o(0),f),s=l(),f.length!==0&&(i=l(o(1),f),s=l())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,m=[];for(;f<t;){s=l();let g=s.slice();m.push(g),f+=s.length}return bo(...m)};return(f,m)=>{c(),u(f);let g;for(;!(g=m(d()));)u();return c(),g}}function vl(e,t,r={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function n(o,s,i){let a=e[o];if(i&&a===void 0)return;let c=typeof a;if(c!==s||a===null)throw new Error(`param "${o}" is invalid: expected ${s}, got ${c}`)}Object.entries(t).forEach(([o,s])=>n(o,s,!1)),Object.entries(r).forEach(([o,s])=>n(o,s,!0))}var pR=()=>{throw new Error("not implemented")};function j2(e){let t=new WeakMap;return(r,...n)=>{let o=t.get(r);if(o!==void 0)return o;let s=e(r,...n);return t.set(r,s),s}}var Ps=BigInt(0),eo=BigInt(1),zm=BigInt(2),ZK=BigInt(3),GK=BigInt(4),YK=BigInt(5),GCe=BigInt(7),JK=BigInt(8),YCe=BigInt(9),QK=BigInt(16);function Fr(e,t){let r=e%t;return r>=Ps?r:t+r}function Oa(e,t,r){let n=e;for(;t-- >Ps;)n*=n,n%=r;return n}function WK(e,t){if(e===Ps)throw new Error("invert: expected non-zero number");if(t<=Ps)throw new Error("invert: expected positive modulus, got "+t);let r=Fr(e,t),n=t,o=Ps,s=eo,i=eo,a=Ps;for(;r!==Ps;){let l=n/r,u=n%r,d=o-i*l,p=s-a*l;n=r,r=u,o=i,s=a,i=d,a=p}if(n!==eo)throw new Error("invert: does not exist");return Fr(o,t)}function fR(e,t,r){if(!e.eql(e.sqr(t),r))throw new Error("Cannot find square root")}function XK(e,t){let r=(e.ORDER+eo)/GK,n=e.pow(t,r);return fR(e,n,t),n}function JCe(e,t){let r=(e.ORDER-YK)/JK,n=e.mul(t,zm),o=e.pow(n,r),s=e.mul(t,o),i=e.mul(e.mul(s,zm),o),a=e.mul(s,e.sub(i,e.ONE));return fR(e,a,t),a}function QCe(e){let t=Ns(e),r=eZ(e),n=r(t,t.neg(t.ONE)),o=r(t,n),s=r(t,t.neg(n)),i=(e+GCe)/QK;return(a,c)=>{let l=a.pow(c,i),u=a.mul(l,n),d=a.mul(l,o),p=a.mul(l,s),f=a.eql(a.sqr(u),c),m=a.eql(a.sqr(d
vendor: 5,897 bytes, line 6186
6186),c);l=a.cmov(l,u,f),u=a.cmov(p,d,m);let g=a.eql(a.sqr(u),c),y=a.cmov(l,u,g);return fR(a,y,c),y}}function eZ(e){if(e<ZK)throw new Error("sqrt is not defined for small field");let t=e-eo,r=0;for(;t%zm===Ps;)t/=zm,r++;let n=zm,o=Ns(e);for(;KK(o,n)===1;)if(n++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return XK;let s=o.pow(n,t),i=(t+eo)/zm;return function(c,l){if(c.is0(l))return l;if(KK(c,l)!==1)throw new Error("Cannot find square root");let u=r,d=c.mul(c.ONE,s),p=c.pow(l,t),f=c.pow(l,i);for(;!c.eql(p,c.ONE);){if(c.is0(p))return c.ZERO;let m=1,g=c.sqr(p);for(;!c.eql(g,c.ONE);)if(m++,g=c.sqr(g),m===u)throw new Error("Cannot find square root");let y=eo<<BigInt(u-m-1),b=c.pow(d,y);u=m,d=c.sqr(b),p=c.mul(p,d),f=c.mul(f,b)}return f}}function XCe(e){return e%GK===ZK?XK:e%JK===YK?JCe:e%QK===YCe?QCe(e):eZ(e)}var Hd=(e,t)=>(Fr(e,t)&eo)===eo,eSe=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function hR(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},r=eSe.reduce((n,o)=>(n[o]="function",n),t);return vl(e,r),e}function tSe(e,t,r){if(r<Ps)throw new Error("invalid exponent, negatives unsupported");if(r===Ps)return e.ONE;if(r===eo)return t;let n=e.ONE,o=t;for(;r>Ps;)r&eo&&(n=e.mul(n,o)),o=e.sqr(o),r>>=eo;return n}function Bx(e,t,r=!1){let n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((i,a,c)=>e.is0(a)?i:(n[c]=i,e.mul(i,a)),e.ONE),s=e.inv(o);return t.reduceRight((i,a,c)=>e.is0(a)?i:(n[c]=e.mul(i,n[c]),e.mul(i,a)),s),n}function KK(e,t){let r=(e.ORDER-eo)/zm,n=e.pow(t,r),o=e.eql(n,e.ONE),s=e.eql(n,e.ZERO),i=e.eql(n,e.neg(e.ONE));if(!o&&!s&&!i)throw new Error("invalid Legendre symbol result");return o?1:s?0:-1}function lA(e,t){t!==void 0&&Lo(t);let r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ns(e,t,r=!1,n={}){if(e<=Ps)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,s,i=!1,a;if(typeof t=="object"&&t!=null){if(n.sqrt||r)throw new Error("cannot specify opts in two arguments");let p=t;p.BITS&&(o=p.BITS),p.sqrt&&(s=p.sqrt),typeof p.isLE=="boolean"&&(r=p.isLE),typeof p.modFromBytes=="boolean"&&(i=p.modFromBytes),a=p.allowedLengths}else typeof t=="number"&&(o=t),n.sqrt&&(s=n.sqrt);let{nBitLength:c,nByteLength:l}=lA(e,o);if(l>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u,d=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:l,MASK:Bf(c),ZERO:Ps,ONE:eo,allowedLengths:a,create:p=>Fr(p,e),isValid:p=>{if(typeof p!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof p);return Ps<=p&&p<e},is0:p=>p===Ps,isValidNot0:p=>!d.is0(p)&&d.isValid(p),isOdd:p=>(p&eo)===eo,neg:p=>Fr(-p,e),eql:(p,f)=>p===f,sqr:p=>Fr(p*p,e),add:(p,f)=>Fr(p+f,e),sub:(p,f)=>Fr(p-f,e),mul:(p,f)=>Fr(p*f,e),pow:(p,f)=>tSe(d,p,f),div:(p,f)=>Fr(p*WK(f,e),e),sqrN:p=>p*p,addN:(p,f)=>p+f,subN:(p,f)=>p-f,mulN:(p,f)=>p*f,inv:p=>WK(p,e),sqrt:s||(p=>(u||(u=XCe(e)),u(d,p))),toBytes:p=>r?Ox(p,l):aA(p,l),fromBytes:(p,f=!0)=>{if(a){if(!a.includes(p.length)||p.length>l)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+p.length);let g=new Uint8Array(l);g.set(p,r?0:g.length-p.length),p=g}if(p.length!==l)throw new Error("Field.fromBytes: expected "+l+" bytes, got "+p.length);let m=r?Ra(p):z2(p);if(i&&(m=Fr(m,e)),!f&&!d.isValid(m))throw new Error("invalid field element: outside of range 0..ORDER");return m},invertBatch:p=>Bx(d,p),cmov:(p,f,m)=>m?f:p});return Object.freeze(d)}function tZ(e){if(typeof e!="bigint")throw new Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function mR(e){let t=tZ(e);return t+Math.ceil(t/2)}function rZ(e,t,r=!1){let n=e.length,o=tZ(t),s=mR(t);if(n<16||n<s||n>1024)throw new Error("expected "+s+"-1024 bytes of input, got "+n);let i=r?Ra(e):z2(e),a=Fr(i,t-eo)+eo;return r?Ox(a,o):aA(a,o)}var q2=BigInt(0),jm=BigInt(1);function kx(e,t){let r=t.negate();return e?r:t}function $d(e,t){let r=Bx(e.Fp,t.map(n=>n.Z));return t.map((n,o)=>e.fromAffine(n.toAffine(r[o])))}function iZ(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function gR(e,t){iZ(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,s=Bf(e),i=BigInt(e);return{windows:r,windowSize:n,mask:s,maxNumber:o,shiftBy:i}}function nZ(e,t,r){let{windowSize:n,mask:o,maxNumber:s,shiftBy:i}=r,a=Number(e&o),c=e>>i;a>n&&(a-=s,c+=jm);let l=t*n,u=l+Math.abs(a)-1,d=a===0,p=a<0,f=t%2!==0;return{nextN:c,offset:u,isZero:d,isNeg:p,isNegF:f,offsetF:l}}function rSe(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function nSe(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}var yR=new WeakMap,aZ=new WeakMap;function wR(e){return aZ.get(e)||1}function oZ(e){if(e!==q2)throw new Error("invalid wNAF")}var W2=class{constructor(t,r){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=r}_unsafeLadder(t,r,n=this.ZERO){let o=t;for(;r>q2;)r&jm&&(n=n.add(o)),o=o.double(),r>>=jm;return n}precomputeWindow(t,r){let{windows:n,windowSize:o}=gR(r,this.bits),s=[],i=t,a=i;for(let c=0;c<n;c++){a=i,s.push(a);for(let l=1;l<o;l++)a=a.add(i),s.push(a);i=a.double()}return s}wNAF(t,r,n){if(!this.Fn.isValid(n))throw new Error("invalid scalar");let o=this.ZERO,s=this.BASE,i=gR(t,this.bits);for(let a=0;a<i.windows;a++){let{nextN:c,offset:l,isZero:u,isNeg:d,isNegF:p,offsetF:f}=nZ(n,a,i);n=c,u?s=s.add(kx(p,r[f])):o=o.add(kx(d,r[l]))}return oZ(n),{p:o,f:s}}wNAFUnsafe(t,r,n,o=this.ZERO){let s=gR(t,this.bits);for(let i=0;i<s.windows&&n!==q2;i++){let{nextN:a,offset:c,isZero:l,isNeg:u}=nZ(n,i,s);if(n=a,!l){let d=r[c];o=o.add(u?d.negate():d)}}return oZ(n),o}getPrecomputes(t,r,n){let o=yR.get(r);
6186return o||(o=this.precomputeWindow(r,t),t!==1&&(typeof n=="function"&&(o=n(o)),yR.set(r,o))),o}cached(t,r,n){let o=wR(t);return this.wNAF(o,this.getPrecomputes(o,t,n),r)}unsafe(t,r,n,o){let s=wR(t);return s===1?this._unsafeLadder(t,r,o):this.wNAFUnsafe(s,this.getPrecomputes(s,t,n),r,o)}createCache(t,r){iZ(r,this.bits),aZ.set(t,r),yR.delete(t)}hasCache(t){return wR(t)!==1}};function cZ(e,t,r,n){let o=t,s=e.ZERO,i=e.ZERO;for(;r>q2||n>q2;)r&jm&&(s=s.add(o)),n&jm&&(i=i.add(o)),o=o.double(),r>>=jm,n>>=jm;return{p1:s,p2:i}}function K2(e,t,r,n){rSe(r,e),nSe(n,t);let o=r.length,s=n.length;if(o!==s)throw new Error("arrays of points and scalars must have equal length");let i=e.ZERO,a=cA(BigInt(o)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let l=Bf(c),u=new Array(Number(l)+1).fill(i),d=Math.floor((t.BITS-1)/c)*c,p=i;for(let f=d;f>=0;f-=c){u.fill(i);for(let g=0;g<s;g++){let y=n[g],b=Number(y>>BigInt(f)&l);u[b]=u[b].add(r[g])}let m=i;for(let g=u.length-1,y=i;g>0;g--)y=y.add(u[g]),m=m.add(y);if(p=p.add(m),f!==0)for(let g=0;g<c;g++)p=p.double()}return p}function sZ(e,t,r){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return hR(t),t}else return Ns(e,{isLE:r})}function uA(e,t,r={},n){if(n===void 0&&(n=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(let c of["p","n","h"]){let l=t[c];if(!(typeof l=="bigint"&&l>q2))throw new Error(`CURVE.${c} must be positive bigint`)}let o=sZ(t.p,r.Fp,n),s=sZ(t.n,r.Fn,n),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let c of a)if(!o.isValid(t[c]))throw new Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:s}}var kf=BigInt(0),to=BigInt(1),bR=BigInt(2),oSe=BigInt(8);function sSe(e,t,r,n){let o=e.sqr(r),s=e.sqr(n),i=e.add(e.mul(t.a,o),s),a=e.add(e.ONE,e.mul(t.d,e.mul(o,s)));return e.eql(i,a)}function iSe(e,t={}){let r=uA("edwards",e,t,t.FpFnLE),{Fp:n,Fn:o}=r,s=r.CURVE,{h:i}=s;vl(t,{},{uvRatio:"function"});let a=bR<<BigInt(o.BYTES*8)-to,c=y=>n.create(y),l=t.uvRatio||((y,b)=>{try{return{isValid:!0,value:n.sqrt(n.div(y,b))}}catch{return{isValid:!1,value:kf}}});if(!sSe(n,s,s.Gx,s.Gy))throw new Error("bad curve params: generator point");function u(y,b,C=!1){let w=C?to:kf;return Of("coordinate "+y,b,w,a),b}function d(y){if(!(y instanceof m))throw new Error("ExtendedPoint expected")}let p=j2((y,b)=>{let{X:C,Y:w,Z:x}=y,S=y.is0();b==null&&(b=S?oSe:n.inv(x));let P=c(C*b),D=c(w*b),U=n.mul(x,b);if(S)return{x:kf,y:to};if(U!==to)throw new Error("invZ was invalid");return{x:P,y:D}}),f=j2(y=>{let{a:b,d:C}=s;if(y.is0())throw new Error("bad point: ZERO");let{X:w,Y:x,Z:S,T:P}=y,D=c(w*w),U=c(x*x),N=c(S*S),L=c(N*N),I=c(D*b),R=c(N*c(I+U)),A=c(L+c(C*c(D*U)));if(R!==A)throw new Error("bad point: equation left != right (1)");let T=c(w*x),v=c(S*P);if(T!==v)throw new Error("bad point: equation left != right (2)");return!0});class m{constructor(b,C,w,x){this.X=u("x",b),this.Y=u("y",C),this.Z=u("z",w,!0),this.T=u("t",x),Object.freeze(this)}static CURVE(){return s}static fromAffine(b){if(b instanceof m)throw new Error("extended point not allowed");let{x:C,y:w}=b||{};return u("x",C),u("y",w),new m(C,w,to,c(C*w))}static fromBytes(b,C=!1){let w=n.BYTES,{a:x,d:S}=s;b=dR(Wi(b,w,"point")),Md(C,"zip215");let P=dR(b),D=b[w-1];P[w-1]=D&-129;let U=Ra(P),N=C?a:n.ORDER;Of("point.y",U,kf,N);let L=c(U*U),I=c(L-to),R=c(S*L-x),{isValid:A,value:T}=l(I,R);if(!A)throw new Error("bad point: invalid y coordinate");let v=(T&to)===to,E=(D&128)!==0;if(!C&&T===kf&&E)throw new Error("bad point: x=0 and x_0=1");return E!==v&&(T=c(-T)),m.fromAffine({x:T,y:U})}static fromHex(b,C=!1){return m.fromBytes(tr("point",b),C)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(b=8,C=!0){return g.createCache(this,b),C||this.multiply(bR),this}assertValidity(){f(this)}equals(b){d(b);let{X:C,Y:w,Z:x}=this,{X:S,Y:P,Z:D}=b,U=c(C*D),N=c(S*x),L=c(w*D),I=c(P*x);return U===N&&L===I}is0(){return this.equals(m.ZERO)}negate(){return new m(c(-this.X),this.Y,this.Z,c(-this.T))}double(){let{a:b}=s,{X:C,Y:w,Z:x}=this,S=c(C*C),P=c(w*w),D=c(bR*c(x*x)),U=c(b*S),N=C+w,L=c(c(N*N)-S-P),I=U+P,R=I-D,A=U-P,T=c(L*R),v=c(I*A),E=c(L*A),O=c(R*I);return new m(T,v,O,E)}add(b){d(b);let{a:C,d:w}=s,{X:x,Y:S,Z:P,T:D}=this,{X:U,Y:N,Z:L,T:I}=b,R=c(x*U),A=c(S*N),T=c(D*w*I),v=c(P*L),E=c((x+S)*(U+N)-R-A),O=v-T,B=v+T,_=c(A-C*R),M=c(E*O),F=c(B*_),q=c(E*_),oe=c(O*B);return new m(M,F,oe,q)}subtract(b){return this.add(b.negate())}multiply(b){if(!o.isValidNot0(b))throw new Error("invalid scalar: expected 1 <= sc < curve.n");let{p:C,f:w}=g.cached(this,b,x=>$d(m,x));return $d(m,[C,w])[0]}multiplyUnsafe(b,C=m.ZERO){if(!o.isValid(b))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return b===kf?m.ZERO:this.is0()||b===to?this:g.unsafe(this,b,w=>$d(m,w),C)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}isTorsionFree(){return g.unsafe(this,s.n).is0()}toAffine(b){return p(this,b)}clearCofactor(){return i===to?this:this.multiplyUnsafe(i)}toBytes(){let{x:b,y:C}=this.toAffine(),w=n.toBytes(C);return w[w.length-1]|=b&to?128:0,w}toHex(){return _a(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(b){return $d(m,b)}static msm(b,C){return K2(m,o,b,C)}
6186_setWindowSize(b){this.precompute(b)}toRawBytes(){return this.toBytes()}}m.BASE=new m(s.Gx,s.Gy,to,c(s.Gx*s.Gy)),m.ZERO=new m(kf,to,to,kf),m.Fp=n,m.Fn=o;let g=new W2(m,o.BITS);return m.BASE.precompute(8),m}var dA=class{constructor(t){this.ep=t}static fromBytes(t){pR()}static fromHex(t){pR()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return _a(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,r){return this.init(this.ep.precompute(t,r))}toRawBytes(){return this.toBytes()}};function aSe(e,t,r={}){if(typeof t!="function")throw new Error('"hash" function param is required');vl(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});let{prehash:n}=r,{BASE:o,Fp:s,Fn:i}=e,a=r.randomBytes||Ss,c=r.adjustScalarBytes||(N=>N),l=r.domain||((N,L,I)=>{if(Md(I,"phflag"),L.length||I)throw new Error("Contexts/pre-hash are not supported");return N});function u(N){return i.create(Ra(N))}function d(N){let L=w.secretKey;N=tr("private key",N,L);let I=tr("hashed private key",t(N),2*L),R=c(I.slice(0,L)),A=I.slice(L,2*L),T=u(R);return{head:R,prefix:A,scalar:T}}function p(N){let{head:L,prefix:I,scalar:R}=d(N),A=o.multiply(R),T=A.toBytes();return{head:L,prefix:I,scalar:R,point:A,pointBytes:T}}function f(N){return p(N).pointBytes}function m(N=Uint8Array.of(),...L){let I=bo(...L);return u(t(l(I,tr("context",N),!!n)))}function g(N,L,I={}){N=tr("message",N),n&&(N=n(N));let{prefix:R,scalar:A,pointBytes:T}=p(L),v=m(I.context,R,N),E=o.multiply(v).toBytes(),O=m(I.context,E,T,N),B=i.create(v+O*A);if(!i.isValid(B))throw new Error("sign failed: invalid s");let _=bo(E,i.toBytes(B));return Wi(_,w.signature,"result")}let y={zip215:!0};function b(N,L,I,R=y){let{context:A,zip215:T}=R,v=w.signature;N=tr("signature",N,v),L=tr("message",L),I=tr("publicKey",I,w.publicKey),T!==void 0&&Md(T,"zip215"),n&&(L=n(L));let E=v/2,O=N.subarray(0,E),B=Ra(N.subarray(E,v)),_,M,F;try{_=e.fromBytes(I,T),M=e.fromBytes(O,T),F=o.multiplyUnsafe(B)}catch{return!1}if(!T&&_.isSmallOrder())return!1;let q=m(A,M.toBytes(),_.toBytes(),L);return M.add(_.multiplyUnsafe(q)).subtract(F).clearCofactor().is0()}let C=s.BYTES,w={secretKey:C,publicKey:C,signature:2*C,seed:C};function x(N=a(w.seed)){return Wi(N,w.seed,"seed")}function S(N){let L=U.randomSecretKey(N);return{secretKey:L,publicKey:f(L)}}function P(N){return Td(N)&&N.length===i.BYTES}function D(N,L){try{return!!e.fromBytes(N,L)}catch{return!1}}let U={getExtendedPublicKey:p,randomSecretKey:x,isValidSecretKey:P,isValidPublicKey:D,toMontgomery(N){let{y:L}=e.fromBytes(N),I=w.publicKey,R=I===32;if(!R&&I!==57)throw new Error("only defined for 25519 and 448");let A=R?s.div(to+L,to-L):s.div(L-to,L+to);return s.toBytes(A)},toMontgomerySecret(N){let L=w.secretKey;Wi(N,L);let I=t(N.subarray(0,L));return c(I).subarray(0,L)},randomPrivateKey:x,precompute(N=8,L=e.BASE){return L.precompute(N,!1)}};return Object.freeze({keygen:S,getPublicKey:f,sign:g,verify:b,utils:U,Point:e,lengths:w})}function cSe(e){let t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=Ns(t.n,e.nBitLength,!0),o={Fp:r,Fn:n,uvRatio:e.uvRatio},s={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:o,hash:e.hash,eddsaOpts:s}}function lSe(e,t){let r=t.Point;return Object.assign({},t,{ExtendedPoint:r,CURVE:e,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES})}function lZ(e){let{CURVE:t,curveOpts:r,hash:n,eddsaOpts:o}=cSe(e),s=iSe(t,r),i=aSe(s,n,o);return lSe(e,i)}var Dx=BigInt(0),Z2=BigInt(1),pA=BigInt(2);function uSe(e){return vl(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function uZ(e){let t=uSe(e),{P:r,type:n,adjustScalarBytes:o,powPminus2:s,randomBytes:i}=t,a=n==="x25519";if(!a&&n!=="x448")throw new Error("invalid type");let c=i||Ss,l=a?255:448,u=a?32:56,d=BigInt(a?9:5),p=BigInt(a?121665:39081),f=a?pA**BigInt(254):pA**BigInt(447),m=a?BigInt(8)*pA**BigInt(251)-Z2:BigInt(4)*pA**BigInt(445)-Z2,g=f+m+Z2,y=A=>Fr(A,r),b=C(d);function C(A){return Ox(y(A),u)}function w(A){let T=tr("u coordinate",A,u);return a&&(T[31]&=127),y(Ra(T))}function x(A){return Ra(o(tr("scalar",A,u)))}function S(A,T){let v=U(w(T),x(A));if(v===Dx)throw new Error("invalid private or public key received");return C(v)}function P(A){return S(A,b)}function D(A,T,v){let E=y(A*(T-v));return T=y(T-E),v=y(v+E),{x_2:T,x_3:v}}function U(A,T){Of("u",A,Dx,r),Of("scalar",T,f,g);let v=T,E=A,O=Z2,B=Dx,_=A,M=Z2,F=Dx;for(let oe=BigInt(l-1);oe>=Dx;oe--){let Q=v>>oe&Z2;F^=Q,{x_2:O,x_3:_}=D(F,O,_),{x_2:B,x_3:M}=D(F,B,M),F=Q;let Y=O+B,pe=y(Y*Y),he=O-B,Te=y(he*he),me=pe-Te,_e=_+M,wt=_-M,Nt=y(wt*Y),bt=y(_e*he),ar=Nt+bt,Ar=Nt-bt;_=y(ar*ar),M=y(E*y(Ar*Ar)),O=y(pe*Te),B=y(me*(pe+y(p*me)))}({x_2:O,x_3:_}=D(F,O,_)),{x_2:B,x_3:M}=D(F,B,M);let q=s(B);return y(O*q)}let N={secretKey:u,publicKey:u,seed:u},L=(A=c(u))=>(mn(A,N.seed),A);function I(A){let T=L(A);return{secretKey:T,publicKey:P(T)}}return{keygen:I,getSharedSecret:(A,T)=>S(A,T),getPublicKey:A=>P(A),scalarMult:S,scalarMultBase:P,utils:{randomSecretKey:L,randomPrivateKey:L},GuBytes:b.slice(),lengths:N}}var dSe=BigInt(0),Vd=BigInt(1),dZ=BigInt(2),pSe=BigInt(3),fSe=BigInt(5),hSe=BigInt(8),G2=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),Ux={p:G2,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:hSe,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function hZ(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),o=BigInt(80),s=G2,a=e*e%s*e%s,c=Oa(a,dZ,s)*a%s,l=Oa(c,Vd,s)*e%s,u=Oa(l,fSe,s)*l%s,d=Oa(u,t,s)*u%s,p=Oa(d,r,s)*d%s,f=Oa(p,n,s)*p%s,m=Oa(f,o,s)*f%s,g=Oa(m,o,s)*f%s,y=Oa(g,t,s)*u%s;return{pow_p_5_8:Oa(y,dZ,s)*e%s,b2:a}}
6186function mZ(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}var xR=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function AR(e,t){let r=G2,n=Fr(t*t*t,r),o=Fr(n*n*t,r),s=hZ(e*o).pow_p_5_8,i=Fr(e*n*s,r),a=Fr(t*i*i,r),c=i,l=Fr(i*xR,r),u=a===e,d=a===Fr(-e,r),p=a===Fr(-e*xR,r);return u&&(i=c),(d||p)&&(i=l),Hd(i,r)&&(i=Fr(-i,r)),{isValid:u||d,value:i}}var Fd=Ns(Ux.p,{isLE:!0}),mSe=Ns(Ux.n,{isLE:!0}),gSe={...Ux,Fp:Fd,hash:lE,adjustScalarBytes:mZ,uvRatio:AR},qm=lZ(gSe);var fA=(()=>{let e=Fd.ORDER;return uZ({P:e,type:"x25519",powPminus2:t=>{let{pow_p_5_8:r,b2:n}=hZ(t);return Fr(Oa(r,pSe,e)*n,e)},adjustScalarBytes:mZ})})();var vR=xR,ySe=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),wSe=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),bSe=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),xSe=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),pZ=e=>AR(Vd,e),vSe=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ER=e=>qm.Point.Fp.create(Ra(e)&vSe);function fZ(e){let{d:t}=Ux,r=G2,n=b=>Fd.create(b),o=n(vR*e*e),s=n((o+Vd)*bSe),i=BigInt(-1),a=n((i-t*o)*n(o+t)),{isValid:c,value:l}=AR(s,a),u=n(l*e);Hd(u,r)||(u=n(-u)),c||(l=u),c||(i=o);let d=n(i*(o-Vd)*xSe-a),p=l*l,f=n((l+l)*a),m=n(d*ySe),g=n(Vd-p),y=n(Vd+p);return new qm.Point(n(f*y),n(g*m),n(m*y),n(f*g))}function ESe(e){mn(e,64);let t=ER(e.subarray(0,32)),r=fZ(t),n=ER(e.subarray(32,64)),o=fZ(n);return new zd(r.add(o))}var zd=class e extends dA{constructor(t){super(t)}static fromAffine(t){return new e(qm.Point.fromAffine(t))}assertSame(t){if(!(t instanceof e))throw new Error("RistrettoPoint expected")}init(t){return new e(t)}static hashToCurve(t){return ESe(tr("ristrettoHash",t,64))}static fromBytes(t){mn(t,32);let{a:r,d:n}=Ux,o=G2,s=x=>Fd.create(x),i=ER(t);if(!zK(Fd.toBytes(i),t)||Hd(i,o))throw new Error("invalid ristretto255 encoding 1");let a=s(i*i),c=s(Vd+r*a),l=s(Vd-r*a),u=s(c*c),d=s(l*l),p=s(r*n*u-d),{isValid:f,value:m}=pZ(s(p*d)),g=s(m*l),y=s(m*g*p),b=s((i+i)*g);Hd(b,o)&&(b=s(-b));let C=s(c*y),w=s(b*C);if(!f||Hd(w,o)||C===dSe)throw new Error("invalid ristretto255 encoding 2");return new e(new qm.Point(b,C,Vd,w))}static fromHex(t){return e.fromBytes(tr("ristrettoHex",t,32))}static msm(t,r){return K2(e,qm.Point.Fn,t,r)}toBytes(){let{X:t,Y:r,Z:n,T:o}=this.ep,s=G2,i=y=>Fd.create(y),a=i(i(n+r)*i(n-r)),c=i(t*r),l=i(c*c),{value:u}=pZ(i(a*l)),d=i(u*a),p=i(u*c),f=i(d*p*o),m;if(Hd(o*f,s)){let y=i(r*vR),b=i(t*vR);t=y,r=b,m=i(d*wSe)}else m=p;Hd(t*f,s)&&(r=i(-r));let g=i((n-r)*m);return Hd(g,s)&&(g=i(-g)),Fd.toBytes(g)}equals(t){this.assertSame(t);let{X:r,Y:n}=this.ep,{X:o,Y:s}=t.ep,i=l=>Fd.create(l),a=i(r*s)===i(n*o),c=i(n*s)===i(r*o);return a||c}is0(){return this.equals(e.ZERO)}};zd.BASE=new zd(qm.Point.BASE);zd.ZERO=new zd(qm.Point.ZERO);zd.Fp=Fd;zd.Fn=mSe;var gZ=(e,t)=>(e+(e>=0?t:-t)/yZ)/t;function ASe(e,t,r){let[[n,o],[s,i]]=t,a=gZ(i*e,r),c=gZ(-o*e,r),l=e-a*n-c*s,u=-a*o-c*i,d=l<qd,p=u<qd;d&&(l=-l),p&&(u=-u);let f=Bf(Math.ceil(cA(r)/2))+J2;if(l<qd||l>=f||u<qd||u>=f)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:d,k1:l,k2neg:p,k2:u}}function SR(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function CR(e,t){let r={};for(let n of Object.keys(t))r[n]=e[n]===void 0?t[n]:e[n];return Md(r.lowS,"lowS"),Md(r.prehash,"prehash"),r.format!==void 0&&SR(r.format),r}var IR=class extends Error{constructor(t=""){super(t)}},jd={Err:IR,_tlv:{encode:(e,t)=>{let{Err:r}=jd;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=Rx(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let s=n>127?Rx(o.length/2|128):"";return Rx(e)+s+o+t},decode(e,t){let{Err:r}=jd,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let o=t[n++],s=!!(o&128),i=0;if(!s)i=o;else{let c=o&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let l=t.subarray(n,n+c);
6186if(l.length!==c)throw new r("tlv.decode: length bytes not complete");if(l[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let u of l)i=i<<8|u;if(n+=c,i<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(n,n+i);if(a.length!==i)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(n+i)}}},_int:{encode(e){let{Err:t}=jd;if(e<qd)throw new t("integer: negative integers are not allowed");let r=Rx(e);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=jd;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return z2(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=jd,o=tr("signature",e),{v:s,l:i}=n.decode(48,o);if(i.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,s),{v:l,l:u}=n.decode(2,c);if(u.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(e){let{_tlv:t,_int:r}=jd,n=t.encode(2,r.encode(e.r)),o=t.encode(2,r.encode(e.s)),s=n+o;return t.encode(48,s)}},qd=BigInt(0),J2=BigInt(1),yZ=BigInt(2),hA=BigInt(3),CSe=BigInt(4);function Y2(e,t){let{BYTES:r}=e,n;if(typeof t=="bigint")n=t;else{let o=tr("private key",t);try{n=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${r}, got ${typeof t}`)}}if(!e.isValidNot0(n))throw new Error("invalid private key: out of range [1..N-1]");return n}function SSe(e,t={}){let r=uA("weierstrass",e,t),{Fp:n,Fn:o}=r,s=r.CURVE,{h:i,n:a}=s;vl(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});let{endo:c}=t;if(c&&(!n.is0(s.a)||typeof c.beta!="bigint"||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');let l=bZ(n,o);function u(){if(!n.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(R,A,T){let{x:v,y:E}=A.toAffine(),O=n.toBytes(v);if(Md(T,"isCompressed"),T){u();let B=!n.isOdd(E);return bo(wZ(B),O)}else return bo(Uint8Array.of(4),O,n.toBytes(E))}function p(R){Wi(R,void 0,"Point");let{publicKey:A,publicKeyUncompressed:T}=l,v=R.length,E=R[0],O=R.subarray(1);if(v===A&&(E===2||E===3)){let B=n.fromBytes(O);if(!n.isValid(B))throw new Error("bad point: is not on curve, wrong x");let _=g(B),M;try{M=n.sqrt(_)}catch(oe){let Q=oe instanceof Error?": "+oe.message:"";throw new Error("bad point: is not on curve, sqrt error"+Q)}u();let F=n.isOdd(M);return(E&1)===1!==F&&(M=n.neg(M)),{x:B,y:M}}else if(v===T&&E===4){let B=n.BYTES,_=n.fromBytes(O.subarray(0,B)),M=n.fromBytes(O.subarray(B,B*2));if(!y(_,M))throw new Error("bad point: is not on curve");return{x:_,y:M}}else throw new Error(`bad point: got length ${v}, expected compressed=${A} or uncompressed=${T}`)}let f=t.toBytes||d,m=t.fromBytes||p;
vendor: 9,011 bytes, line 6186
6186function g(R){let A=n.sqr(R),T=n.mul(A,R);return n.add(n.add(T,n.mul(R,s.a)),s.b)}function y(R,A){let T=n.sqr(A),v=g(R);return n.eql(T,v)}if(!y(s.Gx,s.Gy))throw new Error("bad curve params: generator point");let b=n.mul(n.pow(s.a,hA),CSe),C=n.mul(n.sqr(s.b),BigInt(27));if(n.is0(n.add(b,C)))throw new Error("bad curve params: a or b");function w(R,A,T=!1){if(!n.isValid(A)||T&&n.is0(A))throw new Error(`bad point coordinate ${R}`);return A}function x(R){if(!(R instanceof N))throw new Error("ProjectivePoint expected")}function S(R){if(!c||!c.basises)throw new Error("no endo");return ASe(R,c.basises,o.ORDER)}let P=j2((R,A)=>{let{X:T,Y:v,Z:E}=R;if(n.eql(E,n.ONE))return{x:T,y:v};let O=R.is0();A==null&&(A=O?n.ONE:n.inv(E));let B=n.mul(T,A),_=n.mul(v,A),M=n.mul(E,A);if(O)return{x:n.ZERO,y:n.ZERO};if(!n.eql(M,n.ONE))throw new Error("invZ was invalid");return{x:B,y:_}}),D=j2(R=>{if(R.is0()){if(t.allowInfinityPoint&&!n.is0(R.Y))return;throw new Error("bad point: ZERO")}let{x:A,y:T}=R.toAffine();if(!n.isValid(A)||!n.isValid(T))throw new Error("bad point: x or y not field elements");if(!y(A,T))throw new Error("bad point: equation left != right");if(!R.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function U(R,A,T,v,E){return T=new N(n.mul(T.X,R),T.Y,T.Z),A=kx(v,A),T=kx(E,T),A.add(T)}class N{constructor(A,T,v){this.X=w("x",A),this.Y=w("y",T,!0),this.Z=w("z",v),Object.freeze(this)}static CURVE(){return s}static fromAffine(A){let{x:T,y:v}=A||{};if(!A||!n.isValid(T)||!n.isValid(v))throw new Error("invalid affine point");if(A instanceof N)throw new Error("projective point not allowed");return n.is0(T)&&n.is0(v)?N.ZERO:new N(T,v,n.ONE)}static fromBytes(A){let T=N.fromAffine(m(Wi(A,void 0,"point")));return T.assertValidity(),T}static fromHex(A){return N.fromBytes(tr("pointHex",A))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(A=8,T=!0){return I.createCache(this,A),T||this.multiply(hA),this}assertValidity(){D(this)}hasEvenY(){let{y:A}=this.toAffine();if(!n.isOdd)throw new Error("Field doesn't support isOdd");return!n.isOdd(A)}equals(A){x(A);let{X:T,Y:v,Z:E}=this,{X:O,Y:B,Z:_}=A,M=n.eql(n.mul(T,_),n.mul(O,E)),F=n.eql(n.mul(v,_),n.mul(B,E));return M&&F}negate(){return new N(this.X,n.neg(this.Y),this.Z)}double(){let{a:A,b:T}=s,v=n.mul(T,hA),{X:E,Y:O,Z:B}=this,_=n.ZERO,M=n.ZERO,F=n.ZERO,q=n.mul(E,E),oe=n.mul(O,O),Q=n.mul(B,B),Y=n.mul(E,O);return Y=n.add(Y,Y),F=n.mul(E,B),F=n.add(F,F),_=n.mul(A,F),M=n.mul(v,Q),M=n.add(_,M),_=n.sub(oe,M),M=n.add(oe,M),M=n.mul(_,M),_=n.mul(Y,_),F=n.mul(v,F),Q=n.mul(A,Q),Y=n.sub(q,Q),Y=n.mul(A,Y),Y=n.add(Y,F),F=n.add(q,q),q=n.add(F,q),q=n.add(q,Q),q=n.mul(q,Y),M=n.add(M,q),Q=n.mul(O,B),Q=n.add(Q,Q),q=n.mul(Q,Y),_=n.sub(_,q),F=n.mul(Q,oe),F=n.add(F,F),F=n.add(F,F),new N(_,M,F)}add(A){x(A);let{X:T,Y:v,Z:E}=this,{X:O,Y:B,Z:_}=A,M=n.ZERO,F=n.ZERO,q=n.ZERO,oe=s.a,Q=n.mul(s.b,hA),Y=n.mul(T,O),pe=n.mul(v,B),he=n.mul(E,_),Te=n.add(T,v),me=n.add(O,B);Te=n.mul(Te,me),me=n.add(Y,pe),Te=n.sub(Te,me),me=n.add(T,E);let _e=n.add(O,_);return me=n.mul(me,_e),_e=n.add(Y,he),me=n.sub(me,_e),_e=n.add(v,E),M=n.add(B,_),_e=n.mul(_e,M),M=n.add(pe,he),_e=n.sub(_e,M),q=n.mul(oe,me),M=n.mul(Q,he),q=n.add(M,q),M=n.sub(pe,q),q=n.add(pe,q),F=n.mul(M,q),pe=n.add(Y,Y),pe=n.add(pe,Y),he=n.mul(oe,he),me=n.mul(Q,me),pe=n.add(pe,he),he=n.sub(Y,he),he=n.mul(oe,he),me=n.add(me,he),Y=n.mul(pe,me),F=n.add(F,Y),Y=n.mul(_e,me),M=n.mul(Te,M),M=n.sub(M,Y),Y=n.mul(Te,pe),q=n.mul(_e,q),q=n.add(q,Y),new N(M,F,q)}subtract(A){return this.add(A.negate())}is0(){return this.equals(N.ZERO)}multiply(A){let{endo:T}=t;if(!o.isValidNot0(A))throw new Error("invalid scalar: out of range");let v,E,O=B=>I.cached(this,B,_=>$d(N,_));if(T){let{k1neg:B,k1:_,k2neg:M,k2:F}=S(A),{p:q,f:oe}=O(_),{p:Q,f:Y}=O(F);E=oe.add(Y),v=U(T.beta,q,Q,B,M)}else{let{p:B,f:_}=O(A);v=B,E=_}return $d(N,[v,E])[0]}multiplyUnsafe(A){let{endo:T}=t,v=this;if(!o.isValid(A))throw new Error("invalid scalar: out of range");if(A===qd||v.is0())return N.ZERO;if(A===J2)return v;if(I.hasCache(this))return this.multiply(A);if(T){let{k1neg:E,k1:O,k2neg:B,k2:_}=S(A),{p1:M,p2:F}=cZ(N,v,O,_);return U(T.beta,M,F,E,B)}else return I.unsafe(v,A)}multiplyAndAddUnsafe(A,T,v){let E=this.multiplyUnsafe(T).add(A.multiplyUnsafe(v));return E.is0()?void 0:E}toAffine(A){return P(this,A)}isTorsionFree(){let{isTorsionFree:A}=t;return i===J2?!0:A?A(N,this):I.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:A}=t;return i===J2?this:A?A(N,this):this.multiplyUnsafe(i)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}toBytes(A=!0){return Md(A,"isCompressed"),this.assertValidity(),f(N,this,A)}toHex(A=!0){return _a(this.toBytes(A))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(A=!0){return this.toBytes(A)}_setWindowSize(A){this.precompute(A)}static normalizeZ(A){return $d(N,A)}static msm(A,T){return K2(N,o,A,T)}static fromPrivateKey(A){return N.BASE.multiply(Y2(o,A))}}N.BASE=new N(s.Gx,s.Gy,n.ONE),N.ZERO=new N(n.ZERO,n.ONE,n.ZERO),N.Fp=n,N.Fn=o;let L=o.BITS,I=new W2(N,t.endo?Math.ceil(L/2):L);return N.BASE.precompute(8),N}function wZ(e){return Uint8Array.of(e?2:3)}function bZ(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function ISe(e,t={}){let{Fn:r}=e,n=t.randomBytes||Ss,o=Object.assign(bZ(e.Fp,r),{seed:mR(r.ORDER)});function s(f){try{return!!Y2(r,f)}catch{return!1}}function i(f,m){let{publicKey:g,publicKeyUncompressed:y}=o;try{let b=f.length;return m===!0&&b!==g||m===!1&&b!==y?!1:!!e.fromBytes(f)}catch{return!1}}function a(f=n(o.seed)){return rZ(Wi(f,o.seed,"seed"),r.ORDER)}function c(f,m=!0){return e.BASE.multiply(Y2(r,f)).toBytes(m)}function l(f){let m=a(f);return{secretKey:m,publicKey:c(m)}}function u(f){if(typeof f=="bigint")return!1;if(f instanceof e)return!0;let{secretKey:m,publicKey:g,publicKeyUncompressed:y}=o;if(r.allowedLengths||m===g)return;let b=tr("key",f).length;return b===g||b===y}function d(f,m,g=!0){if(u(f)===!0)throw new Error("first arg must be private key");if(u(m)===!1)throw new Error("second arg must be public key");let y=Y2(r,f);return e.fromHex(m).multiply(y).toBytes(g)}return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:l,Point:e,utils:{isValidSecretKey:s,isValidPublicKey:i,randomSecretKey:a,isValidPrivateKey:s,randomPrivateKey:a,normPrivateKeyToScalar:f=>Y2(r,f),precompute(f=8,m=e.BASE){return m.precompute(f,!1)}},lengths:o})}function TSe(e,t,r={}){_m(t),vl(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});let n=r.randomBytes||Ss,o=r.hmac||((T,...v)=>Tf(t,T,bo(...v))),{Fp:s,Fn:i}=e,{ORDER:a,BITS:c}=i,{keygen:l,getPublicKey:u,getSharedSecret:d,utils:p,lengths:f}=ISe(e,r),m={prehash:!1,lowS:typeof r.lowS=="boolean"?r.lowS:!1,format:void 0,extraEntropy:!1},g="compact";function y(T){let v=a>>J2;return T>v}function b(T,v){if(!i.isValidNot0(v))throw new Error(`invalid signature ${T}: out of range 1..Point.Fn.ORDER`);return v}function C(T,v){SR(v);let E=f.signature,O=v==="compact"?E:v==="recovered"?E+1:void 0;return Wi(T,O,`${v} signature`)}class w{constructor(v,E,O){this.r=b("r",v),this.s=b("s",E),O!=null&&(this.recovery=O),Object.freeze(this)}static fromBytes(v,E=g){C(v,E);let O;if(E==="der"){let{r:F,s:q}=jd.toSig(Wi(v));return new w(F,q)}E==="recovered"&&(O=v[0],E="compact",v=v.subarray(1));let B=i.BYTES,_=v.subarray(0,B),M=v.subarray(B,B*2);return new w(i.fromBytes(_),i.fromBytes(M),O)}static fromHex(v,E){return this.fromBytes(Nm(v),E)}addRecoveryBit(v){return new w(this.r,this.s,v)}recoverPublicKey(v){let E=s.ORDER,{r:O,s:B,recovery:_}=this;if(_==null||![0,1,2,3].includes(_))throw new Error("recovery id invalid");if(a*yZ<E&&_>1)throw new Error("recovery id is ambiguous for h>1 curve");let F=_===2||_===3?O+a:O;if(!s.isValid(F))throw new Error("recovery id 2 or 3 invalid");let q=s.toBytes(F),oe=e.fromBytes(bo(wZ((_&1)===0),q)),Q=i.inv(F),Y=S(tr("msgHash",v)),pe=i.create(-Y*Q),he=i.create(B*Q),Te=e.BASE.multiplyUnsafe(pe).add(oe.multiplyUnsafe(he));if(Te.is0())throw new Error("point at infinify");return Te.assertValidity(),Te}hasHighS(){return y(this.s)}toBytes(v=g){if(SR(v),v==="der")return Nm(jd.hexFromSig(this));let E=i.toBytes(this.r),O=i.toBytes(this.s);if(v==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return bo(Uint8Array.of(this.recovery),E,O)}return bo(E,O)}toHex(v){return _a(this.toBytes(v))}assertValidity(){}static fromCompact(v){return w.fromBytes(tr("sig",v),"compact")}static fromDER(v){return w.fromBytes(tr("sig",v),"der")}normalizeS(){return this.hasHighS()?new w(this.r,i.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return _a(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return _a(this.toBytes("compact"))}}let x=r.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");
6186let E=z2(v),O=v.length*8-c;return O>0?E>>BigInt(O):E},S=r.bits2int_modN||function(v){return i.create(x(v))},P=Bf(c);function D(T){return Of("num < 2^"+c,T,qd,P),i.toBytes(T)}function U(T,v){return Wi(T,void 0,"message"),v?Wi(t(T),void 0,"prehashed message"):T}function N(T,v,E){if(["recovered","canonical"].some(pe=>pe in E))throw new Error("sign() legacy options not supported");let{lowS:O,prehash:B,extraEntropy:_}=CR(E,m);T=U(T,B);let M=S(T),F=Y2(i,v),q=[D(F),D(M)];if(_!=null&&_!==!1){let pe=_===!0?n(f.secretKey):_;q.push(tr("extraEntropy",pe))}let oe=bo(...q),Q=M;function Y(pe){let he=x(pe);if(!i.isValidNot0(he))return;let Te=i.inv(he),me=e.BASE.multiply(he).toAffine(),_e=i.create(me.x);if(_e===qd)return;let wt=i.create(Te*i.create(Q+_e*F));if(wt===qd)return;let Nt=(me.x===_e?0:2)|Number(me.y&J2),bt=wt;return O&&y(wt)&&(bt=i.neg(wt),Nt^=1),new w(_e,bt,Nt)}return{seed:oe,k2sig:Y}}function L(T,v,E={}){T=tr("message",T);let{seed:O,k2sig:B}=N(T,v,E);return qK(t.outputLen,i.BYTES,o)(O,B)}function I(T){let v,E=typeof T=="string"||Td(T),O=!E&&T!==null&&typeof T=="object"&&typeof T.r=="bigint"&&typeof T.s=="bigint";if(!E&&!O)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(O)v=new w(T.r,T.s);else if(E){try{v=w.fromBytes(tr("sig",T),"der")}catch(B){if(!(B instanceof jd.Err))throw B}if(!v)try{v=w.fromBytes(tr("sig",T),"compact")}catch{return!1}}return v||!1}function R(T,v,E,O={}){let{lowS:B,prehash:_,format:M}=CR(O,m);if(E=tr("publicKey",E),v=U(tr("message",v),_),"strict"in O)throw new Error("options.strict was renamed to lowS");let F=M===void 0?I(T):w.fromBytes(tr("sig",T),M);if(F===!1)return!1;try{let q=e.fromBytes(E);if(B&&F.hasHighS())return!1;let{r:oe,s:Q}=F,Y=S(v),pe=i.inv(Q),he=i.create(Y*pe),Te=i.create(oe*pe),me=e.BASE.multiplyUnsafe(he).add(q.multiplyUnsafe(Te));return me.is0()?!1:i.create(me.x)===oe}catch{return!1}}function A(T,v,E={}){let{prehash:O}=CR(E,m);return v=U(v,O),w.fromBytes(T,"recovered").recoverPublicKey(v).toBytes()}return Object.freeze({keygen:l,getPublicKey:u,getSharedSecret:d,utils:p,lengths:f,Point:e,sign:L,verify:R,recoverPublicKey:A,Signature:w,hash:t})}function _Se(e){let t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},r=e.Fp,n=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(i=>Math.ceil(i/2)))):void 0,o=Ns(t.n,{BITS:e.nBitLength,allowedLengths:n,modFromBytes:e.wrapPrivateKey}),s={Fp:r,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:s}}function PSe(e){let{CURVE:t,curveOpts:r}=_Se(e),n={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:r,hash:e.hash,ecdsaOpts:n}}function NSe(e,t){let r=t.Point;return Object.assign({},t,{ProjectivePoint:r,CURVE:Object.assign({},e,lA(r.Fn.ORDER,r.Fn.BITS))})}function xZ(e){let{CURVE:t,curveOpts:r,hash:n,ecdsaOpts:o}=PSe(e),s=SSe(t,r),i=TSe(s,n,o);return NSe(e,i)}function mA(e,t){let r=n=>xZ({...e,hash:n});return{...r(t),create:r}}var vZ={p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")},EZ={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")},AZ={p:BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),h:BigInt(1),a:BigInt("0x1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc"),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650")},RSe=Ns(vZ.p),OSe=Ns(EZ.p),BSe=Ns(AZ.p);
6186var CZ=mA({...vZ,Fp:RSe,lowS:!1},Pd);var got=mA({...EZ,Fp:OSe,lowS:!1},tq);var yot=mA({...AZ,Fp:BSe,lowS:!1,allowedPrivateKeyLengths:[130,131,132]},lE);var SZ=CZ;Zm();rO();var QG=Lt(iO(),1);jf();var d_e=":";function Ec(e){let[t,r]=e.split(d_e);return{namespace:t,reference:r}}function wO(e,t=[]){let r=[];return Object.keys(e).forEach(n=>{if(t.length&&!t.includes(n))return;let o=e[n];r.push(...o.accounts)}),r}function XG(e,t){return e.includes(":")?[e]:t.chains||[]}var p_e={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},f_e={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ee(e,t){let{message:r,code:n}=f_e[e];return{message:t?`${r} ${t}`:r,code:n}}function cr(e,t){let{message:r,code:n}=p_e[e];return{message:t?`${r} ${t}`:r,code:n}}var h_e="ReactNative",ai={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};var m_e="js";function Wx(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Yd(){return!(0,vc.getDocument)()&&!!(0,vc.getNavigator)()&&navigator.product===h_e}function eY(){return Yd()&&typeof global<"u"&&typeof global?.Platform<"u"&&global?.Platform.OS==="android"}function tY(){return Yd()&&typeof global<"u"&&typeof global?.Platform<"u"&&global?.Platform.OS==="ios"}function Qm(){return!Wx()&&!!(0,vc.getNavigator)()&&!!(0,vc.getDocument)()}function Kx(){return Yd()?ai.reactNative:Wx()?ai.node:Qm()?ai.browser:ai.unknown}function bO(){try{return Yd()&&typeof global<"u"&&typeof global?.Application<"u"?global.Application?.applicationId:void 0}catch{return}}function g_e(e,t){let r=new URLSearchParams(e);return Object.entries(t).sort(([n],[o])=>n.localeCompare(o)).forEach(([n,o])=>{o!=null&&r.set(n,String(o))}),r.toString()}function rY(e){let t=xO();try{return e?.url&&t.url&&new URL(e.url).host!==new URL(t.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${t.url}. This is probably unintended and can lead to issues.`),e.url=t.url),e?.icons?.length&&e.icons.length>0&&(e.icons=e.icons.filter(r=>r!=="")),{...t,...e,url:e?.url||t.url,name:e?.name||t.name,description:e?.description||t.description,icons:e?.icons?.length&&e.icons.length>0?e.icons:t.icons}}catch(r){return console.warn("Error populating app metadata",r),e||t}}function xO(){return(0,JG.getWindowMetadata)()||{name:"",description:"",url:"",icons:[""]}}function y_e(){if(Kx()===ai.reactNative&&typeof global<"u"&&typeof global?.Platform<"u"){let{OS:r,Version:n}=global.Platform;return[r,n].join("-")}let e=Y5();if(e===null)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return e.type==="browser"?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function w_e(){let e=Kx();return e===ai.browser?[e,(0,vc.getLocation)()?.host||"unknown"].join(":"):e}function vO(e,t,r){let n=y_e(),o=w_e();return[[e,t].join("-"),[m_e,r].join("-"),n,o].join("/")}function nY({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:o,projectId:s,useOnCloseEvent:i,bundleId:a,packageName:c}){let l=r.split("?"),u=vO(e,t,n),d={auth:o,ua:u,projectId:s,useOnCloseEvent:i||void 0,packageName:c||void 0,bundleId:a||void 0},p=g_e(l[1]||"",d);return l[0]+"?"+p}function Ym(e,t){return e.filter(r=>t.includes(r)).length===e.length}function $A(e){return Object.fromEntries(e.entries())}function FA(e){return new Map(Object.entries(e))}function Jd(e=Gd.FIVE_MINUTES,t){let r=(0,Gd.toMiliseconds)(e||Gd.FIVE_MINUTES),n,o,s,i;return{resolve:a=>{s&&n&&(clearTimeout(s),n(a),i=Promise.resolve(a))},reject:a=>{s&&o&&(clearTimeout(s),o(a))},done:()=>new Promise((a,c)=>{if(i)return a(i);s=setTimeout(()=>{let l=Ee("EXPIRED"),u=new Error(t||l.message);u.code=l.code,c(u)},r),n=a,o=c})}}function Ba(e,t,r){return new Promise(async(n,o)=>{let s=setTimeout(()=>
vendor: 6,391 bytes, lines 6186-6187
6186o(new Error(r)),t);try{let i=await e;n(i)}catch(i){o(i)}clearTimeout(s)})}function oY(e,t){if(typeof t=="string"&&t.startsWith(`${e}:`))return t;if(e.toLowerCase()==="topic"){if(typeof t!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}else if(e.toLowerCase()==="id"){if(typeof t!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw new Error(`Unknown expirer target type: ${e}`)}function sY(e){return oY("topic",e)}function iY(e){return oY("id",e)}function VA(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if(t==="topic"&&typeof r=="string")n.topic=r;else if(t==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function en(e,t){return(0,Gd.fromMiliseconds)((t||Date.now())+(0,Gd.toMiliseconds)(e))}function Ki(e){return Date.now()>=(0,Gd.toMiliseconds)(e)}function nr(e,t){return`${e}${t?`:${t}`:""}`}function xc(e=[],t=[]){return[...new Set([...e,...t])]}async function aY({id:e,topic:t,wcDeepLink:r}){try{if(!r)return;let n=(typeof r=="string"?JSON.parse(r):r)?.href;if(typeof n!="string")return;let o=b_e(n,e,t),s=Kx();if(s===ai.browser){if(!(0,vc.getDocument)()?.hasFocus()){console.warn("Document does not have focus, skipping deeplink.");return}x_e(o)}else s===ai.reactNative&&typeof global?.Linking<"u"&&await global.Linking.openURL(o)}catch(n){console.error(n)}}function b_e(e,t,r){let n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let o=`${e}`;if(e.startsWith("https://t.me")){let s=e.includes("?")?"&startapp=":"?startapp=";o=`${o}${s}${A_e(n,!0)}`}else o=`${o}/wc?${n}`;return o}function x_e(e){let t="_self";E_e()?t="_top":(v_e()||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"),window.open(e,t,"noreferrer noopener")}async function cY(e,t){let r="";try{if(Qm()&&(r=localStorage.getItem(t),r))return r;r=await e.getItem(t)}catch(n){console.error(n)}return r}function EO(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function AO(){return typeof crypto<"u"&&crypto?.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Zx(){return typeof process<"u"&&process.env.IS_VITEST==="true"}function v_e(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function E_e(){try{return window.self!==window.top}catch{return!1}}function A_e(e,t=!1){let r=new TextEncoder().encode(e),n=new Array(r.length);for(let s=0;s<r.length;s++)n[s]=String.fromCharCode(r[s]);let o=btoa(n.join(""));return t?o.replace(/[=]/g,""):o}function lY(e){let t=e+"=".repeat((4-e.length%4)%4),r=atob(t),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return new TextDecoder().decode(n)}function uY(e){return new Promise(t=>setTimeout(t,e))}var UA=class{constructor({limit:t}){this.limit=t,this.set=new Set}add(t){if(!this.set.has(t)){if(this.set.size>=this.limit){let r=this.set.values().next().value;r&&this.set.delete(r)}this.set.add(t)}}has(t){return this.set.has(t)}},C_e="https://rpc.walletconnect.org/v1";function ny(e){let t=e+"=".repeat((4-e.length%4)%4),r=atob(t),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return n}function dY(e){let t=`�Ethereum Signed Message:
6187${e.length}`,r=new TextEncoder().encode(t+e);return"0x"+Rt(aE(r),"base16")}async function S_e(e,t,r,n,o,s){switch(r.t){case"eip191":return await I_e(e,t,r.s);case"eip1271":return await T_e(e,t,r.s,n,o,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function I_e(e,t,r){let n=OE.fromHex(r);return ME.recoverAddress({payload:dY(t),signature:n}).toLowerCase()===e.toLowerCase()}async function T_e(e,t,r,n,o,s){let i=Ec(n);if(!i.namespace||!i.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{let a="0x1626ba7e",c="0000000000000000000000000000000000000000000000000000000000000040",l=r.substring(2),u=(l.length/2).toString(16).padStart(64,"0"),d=(t.startsWith("0x")?t:dY(t)).substring(2),p=a+d+c+u+l,f=await fetch(`${s||C_e}/?chainId=${n}&projectId=${o}`,{headers:{"Content-Type":"application/json"},method:"POST",body:JSON.stringify({id:__e(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:p},"latest"]})}),{result:m}=await f.json();return m?m.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function __e(){return Date.now()+Math.floor(Math.random()*1e3)}function pY(e){let t=ny(e),r=t[0];if(r===0)throw new Error("No signatures found");let n=1+r*64;if(t.length<n)throw new Error("Transaction data too short for claimed signature count");if(t.length<100)throw new Error("Transaction too short");let o=t.slice(1,65);return Na.encode(o)}function fY(e){let t=ny(e),r=new TextEncoder().encode("TransactionData::"),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);let o=Qq(n,{dkLen:32});return Na.encode(o)}function CO(e){let t=new Uint8Array(Pd(P_e(e)));return Na.encode(t)}function P_e(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="object"&&e?.data)return new Uint8Array(Object.values(e.data));if(typeof e=="object"&&e)return new Uint8Array(Object.values(e));throw new Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function SO(e){let t=ny(e),r=Ex(t).txn;if(!r)throw new Error("Invalid signed transaction: missing 'txn' field");let n=wx(r),o=new TextEncoder().encode("TX"),s=_s([o,new Uint8Array(n)]),i=rq(s);return LE.encode(i).replace(/=+$/,"")}function gO(e){let t=[],r=BigInt(e);for(;r>=0x80n;)t.push(Number(r&0x7fn|0x80n)),r>>=7n;return t.push(Number(r)),new Uint8Array(t)}function hY(e){let t=ny(e.signed.bodyBytes),r=ny(e.signed.authInfoBytes),n=ny(e.signature.signature),o=[];o.push(new Uint8Array([10])),o.push(gO(t.length)),o.push(t),o.push(new Uint8Array([18])),o.push(gO(r.length)),o.push(r),o.push(new Uint8Array([26])),o.push(gO(n.length)),o.push(n);let s=_s(o),i=Pd(s);return Rt(i,"base16").toUpperCase()}function mY(e){let t=[];try{if(typeof e=="string")return t.push(e),t;if(typeof e!="object")return t;
6187e?.id&&t.push(e.id);let r=e?.capabilities?.caip345?.transactionHashes;r&&t.push(...r)}catch(r){console.warn("getWalletSendCallsHashes failed: ",r)}return t}var gY="did:pkh:",N_e={eip155:"Ethereum",solana:"Solana",bip122:"Bitcoin"},R_e=e=>e?N_e[e]||e:"",zA=e=>e?.split(":"),O_e=e=>{let t=e&&zA(e);if(t)return e.includes(gY)?t[3]:t[1]},B_e=e=>{let t=e&&zA(e);if(t)return e.includes(gY)?t[2]:t[0]},jA=e=>{let t=e&&zA(e);if(t)return t[2]+":"+t[3]},Gx=e=>{let t=e&&zA(e);if(t)return t.pop()};async function IO(e){let{cacao:t,projectId:r}=e,{s:n,p:o}=t,s;try{s=TO(o,o.iss)}catch{return!1}let i=Gx(o.iss);return await S_e(i,s,n,jA(o.iss),r)}var TO=(e,t)=>{let r=B_e(t);if(!r)throw new Error("Invalid issuer: "+t);let n=`${e.domain} wants you to sign in with your ${R_e(r)} account:`,o=Gx(t);if(!e.aud&&!e.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let s=e.statement||void 0,i=`URI: ${e.aud||e.uri}`,a=`Version: ${e.version}`,c=`Chain ID: ${O_e(t)}`,l=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,d=e.exp?`Expiration Time: ${e.exp}`:void 0,p=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,m=e.resources?`Resources:${e.resources.map(y=>`
6188- ${y}`).join("")}`:void 0,g=Yx(e.resources);if(g){let y=qx(g);s=$_e(s,y)}if(s&&/\r|\n/.test(s))throw new Error("Statement must not contain line breaks (`\\r` or `\\n`)");return[n,o,"",s,"",i,a,c,l,u,d,p,f,m].filter(y=>y!=null).join(`
6189`)};function k_e(e){let t=JSON.stringify(e),r=new TextEncoder().encode(t),n=new Array(r.length);for(let o=0;o<r.length;o++)n[o]=String.fromCharCode(r[o]);return btoa(n.join(""))}function D_e(e){let t=e+"=".repeat((4-e.length%4)%4),r=atob(t),n=new Uint8Array(r.length);for(let o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return JSON.parse(new TextDecoder().decode(n))}function Jm(e){if(!e)throw new Error("No recap provided, value is undefined");if(!e.att)throw new Error("No `att` property found");let t=Object.keys(e.att);if(!t?.length)throw new Error("No resources found in `att` property");t.forEach(r=>{let n=e.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(o=>{let s=n[o];if(!Array.isArray(s))throw new Error(`Ability limits ${o} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${o} is empty array, must be an array with objects`);s.forEach(i=>{if(typeof i!="object")throw new Error(`Ability limits (${o}) must be an array of objects, found: ${i}`)})})})}function U_e(e,t,r,n={}){return r?.sort((o,s)=>o.localeCompare(s)),{att:{[e]:L_e(t,r,n)}}}function L_e(e,t,r={}){t=t?.sort((o,s)=>o.localeCompare(s));let n=t.map(o=>({[`${e}/${o}`]:[r]}));return Object.assign({},...n)}function yY(e){return Jm(e),`urn:recap:${k_e(e).replace(/=/g,"")}`}function qx(e){let t=D_e(e.replace("urn:recap:",""));return Jm(t),t}function wY(e,t,r){let n=U_e(e,t,r);return yY(n)}function M_e(e){return e&&e.includes("urn:recap:")}function bY(e,t){let r=qx(e),n=qx(t),o=H_e(r,n);return yY(o)}function H_e(e,t){Jm(e),Jm(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((o,s)=>o.localeCompare(s)),n={att:{}};return r.forEach(o=>{Object.keys(e.att?.[o]||{}).concat(Object.keys(t.att?.[o]||{})).sort((s,i)=>s.localeCompare(i)).forEach(s=>{n.att[o]={...n.att[o],[s]:e.att[o]?.[s]||t.att[o]?.[s]}})}),n}function $_e(e="",t){Jm(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let n=[],o=0;Object.keys(t.att).forEach(a=>{let c=Object.keys(t.att[a]).map(d=>({ability:d.split("/")[0],action:d.split("/")[1]}));c.sort((d,p)=>d.action.localeCompare(p.action));let l={};
6189c.forEach(d=>{l[d.ability]||(l[d.ability]=[]),l[d.ability].push(d.action)});let u=Object.keys(l).map(d=>(o++,`(${o}) '${d}': '${l[d].join("', '")}' for '${a}'.`));n.push(u.join(", ").replace(".,","."))});let s=n.join(" "),i=`${r}${s}`;return`${e?e+" ":""}${i}`}function _O(e){let t=qx(e);Jm(t);let r=t.att?.eip155;return r?Object.keys(r).map(n=>n.split("/")[1]):[]}function PO(e){let t=qx(e);Jm(t);let r=[];return Object.values(t.att).forEach(n=>{Object.values(n).forEach(o=>{o?.[0]?.chains&&r.push(o[0].chains)})}),[...new Set(r.flat())]}function Yx(e){if(!e)return;let t=e?.[e.length-1];return M_e(t)?t:void 0}var xY="base10",Wo="base16",jn="base64pad",ka="base64url",Jx="utf8",vY=0,Ac=1,Qd=2,F_e=0,KG=1,jx=12,NO=32;function EY(){let e=fA.utils.randomPrivateKey(),t=fA.getPublicKey(e);return{privateKey:Rt(e,Wo),publicKey:Rt(t,Wo)}}function qA(){let e=Ss(NO);return Rt(e,Wo)}function AY(e,t){let r=fA.getSharedSecret(Yt(e,Wo),Yt(t,Wo)),n=FK(ix,r,void 0,void 0,NO);return Rt(n,Wo)}function oy(e){let t=ix(Yt(e,Wo));return Rt(t,Wo)}function ci(e){let t=ix(Yt(e,Jx));return Rt(t,Wo)}function CY(e){return Yt(`${e}`,xY)}function qf(e){return Number(Rt(e,xY))}function SY(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function LA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function IY(e){let t=CY(typeof e.type<"u"?e.type:vY);if(qf(t)===Ac&&typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");let r=typeof e.senderPublicKey<"u"?Yt(e.senderPublicKey,Wo):void 0,n=typeof e.iv<"u"?Yt(e.iv,Wo):Ss(jx),o=Yt(e.symKey,Wo),s=iR(o,n).encrypt(Yt(e.message,Jx)),i=NY({type:t,sealed:s,iv:n,senderPublicKey:r});return e.encoding===ka?SY(i):i}function TY(e){let t=Yt(e.symKey,Wo),{sealed:r,iv:n}=sy({encoded:e.encoded,encoding:e.encoding}),o=iR(t,n).decrypt(r);if(o===null)throw new Error("Failed to decrypt");return Rt(o,Jx)}function _Y(e,t){let r=CY(Qd),n=Ss(jx),o=Yt(e,Jx),s=NY({type:r,sealed:o,iv:n});return t===ka?SY(s):s}function PY(e,t){let{sealed:r}=sy({encoded:e,encoding:t});return Rt(r,Jx)}function NY(e){if(qf(e.type)===Qd)return Rt(_s([e.type,e.sealed]),jn);if(qf(e.type)===Ac){if(typeof e.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Rt(_s([e.type,e.senderPublicKey,e.iv,e.sealed]),jn)}return Rt(_s([e.type,e.iv,e.sealed]),jn)}function sy(e){let t=(e.encoding||jn)===ka?LA(e.encoded):e.encoded,r=Yt(t,jn),n=r.slice(F_e,KG),o=KG;if(qf(n)===Ac){let c=o+NO,l=c+jx,u=r.slice(o,c),d=r.slice(c,l),p=r.slice(l);return{type:n,sealed:p,iv:d,senderPublicKey:u}}if(qf(n)===Qd){let c=r.slice(o),l=Ss(jx);return{type:n,sealed:c,iv:l}}let s=o+jx,i=r.slice(o,s),a=r.slice(s);return{type:n,sealed:a,iv:i}}function RY(e,t){let r=sy({encoded:e,encoding:t?.encoding});return RO({type:qf(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?Rt(r.senderPublicKey,Wo):void 0,receiverPublicKey:t?.receiverPublicKey})}function RO(e){let t=e?.type||vY;if(t===Ac){if(typeof e?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}function OO(e){return e.type===Ac&&typeof e.senderPublicKey=="string"&&typeof e.receiverPublicKey=="string"}function BO(e){return e.type===Qd}function V_e(e){let t=Yt(LA(e.x),jn),r=Yt(LA(e.y),jn);return _s([new Uint8Array([4]),t,r])}function OY(e,t){let[r,n,o]=e.split("."),s=Yt(LA(o),jn);if(s.length!==64)throw new Error("Invalid signature length");let i=s.slice(0,32),a=s.slice(32,64),c=`${r}.${n}`,l=ix(c),u=V_e(t);if(!SZ.verify(_s([i,a]),l,u))throw new Error("Invalid signature");return Al(e).payload}var z_e="irn";function Qx(e){return e?.relay||{protocol:z_e}}function Xm(e){let t=IA[e];if(typeof t>"u")throw new Error(`Relay Protocol not supported: ${e}`);return t}function j_e(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(o=>{if(o.startsWith(n)){let s=o.replace(n,""),i=e[o];r[s]=i}}),r}function kO(e){if(!e.includes("wc:")){let l=lY(e);l?.includes("wc:")&&(e=l)}e=e.includes("wc://")?e.replace("wc://",""):e,e=e.includes("wc:")?e.replace("wc:",""):e;let t=e.indexOf(":"),r=e.indexOf("?")!==-1?e.indexOf("?"):void 0,n=e.substring(0,t),o=e.substring(t+1,r).split("@"),s=typeof r<"u"?e.substring(r):"",i=new URLSearchParams(s),a=Object.fromEntries(i.entries()),c=typeof a.methods=="str
6189ing"?a.methods.split(","):void 0;return{protocol:n,topic:q_e(o[0]),version:parseInt(o[1],10),symKey:a.symKey,relay:j_e(a),methods:c,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function q_e(e){return e.startsWith("//")?e.substring(2):e}function W_e(e,t="-"){let r="relay",n={};return Object.keys(e).forEach(o=>{let s=o,i=r+t+s;e[s]&&(n[i]=e[s])}),n}function DO(e){let t=new URLSearchParams,r={...W_e(e.relay),symKey:e.symKey,...e.expiryTimestamp&&{expiryTimestamp:e.expiryTimestamp.toString()},...e.methods&&{methods:e.methods.join(",")}};return Object.entries(r).sort(([n],[o])=>n.localeCompare(o)).forEach(([n,o])=>{o!==void 0&&t.append(n,String(o))}),`${e.protocol}:${e.topic}@${e.version}?${t}`}function Xx(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}function iy(e){let t=[];return e.forEach(r=>{let[n,o]=r.split(":");t.push(`${n}:${o}`)}),t}function UO(e){let t=[];return Object.values(e).forEach(r=>{t.push(...iy(r.accounts))}),[...new Set(t)]}function BY(e){let t=[];return Object.values(e).forEach(r=>{t.push(...r.methods)}),[...new Set(t)]}function kY(e){let t=[];return Object.values(e).forEach(r=>{t.push(...r.events)}),[...new Set(t)]}function K_e(e,t){let r=[];return Object.values(e).forEach(n=>{iy(n.accounts).includes(t)&&r.push(...n.methods)}),r}function Z_e(e,t){let r=[];return Object.values(e).forEach(n=>{iy(n.accounts).includes(t)&&r.push(...n.events)}),r}function e8(e){return e.includes(":")}function e1(e){return e8(e)?e.split(":")[0]:e}function ZG(e){let t={};if(!Da(e))return t;for(let[r,n]of Object.entries(e)){let o=e8(r)?[r]:n.chains,s=n.methods||[],i=n.events||[],a=e1(r);t[a]={...t[a],chains:xc(o,t[a]?.chains),methods:xc(s,t[a]?.methods),events:xc(i,t[a]?.events)}}return t}function G_e(e){let t={};return e?.forEach(r=>{let[n,o]=r.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(r),t[n].chains?.push(`${n}:${o}`)}),t}function LO(e,t){t=t.map(n=>n.replace("did:pkh:",""));let r=G_e(t);for(let[n,o]of Object.entries(r))o.methods?o.methods=xc(o.methods,e):o.methods=e,o.events=["chainChanged","accountsChanged"];return r}function DY(e,t){let r=ZG(e),n=ZG(t),o={},s=Object.keys(r).concat(Object.keys(n));for(let i of s)o[i]={chains:xc(r[i]?.chains,n[i]?.chains),methods:xc(r[i]?.methods,n[i]?.methods),events:xc(r[i]?.events,n[i]?.events)};return o}function Os(e,t){return Array.isArray(e)?typeof t<"u"&&e.length?e.every(t):!0:!1}function Da(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function yn(e){return typeof e>"u"}function ln(e,t){return t&&yn(e)?!0:typeof e=="string"&&!!e.trim().length}function MO(e,t){return t&&yn(e)?!0:typeof e=="number"&&!isNaN(e)}function UY(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),o=Object.keys(r),s=!0;return Ym(o,n)?(n.forEach(i=>{let{accounts:a,methods:c,events:l}=e.namespaces[i],u=iy(a),d=r[i];(!Ym(XG(i,d),u)||!Ym(d.methods,c)||!Ym(d.events,l))&&(s=!1)}),s):!1}function MA(e){return ln(e,!1)&&e.includes(":")?e.split(":").length===2:!1}function Y_e(e){if(ln(e,!1)&&e.includes(":")){let t=e.split(":");if(t.length===3){let r=t[0]+":"+t[1];return!!t[2]&&MA(r)}}return!1}function LY(e){function t(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(ln(e,!1)){if(t(e))return!0;let r=lY(e);return t(r)}}catch{}return!1}function MY(e){return e?.proposer?.publicKey}function HY(e){return e?.topic}function $Y(e,t){let r=null;return ln(e?.publicKey,!1)||(r=Ee("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}function GG(e){let t=!0;return Os(e)?e.length&&(t=e.every(r=>ln(r,!1))):t=!1,t}function J_e(e,t,r){let n=null;return Os(t)&&t.length?t.forEach(o=>{n||MA(o)||(n=cr("UNSUPPORTED_CHAINS",`${r}, chain ${o} should be a string and conform to "namespace:chainId" format`))}):MA(e)||(n=cr("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function Q_e(e,t,r){let n=null;return Object.entries(e).forEach(([o,s])=>{if(n)return;let i=J_e(o,XG(o,s),`${t} ${r}`);i&&(n=i)}),n}function X_e(e,t){let r=null;return Os(e)?e.forEach(n=>{r||Y_e(n)||(r=cr("UNSUPPORTED_ACCOUNTS",`${t}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=cr("UNSUPPORTED_ACCOUNTS",`${t}
6189, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function e7e(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;let o=X_e(n?.accounts,`${t} namespace`);o&&(r=o)}),r}function t7e(e,t){let r=null;return GG(e?.methods)?GG(e?.events)||(r=cr("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=cr("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}function FY(e,t){let r=null;return Object.values(e).forEach(n=>{if(r)return;let o=t7e(n,`${t}, namespace`);o&&(r=o)}),r}function VY(e,t,r){let n=null;if(e&&Da(e)){let o=FY(e,t);o&&(n=o);let s=Q_e(e,t,r);s&&(n=s)}else n=Ee("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}function WA(e,t){let r=null;if(e&&Da(e)){let n=FY(e,t);n&&(r=n);let o=e7e(e,t);o&&(r=o)}else r=Ee("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function HO(e){return ln(e.protocol,!0)}function zY(e,t){let r=!1;return t&&!e?r=!0:e&&Os(e)&&e.length&&e.forEach(n=>{r=HO(n)}),r}function jY(e){return typeof e=="number"}function Ko(e){return typeof e<"u"&&typeof e!==null}function qY(e){return!(!e||typeof e!="object"||!e.code||!MO(e.code,!1)||!e.message||!ln(e.message,!1))}function WY(e){return!(yn(e)||!ln(e.method,!1))}function KY(e){return!(yn(e)||yn(e.result)&&yn(e.error)||!MO(e.id,!1)||!ln(e.jsonrpc,!1))}function ZY(e){return!(yn(e)||!ln(e.name,!1))}function $O(e,t){return!(!MA(t)||!UO(e).includes(t))}function GY(e,t,r){return ln(r,!1)?K_e(e,t).includes(r):!1}function YY(e,t,r){return ln(r,!1)?Z_e(e,t).includes(r):!1}function FO(e,t,r){let n=null,o=r7e(e),s=n7e(t),i=Object.keys(o),a=Object.keys(s),c=YG(Object.keys(e)),l=YG(Object.keys(t)),u=c.filter(d=>!l.includes(d));return u.length&&(n=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
6190      Required: ${u.toString()}
6191      Received: ${Object.keys(t).toString()}`)),Ym(i,a)||(n=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
6192      Required: ${i.toString()}
6193      Approved: ${a.toString()}`)),Object.keys(t).forEach(d=>{if(!d.includes(":")||n)return;let p=iy(t[d].accounts);p.includes(d)||(n=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${d}
6194        Required: ${d}
6195        Approved: ${p.toString()}`))}
6195),i.forEach(d=>{n||(Ym(o[d].methods,s[d].methods)?Ym(o[d].events,s[d].events)||(n=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${d}`)):n=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${d}`))}),n}function r7e(e){let t={};return Object.keys(e).forEach(r=>{r.includes(":")?t[r]=e[r]:e[r].chains?.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}function YG(e){return[...new Set(e.map(t=>t.includes(":")?t.split(":")[0]:t))]}function n7e(e){let t={};return Object.keys(e).forEach(r=>{r.includes(":")?t[r]=e[r]:iy(e[r].accounts)?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(o=>o.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}),t}function JY(e,t){return MO(e,!1)&&e<=t.max&&e>=t.min}function VO(){let e=Kx();return new Promise(t=>{switch(e){case ai.browser:t(o7e());break;case ai.reactNative:t(s7e());break;case ai.node:t(i7e());break;default:t(!0)}})}function o7e(){return Qm()&&navigator?.onLine}async function s7e(){return Yd()&&typeof global<"u"&&global?.NetInfo?(await global?.NetInfo.fetch())?.isConnected:!0}function i7e(){return!0}function QY(e){switch(Kx()){case ai.browser:a7e(e);break;case ai.reactNative:c7e(e);break;case ai.node:break}}function a7e(e){!Yd()&&Qm()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function c7e(e){Yd()&&typeof global<"u"&&global?.NetInfo&&global?.NetInfo.addEventListener(t=>e(t?.isConnected))}function XY(){return Qm()&&(0,vc.getDocument)()?(0,vc.getDocument)()?.visibilityState==="visible":!0}var yO={},Wf=class{static get(t){return yO[t]}static set(t,r){yO[t]=r}static delete(t){delete yO[t]}};function l7e(e){let t=Na.decode(e);if(t.length<33)throw new Error("Too short to contain a public key");return t.slice(1,33)}function u7e({publicKey:e,signature:t,payload:r}){let n=HA(r.method),o=128|parseInt(r.version?.toString()||"4"),s=f7e(r.address),i=r.era==="00"?new Uint8Array([0]):HA(r.era);if(i.length!==1&&i.length!==2)throw new Error("Invalid era length");let a=parseInt(r.nonce,16),c=new Uint8Array([a&255,a>>8&255]),l=BigInt(`0x${p7e(r.tip)}`),u=m7e(l),d=new Uint8Array([0,...e,s,...t,...i,...c,...u,...n]),p=h7e(d.length+1);return new Uint8Array([...p,o,...d])}function d7e(e){let t=HA(e),r=(0,QG.blake2b)(t,void 0,32);return"0x"+Rt(r,"base16")}function HA(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(t=>parseInt(t,16)))}function p7e(e){return e.startsWith("0x")?e.slice(2):e}function f7e(e){let t=Na.decode(e)[0];return t===42?0:t===60?2:1}function h7e(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([t&255,t>>8&255])}else if(e<1<<30){let t=e<<2|2;return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}else throw new Error("Compact encoding > 2^30 not supported")}function m7e(e){if(e<1n<<6n)return new Uint8Array([Number(e<<2n)]);if(e<1n<<14n){let t=e<<2n|0x01n;return new Uint8Array([Number(t&0xffn),Number(t>>8n&0xffn)])}else if(e<1n<<30n){let t=e<<2n|0x02n;return new Uint8Array([Number(t&0xffn),Number(t>>8n&0xffn),Number(t>>16n&0xffn),Number(t>>24n&0xffn)])}else throw new Error("BigInt compact encoding not supported > 2^30")}function eJ(e){let t=HA(e.signature),r=l7e(e.transaction.address),n=u7e({publicKey:r,signature:t,payload:e.transaction}),o=Rt(n,"base16");return d7e(o)}var g7e=new Set(["TransferFactory_Transfer","DelegateProxy_TransferFactory_Transfer"]);function y7e(e){let t=e?.commands;if(!Array.isArray(t))return[];let r=[];for(let n of t){let o=n?.ExerciseCommand;if(!o||!g7e.has(o.choice))continue;let s=o.choiceArgument?.transfer;!s?.amount||!s?.instrumentId?.id||r.push({amount:String(s.amount),instrumentId:String(s.instrumentId.id)})}return r}function tJ(e,t){let r=t?.payload?.updateId;if(!r)return[];let n=y7e(e);return n.length===0?[String(r)]:n.map(o=>`${r}:${o.amount}:${o.instrumentId}`)}function ay({logger:e,name:t}){let r=typeof e=="string"?Sl({opts:{level:e,name:t}}).logger:e;return r.level=typeof e=="string"?e:e.level,r}var jC=Lt(Cs(),1);var ep=Lt(Cs(),1);jO();QO();jf();KA();var EJ=Lt(Cs()),YA=class extends no{constructor(t){super(),this.opts=t,this.protocol="wc",this.version=2}};var JA=class extends no{constructor(t,r){super(),this.core=t,this.logger=r,this.records=new Map}},QA=class{constructor(t,r){this.logger=t,this.core=r}},XA=class extends no{constructor(t,r){super(),this.relayer=t,this.logger=r}},eC=class extends no{constructor(t){super()}},tC=class{constructor(t,r,n,o){this.core=t,this.logger=r,this.name=n}};var rC=class extends no{constructor(t,r){super(),this.relayer=t,this.logger=r}};var nC=class extends no{constructor(t,r){super(),this.core=t,this.logger=r}};var oC=class{constructor(t,r,n){this.core=t,this.logger=r,this.store=n}},sC=class{constructor(t,r){this.projectId=t,this.logger=r}},iC=class{constructor(t,r,n){this.core=t,this.logger=r,this.telemetryEnabled=n}};var aC=class{constructor(t){this.opts=t,this.protocol="wc",this.version=2}};var cC=class{constructor(t){this.client=t}};var qe=Lt(Sd(),1);Wm();Zm();Zm();rR();Nx();uy();
vendor: 4,261 bytes, line 6195
6195Sc();iB();function JJ(e){return Number.isSafeInteger(e)&&e>=0}function QJ(e){return e!=null&&typeof e!="function"&&JJ(e.length)}function XJ(e){return e==="__proto__"}function py(e){return e==null||typeof e!="object"&&typeof e!="function"}function eQ(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function r1(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function Xd(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var vC="[object RegExp]",fy="[object String]",hy="[object Number]",my="[object Boolean]",n1="[object Arguments]",EC="[object Symbol]",AC="[object Date]",CC="[object Map]",SC="[object Set]",IC="[object Array]",tQ="[object Function]",TC="[object ArrayBuffer]",Yf="[object Object]",rQ="[object Error]",_C="[object DataView]",PC="[object Uint8Array]",NC="[object Uint8ClampedArray]",RC="[object Uint16Array]",OC="[object Uint32Array]",nQ="[object BigUint64Array]",BC="[object Int8Array]",kC="[object Int16Array]",DC="[object Int32Array]",oQ="[object BigInt64Array]",UC="[object Float32Array]",LC="[object Float64Array]";function gy(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function sQ(e,t){return yy(e,void 0,e,new Map,t)}function yy(e,t,r,n=new Map,o=void 0){let s=o?.(e,t,r,n);if(s!==void 0)return s;if(py(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){let i=new Array(e.length);n.set(e,i);for(let a=0;a<e.length;a++)i[a]=yy(e[a],a,r,n,o);return Object.hasOwn(e,"index")&&(i.index=e.index),Object.hasOwn(e,"input")&&(i.input=e.input),i}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){let i=new RegExp(e.source,e.flags);return i.lastIndex=e.lastIndex,i}if(e instanceof Map){let i=new Map;n.set(e,i);for(let[a,c]of e)i.set(a,yy(c,a,r,n,o));return i}if(e instanceof Set){let i=new Set;n.set(e,i);for(let a of e)i.add(yy(a,void 0,r,n,o));return i}if(typeof Buffer<"u"&&Buffer.isBuffer(e))return e.subarray();if(gy(e)){let i=new(Object.getPrototypeOf(e)).constructor(e.length);n.set(e,i);for(let a=0;a<e.length;a++)i[a]=yy(e[a],a,r,n,o);return i}if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);if(e instanceof DataView){let i=new DataView(e.buffer.slice(0),e.byteOffset,e.byteLength);return n.set(e,i),Ua(i,e,r,n,o),i}if(typeof File<"u"&&e instanceof File){let i=new File([e],e.name,{type:e.type});return n.set(e,i),Ua(i,e,r,n,o),i}if(typeof Blob<"u"&&e instanceof Blob){let i=new Blob([e],{type:e.type});return n.set(e,i),Ua(i,e,r,n,o),i}if(e instanceof Error){let i=structuredClone(e);return n.set(e,i),i.message=e.message,i.name=e.name,i.stack=e.stack,i.cause=e.cause,i.constructor=e.constructor,Ua(i,e,r,n,o),i}if(e instanceof Boolean){let i=new Boolean(e.valueOf());return n.set(e,i),Ua(i,e,r,n,o),i}if(e instanceof Number){let i=new Number(e.valueOf());return n.set(e,i),Ua(i,e,r,n,o),i}if(e instanceof String){let i=new String(e.valueOf());return n.set(e,i),Ua(i,e,r,n,o),i}if(typeof e=="object"&&X7e(e)){let i=Object.create(Object.getPrototypeOf(e));return n.set(e,i),Ua(i,e,r,n,o),i}return e}function Ua(e,t,r=e,n,o){let s=[...Object.keys(t),...r1(t)];for(let i=0;i<s.length;i++){let a=s[i],c=Object.getOwnPropertyDescriptor(e,a);(c==null||c.writable)&&(e[a]=yy(t[a],a,r,n,o))}}function X7e(e){switch(Xd(e)){case n1:case IC:case TC:case _C:case my:case AC:case UC:case LC:case BC:case kC:case DC:case CC:case hy:case Yf:case vC:case SC:case fy:case EC:case PC:case NC:case RC:case OC:return!0;default:return!1}}function iQ(e,t){return sQ(e,(r,n,o,s)=>{let i=t?.(r,n,o,s);if(i!==void 0)return i;if(typeof e=="object"){if(Xd(e)===Yf&&typeof e.constructor!="function"){let a={};return s.set(e,a),Ua(a,e,o,s),a}switch(Object.prototype.toString.call(e)){case hy:case fy:case my:{let a=new e.constructor(e?.valueOf());return Ua(a,e),a}case n1:{let a={};return Ua(a,e),a.length=e.length,a[Symbol.iterator]=e[Symbol.iterator],a}default:return}}})}function aB(e){return iQ(e)}function cB(e){return e!==null&&typeof e=="object"&&Xd(e)==="[object Arguments]"}function u8(e){return typeof e=="object"&&e!==null}function aQ(e){return u8(e)&&QJ(e)}function lB(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);
vendor: 4,261 bytes, line 6195
6195return t===null||t===Object.prototype||Object.getPrototypeOf(t)===null?Object.prototype.toString.call(e)==="[object Object]":!1}function cQ(e,t,r){return d8(e,t,void 0,void 0,void 0,void 0,r)}function d8(e,t,r,n,o,s,i){let a=i(e,t,r,n,o,s);if(a!==void 0)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":return e===t;case"number":return e===t||Object.is(e,t);case"function":return e===t;case"object":return p8(e,t,s,i)}return p8(e,t,s,i)}function p8(e,t,r,n){if(Object.is(e,t))return!0;let o=Xd(e),s=Xd(t);if(o===n1&&(o=Yf),s===n1&&(s=Yf),o!==s)return!1;switch(o){case fy:return e.toString()===t.toString();case hy:{let c=e.valueOf(),l=t.valueOf();return eQ(c,l)}case my:case AC:case EC:return Object.is(e.valueOf(),t.valueOf());case vC:return e.source===t.source&&e.flags===t.flags;case tQ:return e===t}r=r??new Map;let i=r.get(e),a=r.get(t);if(i!=null&&a!=null)return i===t;r.set(e,t),r.set(t,e);try{switch(o){case CC:{if(e.size!==t.size)return!1;for(let[c,l]of e.entries())if(!t.has(c)||!d8(l,t.get(c),c,e,t,r,n))return!1;return!0}case SC:{if(e.size!==t.size)return!1;let c=Array.from(e.values()),l=Array.from(t.values());for(let u=0;u<c.length;u++){let d=c[u],p=l.findIndex(f=>d8(d,f,void 0,e,t,r,n));if(p===-1)return!1;l.splice(p,1)}return!0}case IC:case PC:case NC:case RC:case OC:case nQ:case BC:case kC:case DC:case oQ:case UC:case LC:{if(typeof Buffer<"u"&&Buffer.isBuffer(e)!==Buffer.isBuffer(t)||e.length!==t.length)return!1;for(let c=0;c<e.length;c++)if(!d8(e[c],t[c],c,e,t,r,n))return!1;return!0}case TC:return e.byteLength!==t.byteLength?!1:p8(new Uint8Array(e),new Uint8Array(t),r,n);case _C:return e.byteLength!==t.byteLength||e.byteOffset!==t.byteOffset?!1:p8(new Uint8Array(e),new Uint8Array(t),r,n);case rQ:return e.name===t.name&&e.message===t.message;case Yf:{if(!(p8(e.constructor,t.constructor,r,n)||lB(e)&&lB(t)))return!1;let l=[...Object.keys(e),...r1(e)],u=[...Object.keys(t),...r1(t)];if(l.length!==u.length)return!1;for(let d=0;d<l.length;d++){let p=l[d],f=e[p];if(!Object.hasOwn(t,p))return!1;let m=t[p];if(!d8(f,m,p,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function MC(){}function uB(e,t){return cQ(e,t,MC)}function HC(e){return gy(e)}function $C(e){if(typeof e!="object"||e==null)return!1;if(Object.getPrototypeOf(e)===null)return!0;if(Object.prototype.toString.call(e)!=="[object Object]"){let r=e[Symbol.toStringTag];return r==null||!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable?!1:e.toString()===`[object ${r}]`}let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function lQ(e){if(py(e))return e;if(Array.isArray(e)||gy(e)||e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return e.slice(0);let t=Object.getPrototypeOf(e);if(t==null)return Object.assign(Object.create(t),e);let r=t.constructor;if(e instanceof Date||e instanceof Map||e instanceof Set)return new r(e);if(e instanceof RegExp){let n=new r(e);return n.lastIndex=e.lastIndex,n}if(e instanceof DataView)return new r(e.buffer.slice(0));if(e instanceof Error){let n;return e instanceof AggregateError?n=new r(e.errors,e.message,{cause:e.cause}):n=new r(e.message,{cause:e.cause}),n.stack=e.stack,Object.assign(n,e),n}if(typeof File<"u"&&e instanceof File)return new r([e],e.name,{type:e.type,lastModified:e.lastModified});if(typeof e=="object"){let n=Object.create(t);return Object.assign(n,e)}return e}function uQ(e,...t){let r=t.slice(0,-1),n=t[t.length-1],o=e;for(let s=0;s<r.length;s++){let i=r[s];o=FC(o,i,n,new Map)}return o}function FC(e,t,r,n){if(py(e)&&(e=Object(e)),t==null||typeof t!="object")return e;if(n.has(t))return lQ(n.get(t));if(n.set(t,e),Array.isArray(t)){t=t.slice();for(let s=0;s<t.length;s++)t[s]=t[s]??void 0}let o=[...Object.keys(t),...r1(t)];for(let s=0;s<o.length;s++){let i=o[s];if(XJ(i))continue;let a=t[i],c=e[i];if(cB(a)&&(a={...a}),cB(c)&&(c={...c}),typeof Buffer<"u"&&Buffer.isBuffer(a)&&(a=aB(a)),Array.isArray(a))if(Array.isArray(c)){let u=[],d=Reflect.ownKeys(c);for(let p=0;p<d.length;p++){let f=d[p];u[f]=c[f]}c=u}else if(aQ(c)){let u=[];for(let d=0;d<c.length;d++)u[d]=c[d];c=u}else c=[];let l=r(c,a,i,e,t,n);
6195l!==void 0?e[i]=l:Array.isArray(a)||u8(c)&&u8(a)&&($C(c)||$C(a)||HC(c)||HC(a))?e[i]=FC(c,a,r,n):c==null&&$C(a)?e[i]=FC({},a,r,n):c==null&&HC(a)?e[i]=aB(a):(c===void 0||a!==void 0)&&(e[i]=a)}return e}function dB(e,...t){return uQ(e,...t,MC)}var fQ=Lt(_2(),1),hQ="wc",mQ=2,zC="core",Tl=`${hQ}@2:${zC}:`,ePe={name:zC,logger:"error"},tPe={database:":memory:"},rPe="crypto",dQ="client_ed25519_seed",nPe=qe.ONE_DAY,oPe="keychain",sPe="0.3",iPe="messages",aPe="0.3",cPe=qe.SIX_HOURS,lPe="publisher",IB="irn",uPe="error",gQ="wss://relay.walletconnect.org",dPe="relayer",un={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},pPe="_subscription",La={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},fPe=.1;var pB="2.23.10";var Cr={link_mode:"link_mode",relay:"relay"},VC={inbound:"inbound",outbound:"outbound"},hPe="0.3",mPe="WALLETCONNECT_CLIENT_ID",pQ="WALLETCONNECT_LINK_MODE_APPS",Qi={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"};var gPe="subscription",yPe="0.3",lat=qe.FIVE_SECONDS*1e3,wPe="pairing",bPe="0.3";var f8={wc_pairingDelete:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:qe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:qe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:qe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:qe.ONE_DAY,prompt:!1,tag:0},res:{ttl:qe.ONE_DAY,prompt:!1,tag:0}}},Jf={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Ic={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},xPe="history",vPe="0.3",EPe="expirer",Xi={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},APe="0.3";var CPe="verify-api",SPe="https://verify.walletconnect.com",yQ="https://verify.walletconnect.org",wy=yQ,IPe=`${wy}/v3`,TPe=[SPe,yQ],_Pe="echo",PPe="https://echo.walletconnect.com";var Tc={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Il={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Ma={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success",session_request_response_started:"session_request_response_started",session_request_response_validation_success:"session_request_response_validation_success",session_request_response_publish_started:"session_request_response_publish_started"},Qf={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found",session_request_response_validation_failure:"session_request_response_validation_failure",session_request_response_publish_failure:"session_request_response_publish_failure"},Xf={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},by={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},NPe=.1,RPe="event-client",OPe=86400,BPe="https://pulse.walletconnect.org/batch",fB=class{constructor(t,r){this.core=t,this.logger=r,this.keychain=new Map,this.name=oPe,this.version=sPe,this.initialized=!1,this.storagePrefix=Tl,this.init=async()=>
vendor: 42,149 bytes, line 6195
6195{if(!this.initialized){let n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,o)=>{this.isInitialized(),this.keychain.set(n,o),await this.persist()},this.get=n=>{this.isInitialized();let o=this.keychain.get(n);if(typeof o>"u"){let{message:s}=Ee("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(s)}return o},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=t,this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(t){await this.core.storage.setItem(this.storageKey,$A(t))}async getKeyChain(){let t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?FA(t):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},hB=class{constructor(t,r,n){this.core=t,this.logger=r,this.name=rPe,this.randomSessionIdentifier=qA(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=o=>(this.isInitialized(),this.keychain.has(o)),this.getClientId=async()=>{if(this.isInitialized(),this.clientId)return this.clientId;let o=await this.getClientSeed(),s=ey(o),i=Hx(s.publicKey);return this.clientId=i,i},this.generateKeyPair=()=>{this.isInitialized();let o=EY();return this.setPrivateKey(o.publicKey,o.privateKey)},this.signJWT=async o=>{this.isInitialized();let s=await this.getClientSeed(),i=ey(s),a=this.randomSessionIdentifier;return await SA(a,o,nPe,i)},this.generateSharedKey=(o,s,i)=>{this.isInitialized();let a=this.getPrivateKey(o),c=AY(a,s);return this.setSymKey(c,i)},this.setSymKey=async(o,s)=>{this.isInitialized();let i=s||oy(o);return await this.keychain.set(i,o),i},this.deleteKeyPair=async o=>{this.isInitialized(),await this.keychain.del(o)},this.deleteSymKey=async o=>{this.isInitialized(),await this.keychain.del(o)},this.encode=async(o,s,i)=>{this.isInitialized();let a=RO(i),c=si(s);if(BO(a))return _Y(c,i?.encoding);if(OO(a)){let p=a.senderPublicKey,f=a.receiverPublicKey;o=await this.generateSharedKey(p,f)}let l=this.getSymKey(o),{type:u,senderPublicKey:d}=a;return IY({type:u,symKey:l,message:c,senderPublicKey:d,encoding:i?.encoding})},this.decode=async(o,s,i)=>{this.isInitialized();let a=RY(s,i);if(BO(a)){let c=PY(s,i?.encoding);return Rs(c)}if(OO(a)){let c=a.receiverPublicKey,l=a.senderPublicKey;o=await this.generateSharedKey(c,l)}try{let c=this.getSymKey(o),l=TY({symKey:c,encoded:s,encoding:i?.encoding});return Rs(l)}catch(c){this.logger.error(`Failed to decode message from topic: '${o}', clientId: '${await this.getClientId()}'`),this.logger.error(c)}},this.getPayloadType=(o,s=jn)=>{let i=sy({encoded:o,encoding:s});return qf(i.type)},this.getPayloadSenderPublicKey=(o,s=jn)=>{let i=sy({encoded:o,encoding:s});return i.senderPublicKey?Rt(i.senderPublicKey,Wo):void 0},this.core=t,this.logger=br(r,this.name),this.keychain=n||new fB(this.core,this.logger)}get context(){return rr(this.logger)}async setPrivateKey(t,r){return await this.keychain.set(t,r),t}getPrivateKey(t){return this.keychain.get(t)}async getClientSeed(){let t="";try{t=this.keychain.get(dQ)}catch{t=qA(),await this.keychain.set(dQ,t)}return Yt(t,"base16")}getSymKey(t){return this.keychain.get(t)}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},mB=class extends QA{constructor(t,r){super(t,r),this.logger=t,this.core=r,this.messages=new Map,this.messagesWithoutClientAck=new Map,this.name=iPe,this.version=aPe,this.initialized=!1,this.storagePrefix=Tl,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n);let o=await this.getRelayerMessagesWithoutClientAck();typeof o<"u"&&(this.messagesWithoutClientAck=o),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,o,s)=>{this.isInitialized();let i=ci(o),a=this.messages.get(n);if(typeof a>"u"&&(a={}),typeof a[i]<"u")return i;if(a[i]=o,this.messages.set(n,a),s===VC.inbound){let c=this.messagesWithoutClientAck.get(n)||{};this.messagesWithoutClientAck.set(n,{...c,[i]:o})}return await this.persist(),i},this.get=n=>{this.isInitialized();let o=this.messages.get(n);return typeof o>"u"&&(o={}),o},this.getWithoutAck=n=>{this.isInitialized();let o={};for(let s of n){let i=this.messagesWithoutClientAck.get(s)||{};o[s]=Object.values(i)}return o},this.has=(n,o)=>{this.isInitialized();let s=this.get(n),i=ci(o);return typeof s[i]<"u"},this.ack=async(n,o)=>{this.isInitialized();let s=this.messagesWithoutClientAck.get(n);if(typeof s>"u")return;let i=ci(o);delete s[i],Object.keys(s).length===0?this.messagesWithoutClientAck.delete(n):this.messagesWithoutClientAck.set(n,s),await this.persist()},this.del=async n=>{this.isInitialized(),this.messages.delete(n),this.messagesWithoutClientAck.delete(n),await this.persist()},this.logger=br(t,this.name),this.core=r}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(t){await this.core.storage.setItem(this.storageKey,$A(t))}async setRelayerMessagesWithoutClientAck(t){await this.core.storage.setItem(this.storageKeyWithoutClientAck,$A(t))}async getRelayerMessages(){let t=await this.core.storage.getItem(this.storageKey);return typeof t<"u"?FA(t):void 0}async getRelayerMessagesWithoutClientAck(){let t=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return typeof t<"u"?FA(t):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},gB=class extends XA{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,this.events=new ep.EventEmitter,this.name=lPe,this.queue=new Map,this.publishTimeout=(0,qe.toMiliseconds)(qe.ONE_MINUTE),this.initialPublishTimeout=(0,qe.toMiliseconds)(qe.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(n,o,s)=>{this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:o,opts:s}});let i=s?.ttl||cPe,a=s?.prompt||!1,c=s?.tag||0,l=s?.id||bn().toString(),u=Xm(Qx().protocol),d={id:l,method:s?.publishMethod||u.publish,params:{topic:n,message:o,ttl:i,prompt:a,tag:c,attestation:s?.attestation,...s?.tvf}},p=`Failed to publish payload, please try again. id:${l} tag:${c}`;try{yn(d.params?.prompt)&&delete d.params?.prompt,yn(d.params?.tag)&&delete d.params?.tag;let f=new Promise(async m=>{let g=({id:b})=>{d.id?.toString()===b.toString()&&(this.removeRequestFromQueue(b),this.relayer.events.removeListener(un.publish,g),m())};this.relayer.events.on(un.publish,g);let y=Ba(new Promise((b,C)=>{this.rpcPublish(d,s).then(b).catch(w=>{this.logger.warn(w,w?.message),C(w)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${l} tag:${c}`);try{await y,this.events.removeListener(un.publish,g)}catch(b){this.queue.set(l,{request:d,opts:s,attempt:1}),this.logger.warn(b,b?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:l,topic:n,message:o,opts:s}}),await Ba(f,this.publishTimeout,p)}catch(f){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(f),s?.internal?.throwOnFailedPublish)throw f}finally{this.queue.delete(l)}},this.publishCustom=async n=>{this.logger.debug("Publishing custom payload"),this.logger.trace({type:"method",method:"publishCustom",params:n});let{payload:o,opts:s={}}=n,{attestation:i,tvf:a,publishMethod:c,prompt:l,tag:u,ttl:d=qe.FIVE_MINUTES}=s,p=s.id||bn().toString(),f=Xm(Qx().protocol),m=c||f.publish,g={id:p,method:m,params:{...o,ttl:d,prompt:l,tag:u,attestation:i,...a}},y=`Failed to publish custom payload, please try again. id:${p} tag:${u}`;try{yn(g.params?.prompt)&&delete g.params?.prompt,yn(g.params?.tag)&&delete g.params?.tag;let b=new Promise(async C=>{let w=({id:S})=>{g.id?.toString()===S.toString()&&(this.removeRequestFromQueue(S),this.relayer.events.removeListener(un.publish,w),C())};this.relayer.events.on(un.publish,w);let x=Ba(new Promise((S,P)=>{this.rpcPublish(g,s).then(S).catch(D=>{this.logger.warn(D,D?.message),P(D)})}),this.initialPublishTimeout,`Failed initial custom payload publish, retrying.... method:${m} id:${p} tag:${u}`);try{await x,this.events.removeListener(un.publish,w)}catch(S){this.queue.set(p,{request:g,opts:s,attempt:1}),this.logger.warn(S,S?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:p,payload:o,opts:s}}),await Ba(b,this.publishTimeout,y)}catch(b){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(b),s?.internal?.throwOnFailedPublish)throw b}finally{this.queue.delete(p)}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.relayer=t,this.logger=br(r,this.name),this.registerEventListeners()}get context(){return rr(this.logger)}async rpcPublish(t,r){this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:t});let n=await this.relayer.request(t);return this.relayer.events.emit(un.publish,{...t,...r}),this.logger.debug("Successfully Published Payload"),n}removeRequestFromQueue(t){this.queue.delete(t)}checkQueue(){this.queue.forEach(async(t,r)=>{let n=t.attempt+1;this.queue.set(r,{...t,attempt:n}),this.logger.warn({},`Publisher: queue->publishing: ${t.request.id}, tag: ${t.request.params?.tag}, attempt: ${n}`),await this.rpcPublish(t.request,t.opts),this.logger.warn({},`Publisher: queue->published: ${t.request.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Bs.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(un.connection_stalled);return}this.checkQueue()}),this.relayer.on(un.message_ack,t=>{this.removeRequestFromQueue(t.id.toString())})}},yB=class{constructor(){this.map=new Map,this.set=(t,r)=>{let n=this.get(t);this.exists(t,r)||this.map.set(t,[...n,r])},this.get=t=>this.map.get(t)||[],this.exists=(t,r)=>this.get(t).includes(r),this.delete=(t,r)=>{if(typeof r>"u"){this.map.delete(t);return}if(!this.map.has(t))return;let n=this.get(t);if(!this.exists(t,r))return;let o=n.filter(s=>s!==r);if(!o.length){this.map.delete(t);return}this.map.set(t,o)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}},wB=class extends rC{constructor(t,r){super(t,r),this.relayer=t,this.logger=r,this.subscriptions=new Map,this.topicMap=new yB,this.events=new ep.EventEmitter,this.name=gPe,this.version=yPe,this.pending=new Map,this.cached=[],this.initialized=!1,this.storagePrefix=Tl,this.subscribeTimeout=(0,qe.toMiliseconds)(qe.ONE_MINUTE),this.initialSubscribeTimeout=(0,qe.toMiliseconds)(qe.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0},this.subscribe=async(n,o)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}});try{let s=Qx(o),i={topic:n,relay:s,transportType:o?.transportType};o?.internal?.skipSubscribe||this.pending.set(n,i);let a=await this.rpcSubscribe(n,s,o);return typeof a=="string"&&(this.onSubscribe(a,i),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:o}})),a}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(n,o)=>{this.isInitialized(),typeof o?.id<"u"?await this.unsubscribeById(n,o.id,o):await this.unsubscribeByTopic(n,o)},this.isSubscribed=n=>new Promise(o=>{o(this.topicMap.topics.includes(n))}),this.isKnownTopic=n=>new Promise(o=>{o(this.topicMap.topics.includes(n)||this.pending.has(n)||this.cached.some(s=>s.topic===n))}),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;let n=[];this.pending.forEach(o=>{n.push(o)}),await this.batchSubscribe(n)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(Bs.pulse,async()=>{await this.checkPending()}),this.events.on(Qi.created,async n=>{let o=Qi.created;this.logger.info(`Emitting ${o}`),this.logger.debug({type:"event",event:o,data:n}),await this.persist()}),this.events.on(Qi.deleted,async n=>{let o=Qi.deleted;this.logger.info(`Emitting ${o}`),this.logger.debug({type:"event",event:o,data:n}),await this.persist()})},this.relayer=t,this.logger=br(r,this.name),this.clientId=""}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(t,r){let n=!1;try{n=this.getSubscription(t).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(t,r){let n=this.topicMap.get(t);await Promise.all(n.map(async o=>await this.unsubscribeById(t,o,r)))}async unsubscribeById(t,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}});try{let o=cr("USER_DISCONNECTED",`${this.name}, ${t}`);await this.onUnsubscribe(t,r,o);let s=Qx(n);await this.restartToComplete({topic:t,id:r,relay:s}),await this.rpcUnsubscribe(t,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:t,id:r,opts:n}})}catch(o){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(o),o}}async rpcSubscribe(t,r,n){let o=await this.getSubscriptionId(t);if(n?.internal?.skipSubscribe)return o;(!n||n?.transportType===Cr.relay)&&await this.restartToComplete({topic:t,id:t,relay:r});let s={method:Xm(r.protocol).subscribe,params:{topic:t}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:s});let i=n?.internal?.throwOnFailedPublish;try{if(n?.transportType===Cr.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(s).catch(l=>this.logger.warn(l))},(0,qe.toMiliseconds)(qe.ONE_SECOND)),o;let a=new Promise(async l=>{let u=d=>{d.topic===t&&(this.events.removeListener(Qi.created,u),l(d.id))};this.events.on(Qi.created,u);try{let d=await Ba(new Promise((p,f)=>{this.relayer.request(s).catch(m=>{this.logger.warn(m,m?.message),f(m)}).then(p)}),this.initialSubscribeTimeout,`Subscribing to ${t} failed, please try again`);this.events.removeListener(Qi.created,u),l(d)}catch{}}),c=await Ba(a,this.subscribeTimeout,`Subscribing to ${t} failed, please try again`);if(!c&&i)throw new Error(`Subscribing to ${t} failed, please try again`);return c?o:null}catch(a){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(un.connection_stalled),i)throw a}return null}async rpcBatchSubscribe(t){if(!t.length)return!0;let r=t[0].relay,n={method:Xm(r.protocol).batchSubscribe,params:{topics:t.map(o=>o.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{return await Ba(new Promise((o,s)=>{this.relayer.request(n).then(o).catch(i=>{this.logger.warn(i),s(i)})}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again"),!0}catch{return this.relayer.events.emit(un.connection_stalled),!1}}async rpcBatchFetchMessages(t){if(!t.length)return;let r=t[0].relay,n={method:Xm(r.protocol).batchFetchMessages,params:{topics:t.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let o;try{o=await await Ba(new Promise((s,i)=>{this.relayer.request(n).catch(a=>{this.logger.warn(a),i(a)}).then(s)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(un.connection_stalled)}return o}rpcUnsubscribe(t,r,n){let o={method:Xm(n.protocol).unsubscribe,params:{topic:t,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:o}),this.relayer.request(o)}onSubscribe(t,r){this.setSubscription(t,{...r,id:t}),this.pending.delete(r.topic)}onBatchSubscribe(t){t.length&&t.forEach(r=>{this.setSubscription(r.id,{...r}),this.pending.delete(r.topic)})}async onUnsubscribe(t,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,t)&&this.deleteSubscription(r,n),await this.relayer.messages.del(t)}async setRelayerSubscriptions(t){await this.relayer.core.storage.setItem(this.storageKey,t)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(t,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:t,subscription:r}),this.addSubscription(t,r)}addSubscription(t,r){this.subscriptions.set(t,{...r}),this.topicMap.set(r.topic,t),this.events.emit(Qi.created,r)}getSubscription(t){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:t});let r=this.subscriptions.get(t);if(!r){let{message:n}=Ee("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}deleteSubscription(t,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:t,reason:r});let n=this.getSubscription(t);this.subscriptions.delete(t),this.topicMap.delete(n.topic,t),this.events.emit(Qi.deleted,{...n,reason:r})}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Qi.sync)}async onRestart(){if(this.cached.length){let t=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n<r;n++){let o=t.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(o)}}this.events.emit(Qi.resubscribed)}async restore(){try{let t=await this.getRelayerSubscriptions();if(typeof t>"u"||!t.length)return;if(this.subscriptions.size&&!t.every(r=>r.topic===this.subscriptions.get(r.id)?.topic)){let{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(t){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(t)}}async batchSubscribe(t){if(t.length){if(!await this.rpcBatchSubscribe(t)){this.logger.warn(`Batch subscribe failed for ${t.length} topics, adding to pending for retry`),t.forEach(r=>{this.pending.set(r.topic,r)});return}this.onBatchSubscribe(await Promise.all(t.map(async r=>({...r,id:await this.getSubscriptionId(r.topic)}))))}}async batchFetchMessages(t){if(!t.length)return;this.logger.trace(`Fetching batch messages for ${t.length} subscriptions`);let r=await this.rpcBatchFetchMessages(t);r&&r.messages&&(await uY((0,qe.toMiliseconds)(qe.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}async restartToComplete(t){!this.relayer.connected&&!this.relayer.connecting&&(this.cached.push(t),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(t){return ci(t+await this.getClientId())}},bB=class extends eC{constructor(t){super(t),this.protocol="wc",this.version=2,this.events=new ep.EventEmitter,this.name=dPe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=(0,qe.toMiliseconds)(qe.THIRTY_SECONDS+qe.FIVE_SECONDS),this.reconnectInProgress=!1,this.requestsInFlight=[],this.connectTimeout=(0,qe.toMiliseconds)(qe.ONE_SECOND*15),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,this.stalledRestartBaseInterval=(0,qe.toMiliseconds)(qe.ONE_SECOND*2),this.stalledRestartMaxInterval=(0,qe.toMiliseconds)(qe.THIRTY_SECONDS),this.request=async r=>{this.logger.debug("Publishing Request Payload");let n=r.id||bn().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:r.method,topic:r.params?.topic},"relayer.request - publishing...");let o=`${n}:${r.params?.tag||""}`;this.requestsInFlight.push(o);let s=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(i=>i!==o),s}catch(o){throw this.logger.debug(`Failed to Publish Request: ${n}`),o}},this.resetPingTimeout=()=>{Wx()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),this.provider?.connection?.socket?.terminate?.()}catch(r){this.logger.warn(r,r?.message)}},this.heartBeatTimeout))},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},"Relayer connected \u{1F6DC}"),this.startPingTimeout(),this.stalledRestartBackoff=0,this.events.emit(un.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},"Relayer disconnected \u{1F6D1}"),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.fatal(`Fatal socket error: ${r.message}`),this.events.emit(un.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportExplicitlyClosed=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1,this.transportClose().catch(n=>this.logger.warn(n))},this.registerProviderListeners=()=>{this.provider.on(La.payload,this.onPayloadHandler),this.provider.on(La.connect,this.onConnectHandler),this.provider.on(La.disconnect,this.onDisconnectHandler),this.provider.on(La.error,this.onProviderErrorHandler)},this.core=t.core,this.logger=ay({logger:t.logger??uPe,name:this.name}),this.messages=new mB(this.logger,t.core),this.subscriber=new wB(this,this.logger),this.publisher=new gB(this,this.logger),this.projectId=t.projectId,this.relayUrl=t.relayUrl||gQ,eY()?this.packageName=bO():tY()&&(this.bundleId=bO()),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.transportOpen().catch(t=>this.logger.warn(t,t?.message))}get context(){return rr(this.logger)}get connected(){return this.provider?.connection?.socket?.readyState===1}get connecting(){return this.provider?.connection?.socket?.readyState===0||this.connectPromise!==void 0}async publish(t,r,n){this.isInitialized(),await this.publisher.publish(t,r,n),await this.recordMessageEvent({topic:t,message:r,publishedAt:Date.now(),transportType:Cr.relay},VC.outbound)}async publishCustom(t){this.isInitialized(),await this.publisher.publishCustom(t)}async subscribe(t,r){this.isInitialized(),(!r?.transportType||r?.transportType==="relay")&&await this.toEstablishConnection();let n=r?.internal?.throwOnFailedPublish??!0,o=this.subscriber.topicMap.get(t)?.[0]||"",s,i=a=>{a.topic===t&&(this.subscriber.off(Qi.created,i),s())};return await Promise.all([new Promise(a=>{s=a,this.subscriber.on(Qi.created,i)}),new Promise((a,c)=>{this.subscriber.subscribe(t,{internal:{throwOnFailedPublish:n},...r}).then(l=>{o=l||o,a()}).catch(l=>{n?c(l):a()})})]),o}async unsubscribe(t,r){this.isInitialized(),await this.subscriber.unsubscribe(t,r)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Ba(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,clearTimeout(this.stalledRestartTimeout),this.stalledRestartInProgress=!1,this.stalledRestartBackoff=0,await this.resetTransport()}async transportOpen(t){if(!this.subscriber.hasAnyTopics){this.logger.info("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=this.connect(t).finally(()=>{this.connectPromise=void 0}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(t){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=t||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.resetTransport(),await this.transportOpen())}async resetTransport(){this.reconnectInProgress=!0,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,await this.transportDisconnect(),await this.subscriber.stop(),this.reconnectInProgress=!1}async confirmOnlineStateOrThrow(){if(!await VO())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(t){if(t?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let r=t.sort((n,o)=>n.publishedAt-o.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(let n of r)try{await this.onMessageEvent(n)}catch(o){this.logger.warn(o,"Error while processing batch message event: "+o?.message)}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(t,r){let{topic:n}=t;if(!r.sessionExists){let o=en(qe.FIVE_MINUTES),s={topic:n,expiry:o,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,s)}this.events.emit(un.message,t),await this.recordMessageEvent(t,VC.inbound)}async connect(t){await this.confirmOnlineStateOrThrow(),t&&t!==this.relayUrl&&(this.relayUrl=t,await this.transportDisconnect()),this.transportExplicitlyClosed=!1;let r=1;try{for(;r<6;){this.connectionAttemptInProgress=!0;try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise((n,o)=>{let s=()=>{o(new Error("Connection interrupted while trying to connect"))};this.provider.once(La.disconnect,s),Ba(this.provider.connect(),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).then(()=>n()).catch(o).finally(()=>{this.provider.off(La.disconnect,s),clearTimeout(this.reconnectTimeout)})}),await new Promise((n,o)=>{let s=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(La.disconnect,s),this.subscriber.start().then(n).catch(o).finally(()=>{this.provider.off(La.disconnect,s)})}),this.hasExperiencedNetworkDisruption=!1}catch(n){await this.subscriber.stop();let o=n;this.logger.warn({},o.message),this.hasExperiencedNetworkDisruption=!0}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,(0,qe.toMiliseconds)(r*1))),r++}}finally{this.connectionAttemptInProgress=!1,clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0,this.reconnectInProgress=!1}}startPingTimeout(){if(Wx())try{this.provider?.connection?.socket?.on("ping",()=>{this.resetPingTimeout()}),this.resetPingTimeout()}catch(t){this.logger.warn(t,t?.message)}}async createProvider(){if(this.provider.connection&&(this.unregisterProviderListeners(),this.connected))try{await Ba(this.provider.disconnect(),1e3,"Closing previous provider")}catch{}let t=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Ji(new dy(nY({sdkVersion:pB,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:t,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(t,r){let{topic:n,message:o}=t;await this.messages.set(n,o,r)}async shouldIgnoreMessageEvent(t){let{topic:r,message:n}=t;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isKnownTopic(r))return this.logger.warn(`Ignoring message for unknown topic ${r}`),!0;let o=this.messages.has(r,n);return o&&this.logger.warn(`Ignoring duplicate message: ${n}`),o}async onProviderPayload(t){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:t}),Cc(t)){if(!t.method.endsWith(pPe))return;let r=t.params,{topic:n,message:o,publishedAt:s,attestation:i}=r.data,a={topic:n,message:o,publishedAt:s,transportType:Cr.relay,attestation:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace({type:"event",event:r.id,...a}),this.events.emit(r.id,a),await this.acknowledgePayload(t),await this.onMessageEvent(a)}else Gi(t)&&this.events.emit(un.message_ack,t)}async onMessageEvent(t){await this.shouldIgnoreMessageEvent(t)||(await this.recordMessageEvent(t,VC.inbound),this.events.emit(un.message,t))}async acknowledgePayload(t){let r=oo(t.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(La.payload,this.onPayloadHandler),this.provider.off(La.connect,this.onConnectHandler),this.provider.off(La.disconnect,this.onDisconnectHandler),this.provider.off(La.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let t=await VO();QY(async r=>{t!==r&&(t=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(Bs.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&XY())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(r){this.logger.warn(r,r?.message)}}),this.events.on(un.connection_stalled,()=>{if(this.transportExplicitlyClosed||this.stalledRestartInProgress)return;this.stalledRestartInProgress=!0;let r=this.stalledRestartBackoff===0?0:Math.min(Math.pow(2,this.stalledRestartBackoff-1)*this.stalledRestartBaseInterval,this.stalledRestartMaxInterval);this.stalledRestartBackoff++,this.logger.warn(`Connection stalled, restarting transport${r?` in ${r}ms`:""}...`),this.stalledRestartTimeout=setTimeout(async()=>{try{if(this.transportExplicitlyClosed)return;await this.restartTransport()}catch(n){this.logger.error(n,n?.message)}finally{this.stalledRestartInProgress=!1}},r)})}async onProviderDisconnect(){if(clearTimeout(this.pingTimeout),this.events.emit(un.disconnect),!this.reconnectInProgress){this.reconnectInProgress=!0;try{await this.subscriber.stop()}catch(t){this.logger.warn(t,"subscriber.stop() failed during disconnect")}if(!this.subscriber.hasAnyTopics||this.transportExplicitlyClosed){this.reconnectInProgress=!1;return}this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(t=>this.logger.error(t,t?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,qe.toMiliseconds)(fPe))}}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}this.connectPromise=this.connect().finally(()=>{this.connectPromise=void 0}),await this.connectPromise}}},_l=class extends tC{constructor(t,r,n,o=Tl,s=void 0){super(t,r,n,o),this.core=t,this.logger=r,this.name=n,this.map=new Map,this.version=hPe,this.cached=[],this.initialized=!1,this.storagePrefix=Tl,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>{this.getKey&&i!==null&&!yn(i)?this.map.set(this.getKey(i),i):MY(i)?this.map.set(i.id,i):HY(i)&&this.map.set(i.topic,i)}),this.cached=[],this.initialized=!0)},this.set=async(i,a)=>{this.isInitialized(),this.map.has(i)?await this.update(i,a):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:i,value:a}),this.map.set(i,a),await this.persist())},this.get=i=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:i}),this.getData(i)),this.getAll=i=>(this.isInitialized(),i?this.values.filter(a=>Object.keys(i).every(c=>uB(a[c],i[c]))):this.values),this.update=async(i,a)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:i,update:a});let c={...this.getData(i),...a};this.map.set(i,c),await this.persist()},this.delete=async(i,a)=>{this.isInitialized(),this.map.has(i)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:i,reason:a}),this.map.delete(i),this.addToRecentlyDeleted(i),await this.persist())},this.logger=br(r,this.name),this.storagePrefix=o,this.getKey=s}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(t){this.recentlyDeleted.push(t),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(t){await this.core.storage.setItem(this.storageKey,t)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(t){let r=this.map.get(t);if(!r){if(this.recentlyDeleted.includes(t)){let{message:o}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${t}`);throw this.logger.error(o),new Error(o)}let{message:n}=Ee("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{let t=await this.getDataStore();if(typeof t>"u"||!t.length)return;if(this.map.size){let{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(t){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(t)}}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},xB=class{constructor(t,r){this.core=t,this.logger=r,this.name=wPe,this.version=bPe,this.events=new ep.default,this.initialized=!1,this.storagePrefix=Tl,this.ignoredPayloadTypes=[Ac],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();let o=qA(),s=await this.core.crypto.setSymKey(o),i=en(qe.FIVE_MINUTES),a={protocol:IB},c={topic:s,expiry:i,relay:a,active:!1,methods:n?.methods},l=DO({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:o,relay:a,expiryTimestamp:i,methods:n?.methods});return this.events.emit(Jf.create,c),this.core.expirer.set(s,i),await this.pairings.set(s,c),await this.core.relayer.subscribe(s,{transportType:n?.transportType,internal:n?.internal}),{topic:s,uri:l}},this.pair=async n=>{this.isInitialized();let o=this.core.eventClient.createEvent({properties:{topic:n?.uri,trace:[Tc.pairing_started]}});this.isValidPair(n,o);let{topic:s,symKey:i,relay:a,expiryTimestamp:c,methods:l}=kO(n.uri);o.props.properties.topic=s,o.addTrace(Tc.pairing_uri_validation_success),o.addTrace(Tc.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(s)){if(u=this.pairings.get(s),o.addTrace(Tc.existing_pairing),u.active)throw o.setError(Il.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);o.addTrace(Tc.pairing_not_expired)}let d=c||en(qe.FIVE_MINUTES),p={topic:s,relay:a,expiry:d,active:!1,methods:l};this.core.expirer.set(s,d),await this.pairings.set(s,p),o.addTrace(Tc.store_new_pairing),n.activatePairing&&await this.activate({topic:s}),this.events.emit(Jf.create,p),o.addTrace(Tc.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(i,s),o.addTrace(Tc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{o.setError(Il.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:a})}catch(f){throw o.setError(Il.subscribe_pairing_topic_failure),f}return o.addTrace(Tc.subscribe_pairing_topic_success),p},this.activate=async({topic:n})=>{this.isInitialized();let o=en(qe.FIVE_MINUTES);this.core.expirer.set(n,o),await this.pairings.update(n,{active:!0,expiry:o})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:o}=n;if(this.pairings.keys.includes(o)){let s=await this.sendRequest(o,"wc_pairingPing",{}),{done:i,resolve:a,reject:c}=Jd();this.events.once(nr("pairing_ping",s),({error:l})=>{l?c(l):a()}),await i()}},this.updateExpiry=async({topic:n,expiry:o})=>{this.isInitialized(),await this.pairings.update(n,{expiry:o})},this.updateMetadata=async({topic:n,metadata:o})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:o})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);let{topic:o}=n;this.pairings.keys.includes(o)&&(await this.sendRequest(o,"wc_pairingDelete",cr("USER_DISCONNECTED")),await this.deletePairing(o))},this.formatUriFromPairing=n=>{this.isInitialized();let{topic:o,relay:s,expiry:i,methods:a}=n,c=this.core.crypto.keychain.get(o);return DO({protocol:this.core.protocol,version:this.core.version,topic:o,symKey:c,relay:s,expiryTimestamp:i,methods:a})},this.sendRequest=async(n,o,s)=>{let i=lr(o,s),a=await this.core.crypto.encode(n,i),c=f8[o].req;return this.core.history.set(n,i),this.core.relayer.publish(n,a,c),i.id},this.sendResult=async(n,o,s)=>{let i=oo(n,s),a=await this.core.crypto.encode(o,i),c=(await this.core.history.get(o,n)).request.method,l=f8[c].res;await this.core.relayer.publish(o,a,l),await this.core.history.resolve(i)},this.sendError=async(n,o,s)=>{let i=Zi(n,s),a=await this.core.crypto.encode(o,i),c=(await this.core.history.get(o,n)).request.method,l=f8[c]?f8[c].res:f8.unregistered_method.res;await this.core.relayer.publish(o,a,l),await this.core.history.resolve(i)},this.deletePairing=async(n,o)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,cr("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),o?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{let n=this.pairings.getAll().filter(o=>Ki(o.expiry));await Promise.all(n.map(o=>this.deletePairing(o.topic)))},this.onRelayEventRequest=async n=>{let{topic:o,payload:s}=n;switch(s.method){case"wc_pairingPing":return await this.onPairingPingRequest(o,s);case"wc_pairingDelete":return await this.onPairingDeleteRequest(o,s);default:return await this.onUnknownRpcMethodRequest(o,s)}},this.onRelayEventResponse=async n=>{let{topic:o,payload:s}=n,i=(await this.core.history.get(o,s.id)).request.method;return i==="wc_pairingPing"?this.onPairingPingResponse(o,s):this.onUnknownRpcMethodResponse(i)},this.onPairingPingRequest=async(n,o)=>{let{id:s}=o;try{this.isValidPing({topic:n}),await this.sendResult(s,n,!0),this.events.emit(Jf.ping,{id:s,topic:n})}catch(i){await this.sendError(s,n,i),this.logger.error(i)}},this.onPairingPingResponse=(n,o)=>{let{id:s}=o;setTimeout(()=>{Vr(o)?this.events.emit(nr("pairing_ping",s),{}):xr(o)&&this.events.emit(nr("pairing_ping",s),{error:o.error})},500)},this.onPairingDeleteRequest=async(n,o)=>{let{id:s}=o;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(Jf.delete,{id:s,topic:n})}catch(i){await this.sendError(s,n,i),this.logger.error(i)}},this.onUnknownRpcMethodRequest=async(n,o)=>{let{id:s,method:i}=o;try{if(this.registeredMethods.includes(i))return;let a=cr("WC_METHOD_UNSUPPORTED",i);await this.sendError(s,n,a),this.logger.error(a)}catch(a){await this.sendError(s,n,a),this.logger.error(a)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(cr("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,o)=>
6195{if(!Ko(n)){let{message:i}=Ee("MISSING_OR_INVALID",`pair() params: ${n}`);throw o.setError(Il.malformed_pairing_uri),new Error(i)}if(!LY(n.uri)){let{message:i}=Ee("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw o.setError(Il.malformed_pairing_uri),new Error(i)}let s=kO(n?.uri);if(!s?.relay?.protocol){let{message:i}=Ee("MISSING_OR_INVALID","pair() uri#relay-protocol");throw o.setError(Il.malformed_pairing_uri),new Error(i)}if(!s?.symKey){let{message:i}=Ee("MISSING_OR_INVALID","pair() uri#symKey");throw o.setError(Il.malformed_pairing_uri),new Error(i)}if(s?.expiryTimestamp&&(0,qe.toMiliseconds)(s?.expiryTimestamp)<Date.now()){o.setError(Il.pairing_expired);let{message:i}=Ee("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(i)}},this.isValidPing=async n=>{if(!Ko(n)){let{message:s}=Ee("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(s)}let{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidDisconnect=async n=>{if(!Ko(n)){let{message:s}=Ee("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(s)}let{topic:o}=n;await this.isValidPairingTopic(o)},this.isValidPairingTopic=async n=>{if(!ln(n,!1)){let{message:o}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(o)}if(!this.pairings.keys.includes(n)){let{message:o}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(o)}if(Ki(this.pairings.get(n).expiry)){await this.deletePairing(n);let{message:o}=Ee("EXPIRED",`pairing topic: ${n}`);throw new Error(o)}},this.core=t,this.logger=br(r,this.name),this.pairings=new _l(this.core,this.logger,this.name,this.storagePrefix)}get context(){return rr(this.logger)}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}registerRelayerEvents(){this.core.relayer.on(un.message,async t=>{let{topic:r,message:n,transportType:o}=t;if(this.pairings.keys.includes(r)&&o!==Cr.link_mode){try{if(this.core.crypto.getPayloadType(n,ka)===Qd){this.logger.warn(`registerRelayerEvents() -> non-link mode TYPE_2 payload ignored: ${n}`);return}}catch{}if(!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))try{let s=await this.core.crypto.decode(r,n);Cc(s)?(this.core.history.set(r,s),await this.onRelayEventRequest({topic:r,payload:s})):Gi(s)&&(await this.core.history.resolve(s),await this.onRelayEventResponse({topic:r,payload:s}),this.core.history.delete(r,s.id)),await this.core.relayer.messages.ack(r,n)}catch(s){this.logger.error(s)}}})}registerExpirerEvents(){this.core.expirer.on(Xi.expired,async t=>{let{topic:r}=VA(t.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(Jf.expire,{topic:r}))})}},vB=class extends JA{constructor(t,r){super(t,r),this.core=t,this.logger=r,this.records=new Map,this.events=new ep.EventEmitter,this.name=xPe,this.version=vPe,this.cached=[],this.initialized=!1,this.storagePrefix=Tl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,o,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:o,chainId:s}),this.records.has(o.id))return;let i={id:o.id,topic:n,request:{method:o.method,params:o.params||null},chainId:s,expiry:en(qe.THIRTY_DAYS)};this.records.set(i.id,i),this.persist(),this.events.emit(Ic.created,i)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;let o=await this.getRecord(n.id);typeof o.response<"u"||(o.response=xr(n)?{error:n.error}:{result:n.result},this.records.set(o.id,o),this.persist(),this.events.emit(Ic.updated,o))},this.get=async(n,o)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:o}),await this.getRecord(o)),this.delete=(n,o)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:o}
vendor: 4,571 bytes, line 6195
6195),this.values.forEach(s=>{if(s.topic===n){if(typeof o<"u"&&s.id!==o)return;this.records.delete(s.id),this.events.emit(Ic.deleted,s)}}),this.persist()},this.exists=async(n,o)=>(this.isInitialized(),this.records.has(o)?(await this.getRecord(o)).topic===n:!1),this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let t=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;let n={topic:r.topic,request:lr(r.request.method,r.request.params,r.id),chainId:r.chainId};return t.push(n)}),t}async setJsonRpcRecords(t){await this.core.storage.setItem(this.storageKey,t)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(t){this.isInitialized();let r=this.records.get(t);if(!r){let{message:n}=Ee("NO_MATCHING_KEY",`${this.name}: ${t}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Ic.sync)}async restore(){try{let t=await this.getJsonRpcRecords();if(typeof t>"u"||!t.length)return;if(this.records.size){let{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(t){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(t)}}registerEventListeners(){this.events.on(Ic.created,t=>{let r=Ic.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(Ic.updated,t=>{let r=Ic.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.events.on(Ic.deleted,t=>{let r=Ic.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:t})}),this.core.heartbeat.on(Bs.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let t=!1;this.records.forEach(r=>{(0,qe.toMiliseconds)(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Ic.deleted,r,!1),t=!0)}),t&&this.persist()}catch(t){this.logger.warn(t)}}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},EB=class extends nC{constructor(t,r){super(t,r),this.core=t,this.logger=r,this.expirations=new Map,this.events=new ep.EventEmitter,this.name=EPe,this.version=APe,this.cached=[],this.initialized=!1,this.storagePrefix=Tl,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{let o=this.formatTarget(n);return typeof this.getExpiration(o)<"u"}catch{return!1}},this.set=(n,o)=>{this.isInitialized();let s=this.formatTarget(n),i={target:s,expiry:o};this.expirations.set(s,i),this.checkExpiry(s,i),this.events.emit(Xi.created,{target:s,expiration:i})},this.get=n=>{this.isInitialized();let o=this.formatTarget(n);return this.getExpiration(o)},this.del=n=>{if(this.isInitialized(),this.has(n)){let o=this.formatTarget(n),s=this.getExpiration(o);this.expirations.delete(o),this.events.emit(Xi.deleted,{target:o,expiration:s})}},this.on=(n,o)=>{this.events.on(n,o)},this.once=(n,o)=>{this.events.once(n,o)},this.off=(n,o)=>{this.events.off(n,o)},this.removeListener=(n,o)=>{this.events.removeListener(n,o)},this.logger=br(r,this.name)}get context(){return rr(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(t){if(typeof t=="string")return sY(t);if(typeof t=="number")return iY(t);let{message:r}=Ee("UNKNOWN_TYPE",`Target type: ${typeof t}`);throw new Error(r)}async setExpirations(t){await this.core.storage.setItem(this.storageKey,t)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Xi.sync)}
6195async restore(){try{let t=await this.getExpirations();if(typeof t>"u"||!t.length)return;if(this.expirations.size){let{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=t,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(t){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(t)}}getExpiration(t){let r=this.expirations.get(t);if(!r){let{message:n}=Ee("NO_MATCHING_KEY",`${this.name}: ${t}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(t,r){let{expiry:n}=r;(0,qe.toMiliseconds)(n)-Date.now()<=0&&this.expire(t,r)}expire(t,r){this.expirations.delete(t),this.events.emit(Xi.expired,{target:t,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((t,r)=>this.checkExpiry(r,t))}registerEventListeners(){this.core.heartbeat.on(Bs.pulse,()=>this.checkExpirations()),this.events.on(Xi.created,t=>{let r=Xi.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on(Xi.expired,t=>{let r=Xi.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()}),this.events.on(Xi.deleted,t=>{let r=Xi.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:t}),this.persist()})}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}},AB=class extends oC{constructor(t,r,n){super(t,r,n),this.core=t,this.logger=r,this.store=n,this.name=CPe,this.verifyUrlV3=IPe,this.storagePrefix=Tl,this.version=mQ,this.init=async()=>{this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,qe.toMiliseconds)(this.publicKey?.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async o=>{if(!Qm()||this.isDevEnv)return;let s=window.location.origin,{id:i,decryptedId:a}=o,c=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${i}&decryptedId=${a}`;try{let l=(0,fQ.getDocument)(),u=this.startAbortTimer(qe.ONE_SECOND*5),d=await new Promise((p,f)=>{let m=()=>{window.removeEventListener("message",y),l.body.removeChild(g),f("attestation aborted")};this.abortController.signal.addEventListener("abort",m);let g=l.createElement("iframe");g.src=c,g.style.display="none",g.addEventListener("error",m,{signal:this.abortController.signal});let y=b=>{if(b.data&&typeof b.data=="string")try{let C=JSON.parse(b.data);if(C.type==="verify_attestation"){if(Al(C.attestation).payload.id!==i)return;clearInterval(u),l.body.removeChild(g),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",y),p(C.attestation===null?"":C.attestation)}}catch(C){this.logger.warn(C)}};l.body.appendChild(g),window.addEventListener("message",y,{signal:this.abortController.signal})});return this.logger.debug(d,"jwt attestation"),d}catch(l){this.logger.warn(l)}return""},this.resolve=async o=>{if(this.isDevEnv)return"";let{attestationId:s,hash:i,encryptedId:a}=o;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(Al(s).payload.id!==a)return;let l=await this.isValidJwtAttestation(s);if(l){if(!l.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return l}}if(!i)return;let c=this.getVerifyUrl(o?.verifyUrl);return this.fetchAttestation(i,c)},this.fetchAttestation=async(o,s)=>{this.logger.debug(`resolving attestation: ${o} from url: ${s}`);let i=this.startAbortTimer(qe.ONE_SECOND*5),a=await fetch(`${s}/attestation/${o}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(i),a.status===200?await a.json():void 0},this.getVerifyUrl=o=>{let s=o||wy;return TPe.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${wy}`),s=wy),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let o=this.startAbortTimer(qe.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(o),await s.json()}catch(o){this.logger.warn(o)}},this.persistPublicKey=async o=>{this.logger.debug(o,"persisting public key to local storage"),await this.store.setItem(this.storeKey,o),this.publicKey=o},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async o=>{let s=await this.getPublicKey();try{if(s)return this.validateAttestation(o,s)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}let i=await this.fetchAndPersistPublicKey();try{if(i)return this.validateAttestation(o,i)}catch(a){this.logger.error(a),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>
vendor: 7,217 bytes, line 6195
6195{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{let i=await this.fetchPublicKey();i&&(await this.persistPublicKey(i),s(i))});let o=await this.fetchPromise;return this.fetchPromise=void 0,o},this.validateAttestation=(o,s)=>{let i=OY(o,s.publicKey),a={hasExpired:(0,qe.toMiliseconds)(i.exp)<Date.now(),payload:i};if(a.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:a.payload.origin,isScam:a.payload.isScam,isVerified:a.payload.isVerified}},this.logger=br(r,this.name),this.abortController=new AbortController,this.isDevEnv=Zx(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return rr(this.logger)}startAbortTimer(t){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,qe.toMiliseconds)(t))}},CB=class extends sC{constructor(t,r){super(t,r),this.projectId=t,this.logger=r,this.context=_Pe,this.registerDeviceToken=async n=>{let{clientId:o,token:s,notificationType:i,enableEncrypted:a=!1}=n,c=`${PPe}/${this.projectId}/clients`;await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:o,type:i,token:s,always_raw:a})})},this.logger=br(r,this.context)}},SB=class extends iC{constructor(t,r,n=!0){super(t,r,n),this.core=t,this.logger=r,this.context=RPe,this.storagePrefix=Tl,this.storageVersion=NPe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!Zx())try{let o={eventId:AO(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:vO(this.core.relayer.protocol,this.core.relayer.version,pB)}}};await this.sendEvent([o])}catch(o){this.logger.warn(o)}},this.createEvent=o=>{let{event:s="ERROR",type:i="",properties:{topic:a,trace:c}}=o,l=AO(),u=this.core.projectId||"",d=Date.now(),p={eventId:l,timestamp:d,props:{event:s,type:i,properties:{topic:a,trace:c}},bundleId:u,domain:this.getAppDomain(),...this.setMethods(l)};return this.telemetryEnabled&&(this.events.set(l,p),this.shouldPersist=!0),p},this.getEvent=o=>{let{eventId:s,topic:i}=o;if(s)return this.events.get(s);let a=Array.from(this.events.values()).find(c=>c.props.properties.topic===i);if(a)return{...a,...this.setMethods(a.eventId)}},this.deleteEvent=o=>{let{eventId:s}=o;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Bs.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(o=>{(0,qe.fromMiliseconds)(Date.now())-(0,qe.fromMiliseconds)(o.timestamp)>OPe&&(this.events.delete(o.eventId),this.shouldPersist=!0)})})},this.setMethods=o=>({addTrace:s=>this.addTrace(o,s),setError:s=>this.setError(o,s)}),this.addTrace=(o,s)=>{let i=this.events.get(o);i&&(i.props.properties.trace.push(s),this.events.set(o,i),this.shouldPersist=!0)},this.setError=(o,s)=>{let i=this.events.get(o);i&&(i.props.type=s,i.timestamp=Date.now(),this.events.set(o,i),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{let o=await this.core.storage.getItem(this.storageKey)||[];if(!o.length)return;o.forEach(s=>{this.events.set(s.eventId,{...s,...this.setMethods(s.eventId)})})}catch(o){this.logger.warn(o)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;let o=[];for(let[s,i]of this.events)i.props.type&&o.push(i);if(o.length!==0)try{if((await this.sendEvent(o)).ok)for(let s of o)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.sendEvent=async o=>{let s=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${BPe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${pB}${s}`,{method:"POST",body:JSON.stringify(o)})},this.getAppDomain=()=>xO().url,this.logger=br(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}},kPe=class wQ extends YA{constructor(t){super(t),this.protocol=hQ,this.version=mQ,this.name=zC,this.events=new ep.EventEmitter,this.initialized=!1,this.on=(i,a)=>this.events.on(i,a),this.once=(i,a)=>this.events.once(i,a),this.off=(i,a)=>this.events.off(i,a),this.removeListener=(i,a)=>this.events.removeListener(i,a),this.dispatchEnvelope=({topic:i,message:a,sessionExists:c})=>{if(!i||!a)return;let l={topic:i,message:a,publishedAt:Date.now(),transportType:Cr.link_mode};this.relayer.onLinkMessageEvent(l,{sessionExists:c})};let r=this.getGlobalCore(t?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(i){console.warn("Failed to copy global core",i)}this.projectId=t?.projectId,this.relayUrl=t?.relayUrl||gQ,this.customStoragePrefix=t?.customStoragePrefix?`:${t.customStoragePrefix}`:"";let n=ry({level:typeof t?.logger=="string"&&t.logger?t.logger:ePe.logger,name:zC}),{logger:o,chunkLoggerController:s}=Sl({opts:n,maxSizeInBytes:t?.maxLogBlobSizeInBytes,loggerOverride:t?.logger});this.logChunkController=s,this.logChunkController?.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{this.logChunkController?.downloadLogsBlobInBrowser&&this.logChunkController?.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()})}),this.logger=br(o,this.name),this.heartbeat=new cy,this.crypto=new hB(this,this.logger,t?.keychain),this.history=new vB(this,this.logger),this.expirer=new EB(this,this.logger),this.storage=t?.storage?t.storage:new ly({...tPe,...t?.storageOptions}),this.relayer=new bB({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new xB(this,this.logger),this.verify=new AB(this,this.logger,this.storage),this.echoClient=new CB(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new SB(this,this.logger,t?.telemetryEnabled),this.setGlobalCore(this)}static async init(t){let r=new wQ(t);await r.initialize();let n=await r.crypto.getClientId();return await r.storage.setItem(mPe,n),r}get context(){return rr(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){return this.logChunkController?.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(t){this.linkModeSupportedApps.includes(t)||(this.linkModeSupportedApps.push(t),await this.storage.setItem(pQ,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
6195),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(pQ)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(t){throw this.logger.warn(t,`Core Initialization Failure at epoch ${Date.now()}`),this.logger.error(t.message),t}}getGlobalCore(t=""){try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${t}`,n=`${r}_count`;return globalThis[n]=(globalThis[n]||0)+1,globalThis[n]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[n]} times.`),globalThis[r]}catch(r){console.warn("Failed to get global WalletConnect core",r);return}}setGlobalCore(t){try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${t.opts?.customStoragePrefix||""}`;globalThis[r]=t}catch(r){console.warn("Failed to set global WalletConnect core",r)}}isGlobalCoreDisabled(){try{return typeof process<"u"&&process.env.DISABLE_GLOBAL_CORE==="true"}catch{return!0}}},bQ=kPe;jf();var At=Lt(Sd(),1);Sc();var EQ="wc",AQ=2,CQ="client",LB=`${EQ}@${AQ}:${CQ}:`,TB={name:CQ,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"};var xQ="WALLETCONNECT_DEEPLINK_CHOICE";var DPe="proposal";var vQ="Proposal expired",UPe="session",xy=At.SEVEN_DAYS,LPe="engine",So={wc_sessionPropose:{req:{ttl:At.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:At.ONE_DAY,prompt:!1,tag:1104},res:{ttl:At.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:At.ONE_DAY,prompt:!1,tag:1106},res:{ttl:At.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:At.FIVE_MINUTES*3,prompt:!0,tag:1108},res:{ttl:At.FIVE_MINUTES*3,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:At.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:At.ONE_DAY,prompt:!1,tag:1112},res:{ttl:At.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:At.ONE_DAY,prompt:!1,tag:1114},res:{ttl:At.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:At.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:At.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:At.FIVE_MINUTES,prompt:!1,tag:1119}}},_B={min:At.FIVE_MINUTES,max:At.SEVEN_DAYS},Pl={idle:"IDLE",active:"ACTIVE"},MPe={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""},canton_prepareSignExecute:{key:""}},HPe="request",$Pe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],FPe="wc";var VPe="auth",zPe="authKeys",jPe="pairingTopics",qPe="requests",qC=`${FPe}@${1.5}:${VPe}:`,eh=`${qC}:PUB_KEY`,PB=class extends cC{constructor(t){super(t),this.name=LPe,this.events=new jC.default,this.initialized=!1,this.requestQueue={state:Pl.idle,queue:[]},this.sessionRequestQueue={state:Pl.idle,queue:[]},this.emittedSessionRequests=new UA({limit:500}),this.requestQueueDelay=At.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.pendingSessions=new Map,this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.registerSubscriptionCleanup(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(So)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,At.toMiliseconds)(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let n={...r,requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}};await this.isValidConnect(n),n.optionalNamespaces=DY(n.requiredNamespaces,n.optionalNamespaces),n.requiredNamespaces={};let{pairingTopic:o,requiredNamespaces:s,optionalNamespaces:i,sessionProperties:a,scopedProperties:c,relays:l,authentication:u,walletPay:d}=n,p=u?.[0]?.ttl||So.wc_sessionPropose.req.ttl||At.FIVE_MINUTES;this.validateRequestExpiry(p);let f=o,m,g=!1;try{if(f){let U=this.client.core.pairing.pairings.get(f);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),g=U.active}}catch(U){throw this.client.logger.error(`connect() -> pairing.get(${f}) failed`),U}if(!f||!g){let{topic:U,uri:N}=await this.client.core.pairing.create({internal:{skipSubscribe:!0}});f=U,m=N}if(!f){let{message:U}=Ee("NO_MATCHING_KEY",`connect() pairing topic: ${f}`);throw new Error(U)}let y=await this.client.core.crypto.generateKeyPair(),b=en(p),C={requiredNamespaces:s,optionalNamespaces:i,relays:l??[{protocol:IB}],proposer:{publicKey:y,metadata:this.client.metadata},expiryTimestamp:b,pairingTopic:f,...a&&{sessionProperties:a},...c&&{scopedProperties:c},id:wn(),...(u||d)&&{requests:{authentication:u?.map(U=>{let{domain:N,chains:L,nonce:I,uri:R,exp:A,nbf:T,type:v,statement:E,requestId:O,resources:B,signatureTypes:_}=U;return{domain:N,chains:L,nonce:I,type:v??"caip122",aud:R,version:"1",iat:new Date().toISOString(),exp:A,nbf:T,statement:E,requestId:O,resources:B,signatureTypes:_}}),walletPay:d}}},w=nr("session_connect",C.id),{reject:x,resolve:S,done:P}=Jd(p,vQ),D=({id:U})=>{if(U===C.id){this.client.events.off("proposal_expire",D);
vendor: 26,062 bytes, line 6195
6195let N=this.pendingSessions.get(C.id);if(N){let{sessionTopic:L,publicKey:I}=N;Promise.all([this.client.core.relayer.unsubscribe(L),this.client.core.crypto.keychain.has(L)?this.client.core.crypto.deleteSymKey(L):Promise.resolve(),this.client.core.crypto.keychain.has(I)?this.client.core.crypto.deleteKeyPair(I):Promise.resolve()]).catch(R=>this.client.logger.warn(R))}this.pendingSessions.delete(C.id),this.events.emit(w,{error:{message:vQ,code:0}})}};return this.client.events.on("proposal_expire",D),this.events.once(w,({error:U,session:N})=>{this.client.events.off("proposal_expire",D),U?x(U):N&&S(N)}),await this.setProposal(C.id,C),await this.sendProposeSession({proposal:C,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:C.id}}}).catch(U=>{throw this.deleteProposal(C.id),U}),{uri:m,approval:P}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{let n=this.client.core.eventClient.createEvent({properties:{topic:r?.id?.toString(),trace:[Ma.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(D){throw n.setError(Qf.no_internet_connection),D}try{await this.isValidProposalId(r?.id)}catch(D){throw this.client.logger.error(`approve() -> proposal.get(${r?.id}) failed`),n.setError(Qf.proposal_not_found),D}try{await this.isValidApprove(r)}catch(D){throw this.client.logger.error("approve() -> isValidApprove() failed"),n.setError(Qf.session_approve_namespace_validation_failure),D}let{id:o,relayProtocol:s,namespaces:i,sessionProperties:a,scopedProperties:c,sessionConfig:l,proposalRequestsResponses:u}=r,d=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:n.eventId});let{pairingTopic:p,proposer:f,requiredNamespaces:m,optionalNamespaces:g}=d,y=this.client.core.eventClient?.getEvent({topic:p});y||(y=this.client.core.eventClient?.createEvent({type:Ma.session_approve_started,properties:{topic:p,trace:[Ma.session_approve_started,Ma.session_namespaces_validation_success]}}));let b=await this.client.core.crypto.generateKeyPair(),C=f.publicKey,w=await this.client.core.crypto.generateSharedKey(b,C),x={relay:{protocol:s??"irn"},namespaces:i,controller:{publicKey:b,metadata:this.client.metadata},expiry:en(xy),...a&&{sessionProperties:a},...c&&{scopedProperties:c},...l&&{sessionConfig:l},proposalRequestsResponses:u},S=Cr.relay;y.addTrace(Ma.subscribing_session_topic);try{await this.client.core.relayer.subscribe(w,{transportType:S,internal:{skipSubscribe:!0}})}catch(D){throw y.setError(Qf.subscribe_session_topic_failure),D}y.addTrace(Ma.subscribe_session_topic_success);let P={...x,topic:w,requiredNamespaces:m,optionalNamespaces:g,pairingTopic:p,acknowledged:!1,self:x.controller,peer:{publicKey:f.publicKey,metadata:f.metadata},controller:b,transportType:Cr.relay,authentication:u?.authentication,walletPayResult:u?.walletPay};await this.client.session.set(w,P),y.addTrace(Ma.store_session);try{await this.sendApproveSession({sessionTopic:w,proposal:d,pairingProposalResponse:{relay:{protocol:s??"irn"},responderPublicKey:b},sessionSettleRequest:x,publishOpts:{internal:{throwOnFailedPublish:!0},tvf:{correlationId:o,...this.getTVFApproveParams(P)}}}),y.addTrace(Ma.session_approve_publish_success)}catch(D){throw this.client.logger.error(D),this.client.session.delete(w,cr("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(w),D}return this.client.core.eventClient.deleteEvent({eventId:y.eventId}),await this.client.core.pairing.updateMetadata({topic:p,metadata:f.metadata}),await this.deleteProposal(o),await this.client.core.pairing.activate({topic:p}),await this.setExpiry(w,en(xy)),{topic:w,acknowledged:()=>Promise.resolve(this.client.session.get(w))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(i){throw this.client.logger.error("reject() -> isValidReject() failed"),i}let{id:n,reason:o}=r,s;try{s=this.client.proposal.get(n).pairingTopic}catch(i){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),i}s&&await this.sendError({id:n,topic:s,error:o,rpcOpts:So.wc_sessionPropose.reject}),await this.deleteProposal(n)},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(p){throw this.client.logger.error("update() -> isValidUpdate() failed"),p}let{topic:n,namespaces:o}=r,s=this.client.session.get(n);if(s.self.publicKey!==s.controller){let{message:p}=cr("UNAUTHORIZED_UPDATE_REQUEST");throw new Error(p)}let{done:i,resolve:a,reject:c}=Jd(At.FIVE_MINUTES,"Session update request expired without receiving any acknowledgement"),l=wn(),u=bn().toString(),d=this.client.session.get(n).namespaces;return this.events.once(nr("session_update",l),({error:p})=>{p?c(p):a()}),await this.client.session.update(n,{namespaces:o}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:o},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:u}).catch(p=>{this.client.logger.error(p),this.client.session.update(n,{namespaces:d}),c(p)}),{acknowledged:i}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(c){throw this.client.logger.error("extend() -> isValidExtend() failed"),c}let{topic:n}=r,o=wn(),{done:s,resolve:i,reject:a}=Jd(At.FIVE_MINUTES,"Session extend request expired without receiving any acknowledgement");return this.events.once(nr("session_extend",o),({error:c})=>{c?a(c):i()}),await this.setExpiry(n,en(xy)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:o,throwOnFailedPublish:!0}).catch(c=>{a(c)}),{acknowledged:s}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(y){throw this.client.logger.error("request() -> isValidRequest() failed"),y}let{chainId:n,request:o,topic:s,expiry:i=So.wc_sessionRequest.req.ttl}=r,a=this.client.session.get(s);a?.transportType===Cr.relay&&await this.confirmOnlineStateOrThrow();let c=wn(),l=bn().toString(),{done:u,resolve:d,reject:p}=Jd(i,"Request expired. Please try again.");this.events.once(nr("session_request",c),({error:y,result:b})=>{y?p(y):d(b)});let f="wc_sessionRequest",m=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);if(m)return await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:{request:{...o,expiryTimestamp:en(i)},chainId:n},expiry:i,throwOnFailedPublish:!0,appLink:m}).catch(y=>p(y)),this.client.events.emit("session_request_sent",{topic:s,request:o,chainId:n,id:c}),await u();let g={request:{...o,expiryTimestamp:en(i)},chainId:n};return await Promise.all([new Promise(async y=>{await this.sendRequest({clientRpcId:c,relayRpcId:l,topic:s,method:f,params:g,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(c,g)}).catch(b=>p(b)),this.client.events.emit("session_request_sent",{topic:s,request:o,chainId:n,id:c}),y()}),new Promise(async y=>{if(!a.sessionConfig?.disableDeepLink){let b=await cY(this.client.core.storage,xQ);await aY({id:c,topic:s,wcDeepLink:b})}y()}),u()]).then(y=>y[2])},this.respond=async r=>{this.isInitialized();let n=this.client.core.eventClient.createEvent({properties:{topic:r?.topic||r?.response?.id?.toString(),trace:[Ma.session_request_response_started]}});try{await this.isValidRespond(r)}catch(l){throw n.addTrace(l?.message),n.setError(Qf.session_request_response_validation_failure),l}n.addTrace(Ma.session_request_response_validation_success);let{topic:o,response:s}=r,{id:i}=s,a=this.client.session.get(o);a.transportType===Cr.relay&&await this.confirmOnlineStateOrThrow();let c=this.getAppLinkIfEnabled(a.peer.metadata,a.transportType);try{n.addTrace(Ma.session_request_response_publish_started),Vr(s)?await this.sendResult({id:i,topic:o,result:s.result,throwOnFailedPublish:!0,appLink:c}):xr(s)&&await this.sendError({id:i,topic:o,error:s.error,appLink:c}),this.cleanupAfterResponse(r)}catch(l){throw n.addTrace(l?.message),n.setError(Qf.session_request_response_publish_failure),l}},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(o){throw this.client.logger.error("ping() -> isValidPing() failed"),o}let{topic:n}=r;if(this.client.session.keys.includes(n)){let o=wn(),s=bn().toString(),{done:i,resolve:a,reject:c}=Jd(At.FIVE_MINUTES,"Ping request expired without receiving any acknowledgement");this.events.once(nr("session_ping",o),({error:l})=>{l?c(l):a()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:o,relayRpcId:s}),i()])}else this.client.core.pairing.pairings.keys.includes(n)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:n}))},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);let{topic:n,event:o,chainId:s}=r,i=bn().toString(),a=wn();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:o,chainId:s},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:a})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);let{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:cr("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{let{message:o}=Ee("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(o)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>UY(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{this.isInitialized(),this.isValidAuthenticate(r);let o=n&&this.client.core.linkModeSupportedApps.includes(n)&&this.client.metadata.redirect?.linkMode,s=o?Cr.link_mode:Cr.relay;s===Cr.relay&&await this.confirmOnlineStateOrThrow();let{chains:i,statement:a="",uri:c,domain:l,nonce:u,type:d,exp:p,nbf:f,methods:m=[],expiry:g}=r,y=[...r.resources||[]],{topic:b,uri:C}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});if(this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:C}}),this.client.auth.authKeys.keys.includes(eh)){let{responseTopic:B,publicKey:_}=this.client.auth.authKeys.get(eh);B&&(await this.client.core.relayer.unsubscribe(B).catch(M=>this.client.logger.warn(M)),await this.client.auth.pairingTopics.delete(B,{message:"replaced",code:0}).catch(M=>this.client.logger.warn(M))),_&&this.client.core.crypto.keychain.has(_)&&await this.client.core.crypto.deleteKeyPair(_)}let w=await this.client.core.crypto.generateKeyPair(),x=oy(w);if(await Promise.all([this.client.auth.authKeys.set(eh,{responseTopic:x,publicKey:w}),this.client.auth.pairingTopics.set(x,{topic:x,pairingTopic:b})]),await this.client.core.relayer.subscribe(x,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),m.length>0){let{namespace:B}=Ec(i[0]),_=wY(B,"request",m);Yx(y)&&(_=bY(_,y.pop())),y.push(_)}let S=g&&g>So.wc_sessionAuthenticate.req.ttl?g:So.wc_sessionAuthenticate.req.ttl,P={authPayload:{type:d??"caip122",chains:i,statement:a,aud:c,domain:l,version:"1",nonce:u,iat:new Date().toISOString(),exp:p,nbf:f,resources:y},requester:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:en(S)},D={eip155:{chains:i,methods:[...new Set(["personal_sign",...m])],events:["chainChanged","accountsChanged"]}},U={requiredNamespaces:{},optionalNamespaces:D,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:w,metadata:this.client.metadata},expiryTimestamp:en(So.wc_sessionPropose.req.ttl),id:wn()},{done:N,resolve:L,reject:I}=Jd(S,"Request expired"),R=wn(),A=nr("session_connect",U.id),T=nr("session_request",R),v=async({error:B,session:_})=>{this.events.off(T,E),B?I(B):_&&L({session:_})},E=async B=>{if(await this.deletePendingAuthRequest(R,{message:"fulfilled",code:0}),B.error){let Y=cr("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return B.error.code===Y.code?void 0:(this.events.off(A,v),I(B.error.message))}await this.deleteProposal(U.id),this.events.off(A,v);let{cacaos:_,responder:M}=B.result,F=[],q=[];for(let Y of _){await IO({cacao:Y,projectId:this.client.core.projectId})||(this.client.logger.error(Y,"Signature verification failed"),I(cr("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:pe}=Y,he=Yx(pe.resources),Te=[jA(pe.iss)],me=Gx(pe.iss);if(he){let _e=_O(he),wt=PO(he);F.push(..._e),Te.push(...wt)}for(let _e of Te)q.push(`${_e}:${me}`)}let oe=await this.client.core.crypto.generateSharedKey(w,M.publicKey),Q;F.length>0&&(Q={topic:oe,acknowledged:!0,self:{publicKey:w,metadata:this.client.metadata},peer:M,controller:M.publicKey,expiry:en(xy),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:LO([...new Set(F)],[...new Set(q)]),transportType:s},await this.client.core.relayer.subscribe(oe,{transportType:s}),await this.client.session.set(oe,Q),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:M.metadata}),Q=this.client.session.get(oe)),this.client.metadata.redirect?.linkMode&&M.metadata.redirect?.linkMode&&M.metadata.redirect?.universal&&n&&(this.client.core.addLinkModeSupportedApp(M.metadata.redirect.universal),this.client.session.update(oe,{transportType:Cr.link_mode})),L({auths:_,session:Q})};this.events.once(A,v),this.events.once(T,E);let O;try{if(o){let B=lr("wc_sessionAuthenticate",P,R);this.client.core.history.set(b,B);let _=await this.client.core.crypto.encode("",B,{type:Qd,encoding:ka});O=Xx(n,b,_)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:P,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:R}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:U,expiry:So.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:U.id})])}catch(B){throw this.events.off(A,v),this.events.off(T,E),B}return await this.setProposal(U.id,U),await this.setAuthRequest(R,{request:{...P,verifyContext:{}},pairingTopic:b,transportType:s}),{uri:O??C,response:N}},this.approveSessionAuthenticate=async r=>{let{id:n,auths:o}=r,s=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[Xf.authenticated_session_approve_started]}});try{this.isInitialized()}catch(y){throw s.setError(by.no_internet_connection),y}let i=this.getPendingAuthRequest(n);if(!i)throw s.setError(by.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);let a=i.transportType||Cr.relay;a===Cr.relay&&await this.confirmOnlineStateOrThrow();let c=i.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),u=oy(c),d={type:Ac,receiverPublicKey:c,senderPublicKey:l},p=[],f=[];for(let y of o){if(!await IO({cacao:y,projectId:this.client.core.projectId})){s.setError(by.invalid_cacao);let S=cr("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:S,encodeOpts:d}),new Error(S.message)}s.addTrace(Xf.cacaos_verified);let{p:b}=y,C=Yx(b.resources),w=[jA(b.iss)],x=Gx(b.iss);if(C){let S=_O(C),P=PO(C);p.push(...S),w.push(...P)}for(let S of w)f.push(`${S}:${x}`)}let m=await this.client.core.crypto.generateSharedKey(l,c);s.addTrace(Xf.create_authenticated_session_topic);let g;if(p?.length>0){g={topic:m,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:c,metadata:i.requester.metadata},controller:c,expiry:en(xy),authentication:o,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:i.pairingTopic,namespaces:LO([...new Set(p)],[...new Set(f)]),transportType:a},s.addTrace(Xf.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:a})}catch(y){throw s.setError(by.subscribe_authenticated_session_topic_failure),y}s.addTrace(Xf.subscribe_authenticated_session_topic_success),await this.client.session.set(m,g),s.addTrace(Xf.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})}s.addTrace(Xf.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:o,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:d,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(i.requester.metadata,a)})}catch(y){throw s.setError(by.authenticated_session_approve_publish_failure),y}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:g}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();let{id:n,reason:o}=r,s=this.getPendingAuthRequest(n);if(!s)throw new Error(`Could not find pending auth request with id ${n}`);s.transportType===Cr.relay&&await this.confirmOnlineStateOrThrow();let i=s.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),c=oy(i),l={type:Ac,receiverPublicKey:i,senderPublicKey:a};await this.sendError({id:n,topic:c,error:o,encodeOpts:l,rpcOpts:So.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(s.requester.metadata,s.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.deleteProposal(n)},this.formatAuthMessage=r=>{this.isInitialized();let{request:n,iss:o}=r;return TO(n,o)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{let r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{let n=this.client.core.pairing.pairings.get(r.pairingTopic),o=this.client.core.pairing.pairings.getAll().filter(s=>s.peerMetadata?.url&&s.peerMetadata?.url===r.peer.metadata.url&&s.topic&&s.topic!==n.topic);if(o.length===0)return;this.client.logger.info(`Cleaning up ${o.length} duplicate pairing(s)`),await Promise.all(o.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{let{topic:n,expirerHasDeleted:o=!1,emitEvent:s=!0,id:i=0}=r,{self:a}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,cr("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),o||this.client.core.expirer.del(n),this.client.core.storage.removeItem(xQ).catch(c=>this.client.logger.warn(c)),n===this.sessionRequestQueue.queue[0]?.topic&&(this.sessionRequestQueue.state=Pl.idle),await Promise.all(this.getPendingSessionRequests().filter(c=>c.topic===n).map(c=>this.deletePendingSessionRequest(c.id,cr("USER_DISCONNECTED")))),s&&this.client.events.emit("session_delete",{id:i,topic:n})},this.deleteProposal=async(r,n)=>{if(n)try{let o=this.client.proposal.get(r);this.client.core.eventClient.getEvent({topic:o.pairingTopic})?.setError(Qf.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,cr("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,o=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),o&&(this.sessionRequestQueue.state=Pl.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,o=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),o?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,en(So.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{let{request:o,pairingTopic:s,transportType:i=Cr.relay}=n;this.client.core.expirer.set(r,o.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:o.authPayload,requester:o.requester,expiryTimestamp:o.expiryTimestamp,id:r,pairingTopic:s,verifyContext:o.verifyContext,transportType:i})},this.setPendingSessionRequest=async r=>{let{id:n,topic:o,params:s,verifyContext:i}=r,a=s.request.expiryTimestamp||en(So.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,a),await this.client.pendingRequest.set(n,{id:n,topic:o,params:s,verifyContext:i})},this.sendRequest=async r=>{let{topic:n,method:o,params:s,expiry:i,relayRpcId:a,clientRpcId:c,throwOnFailedPublish:l,appLink:u,tvf:d,publishOpts:p={}}=r,f=lr(o,s,c),m,g=!!u;try{let C=g?ka:jn;m=await this.client.core.crypto.encode(n,f,{encoding:C})}catch(C){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),C}let y;if($Pe.includes(o)){let C=ci(JSON.stringify(f)),w=ci(m);y=await this.client.core.verify.register({id:w,decryptedId:C})}let b={...So[o].req,...p};if(b.attestation=y,i&&(b.ttl=i),a&&(b.id=a),this.client.core.history.set(n,f),g){let C=Xx(u,n,m);await global.Linking.openURL(C,this.client.name)}else b.tvf={...d,correlationId:f.id},l?(b.internal={...b.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(n,m,b)):this.client.core.relayer.publish(n,m,b).catch(C=>this.client.logger.error(C));return f.id},this.sendProposeSession=async r=>{let{proposal:n,publishOpts:o}=r,s=lr("wc_sessionPropose",n,n.id);this.client.core.history.set(n.pairingTopic,s);let i=await this.client.core.crypto.encode(n.pairingTopic,s,{encoding:jn}),a=ci(JSON.stringify(s)),c=ci(i),l=await this.client.core.verify.register({id:c,decryptedId:a});await this.client.core.relayer.publishCustom({payload:{pairingTopic:n.pairingTopic,sessionProposal:i},opts:{...o,publishMethod:"wc_proposeSession",attestation:l}})},this.sendApproveSession=async r=>{let{sessionTopic:n,pairingProposalResponse:o,proposal:s,sessionSettleRequest:i,publishOpts:a}=r,c=oo(s.id,o),l=await this.client.core.crypto.encode(s.pairingTopic,c,{encoding:jn}),u=lr("wc_sessionSettle",i,a?.id),d=await this.client.core.crypto.encode(n,u,{encoding:jn});this.client.core.history.set(n,u),await this.client.core.relayer.publishCustom({payload:{sessionTopic:n,pairingTopic:s.pairingTopic,sessionProposalResponse:l,sessionSettlementRequest:d},opts:{...a,publishMethod:"wc_approveSession"}})},this.sendResult=async r=>{let{id:n,topic:o,result:s,throwOnFailedPublish:i,encodeOpts:a,appLink:c}=r,l=oo(n,s),u,d=c&&typeof global?.Linking<"u";try{let m=d?ka:jn;u=await this.client.core.crypto.encode(o,l,{...a||{},encoding:m})}catch(m){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${o} failed`),m}let p,f;try{p=await this.client.core.history.get(o,n);let m=p.request;try{f=this.getTVFParams(n,m.params,s)}catch(g){this.client.logger.warn(`sendResult() -> getTVFParams() failed: ${g?.message}`)}}catch(m){throw this.client.logger.error(`sendResult() -> history.get(${o}, ${n}) failed`),m}if(d){let m=Xx(c,o,u);await global.Linking.openURL(m,this.client.name)}else{let m=p.request.method,g=So[m].res;g.tvf={...f,correlationId:n},i?(g.internal={...g.internal,throwOnFailedPublish:!0},await this.client.core.relayer.publish(o,u,g)):this.client.core.relayer.publish(o,u,g).catch(y=>this.client.logger.error(y))}await this.client.core.history.resolve(l)},this.sendError=async r=>{let{id:n,topic:o,error:s,encodeOpts:i,rpcOpts:a,appLink:c}=r,l=Zi(n,s),u,d=c&&typeof global?.Linking<"u";try{let f=d?ka:jn;u=await this.client.core.crypto.encode(o,l,{...i||{},encoding:f})}catch(f){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${o} failed`),f}let p;try{p=await this.client.core.history.get(o,n)}catch(f){throw this.client.logger.error(`sendError() -> history.get(${o}, ${n}) failed`),f}if(d){let f=Xx(c,o,u);await global.Linking.openURL(f,this.client.name)}else{let f=p.request.method,m=a||So[f].res;this.client.core.relayer.publish(o,u,m)}await this.client.core.history.resolve(l)},this.cleanup=async()=>{let r=[],n=[];this.client.session.getAll().forEach(o=>{let s=!1;Ki(o.expiry)&&(s=!0),this.client.core.crypto.keychain.has(o.topic)||(s=!0),s&&r.push(o.topic)}),this.client.proposal.getAll().forEach(o=>{Ki(o.expiryTimestamp)&&n.push(o.id)}),await Promise.all([...r.map(o=>this.deleteSession({topic:o})),...n.map(o=>this.deleteProposal(o))])},this.onProviderMessageEvent=async r=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(r):await this.onRelayMessage(r)},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Pl.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Pl.active;let r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Pl.idle},this.processRequest=async r=>{let{topic:n,payload:o,attestation:s,transportType:i,encryptedId:a}=r,c=o.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:c}))switch(c){case"wc_sessionPropose":return await this.onSessionProposeRequest
6195({topic:n,payload:o,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,o);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,o);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,o);case"wc_sessionPing":return await this.onSessionPingRequest(n,o);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,o);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:o,attestation:s,encryptedId:a,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(n,o);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:o,attestation:s,encryptedId:a,transportType:i});default:return this.client.logger.info(`Unsupported request method ${c}`)}},this.onRelayEventResponse=async r=>{let{topic:n,payload:o,transportType:s}=r,i=(await this.client.core.history.get(n,o.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(n,o,s);case"wc_sessionSettle":return this.onSessionSettleResponse(n,o);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,o);case"wc_sessionExtend":return this.onSessionExtendResponse(n,o);case"wc_sessionPing":return this.onSessionPingResponse(n,o);case"wc_sessionRequest":return this.onSessionRequestResponse(n,o);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,o);default:return this.client.logger.info(`Unsupported response method ${i}`)}},this.onRelayEventUnknownPayload=r=>{let{topic:n}=r,{message:o}=Ee("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(o)},this.shouldIgnorePairingRequest=r=>{let{topic:n,requestMethod:o}=r,s=this.expectedPairingMethodMap.get(n);return!s||s.includes(o)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{let{topic:n,payload:o,attestation:s,encryptedId:i}=r,{params:a,id:c}=o;try{let l=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),l?.setError(Il.proposal_listener_not_found)),this.isValidConnect({...o.params});let u=a.expiryTimestamp||en(So.wc_sessionPropose.req.ttl),d={id:c,pairingTopic:n,expiryTimestamp:u,attestation:s,encryptedId:i,...a};await this.setProposal(c,d);let p=await this.getVerifyContext({attestationId:s,hash:ci(JSON.stringify(o)),encryptedId:i,metadata:d.proposer.metadata});l?.addTrace(Tc.emit_session_proposal),this.client.events.emit("session_proposal",{id:c,params:d,verifyContext:p})}catch(l){await this.sendError({id:c,topic:n,error:l,rpcOpts:So.wc_sessionPropose.autoReject}),this.client.logger.error(l)}},this.onSessionProposeResponse=async(r,n,o)=>{let{id:s}=n;if(Vr(n)){let{result:i}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let a=this.client.proposal.get(s);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});let c=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:c});let l=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});let u=await this.client.core.crypto.generateSharedKey(c,l);this.pendingSessions.set(s,{sessionTopic:u,pairingTopic:r,proposalId:s,publicKey:c});let d=await this.client.core.relayer.subscribe(u,{transportType:o});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:d}),await this.client.core.pairing.activate({topic:r})}else if(xr(n)){await this.deleteProposal(s);let i=nr("session_connect",s);if(this.events.listenerCount(i)===0)throw new Error(`emitting ${i} without any listeners, 954`);this.events.emit(i,{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{let{id:o,params:s}=n;try{this.isValidSessionSettleRequest(s);let{relay:i,controller:a,expiry:c,namespaces:l,sessionProperties:u,scopedProperties:d,sessionConfig:p,proposalRequestsResponses:f}=n.params,m=[...this.pendingSessions.values()].find(b=>b.sessionTopic===r);if(!m)return this.client.logger.error(`Pending session not found for topic ${r}`);let g=this.client.proposal.get(m.proposalId),y={topic:r,relay:i,expiry:c,namespaces:l,acknowledged:!0,pairingTopic:m.pairingTopic,requiredNamespaces:g.requiredNamespaces,optionalNamespaces:g.optionalNamespaces,controller:a.publicKey,self:{publicKey:m.publicKey,metadata:this.client.metadata},peer:{publicKey:a.publicKey,metadata:a.metadata},...u&&{sessionProperties:u},...d&&{scopedProperties:d},...p&&{sessionConfig:p},transportType:Cr.relay,authentication:f?.authentication,walletPayResult:f?.walletPay};await this.client.session.set(y.topic,y),await this.setExpiry(y.topic,y.expiry),await this.client.core.pairing.updateMetadata({topic:m.pairingTopic,metadata:y.peer.metadata}),this.pendingSessions.delete(m.proposalId),this.deleteProposal(m.proposalId,!1),this.cleanupDupl
vendor: 8,090 bytes, line 6195
6195icatePairings(y),await this.sendResult({id:n.id,topic:r,throwOnFailedPublish:!0,result:!0}),this.client.events.emit("session_connect",{session:y}),this.events.emit(nr("session_connect",m.proposalId),{session:y})}catch(i){await this.sendError({id:o,topic:r,error:i}),this.client.logger.error(i)}},this.onSessionSettleResponse=async(r,n)=>{let{id:o}=n;Vr(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(nr("session_approve",o),{})):xr(n)&&(await this.deleteSession({topic:r,emitEvent:!1}),this.events.emit(nr("session_approve",o),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{let{params:o,id:s}=n;try{let i=`${r}_session_update`,a=Wf.get(i);if(a&&this.isRequestOutOfSync(a,s)){this.client.logger.warn(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:cr("INVALID_UPDATE_REQUEST")});return}await this.isValidUpdate({topic:r,...o});let c=this.client.session.get(r);if(c.peer.publicKey!==c.controller)throw cr("UNAUTHORIZED_UPDATE_REQUEST");try{Wf.set(i,s),await this.client.session.update(r,{namespaces:o.namespaces}),await this.sendResult({id:s,topic:r,result:!0})}catch(l){throw Wf.delete(i),l}this.client.events.emit("session_update",{id:s,topic:r,params:o})}catch(i){await this.sendError({id:s,topic:r,error:i}),this.client.logger.error(i)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3)<r.toString().slice(0,-3),this.onSessionUpdateResponse=(r,n)=>{let{id:o}=n,s=nr("session_update",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(nr("session_update",o),{}):xr(n)&&this.events.emit(nr("session_update",o),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{let{id:o}=n;try{await this.isValidExtend({topic:r}),await this.setExpiry(r,en(xy)),await this.sendResult({id:o,topic:r,result:!0}),this.client.events.emit("session_extend",{id:o,topic:r})}catch(s){await this.sendError({id:o,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,n)=>{let{id:o}=n,s=nr("session_extend",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(nr("session_extend",o),{}):xr(n)&&this.events.emit(nr("session_extend",o),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{let{id:o}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:o,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:o,topic:r})}catch(s){await this.sendError({id:o,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,n)=>{let{id:o}=n,s=nr("session_ping",o);setTimeout(()=>{if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners 2176`);Vr(n)?this.events.emit(nr("session_ping",o),{}):xr(n)&&this.events.emit(nr("session_ping",o),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{let{id:o}=n;try{await this.isValidDisconnect({topic:r,reason:n.params}),this.cleanupPendingSentRequestsForTopic({topic:r,error:cr("USER_DISCONNECTED")}),await this.deleteSession({topic:r,id:o})}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{let{topic:n,payload:o,attestation:s,encryptedId:i,transportType:a}=r,{id:c,params:l}=o;try{await this.isValidRequest({topic:n,...l});let u=this.client.session.get(n),d=await this.getVerifyContext({attestationId:s,hash:ci(JSON.stringify(lr("wc_sessionRequest",l,c))),encryptedId:i,metadata:u.peer.metadata,transportType:a}),p={id:c,topic:n,params:l,verifyContext:d};await this.setPendingSessionRequest(p),a===Cr.link_mode&&u.peer.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(u.peer.metadata.redirect?.universal),this.client.signConfig?.disableRequestQueue?this.emitSessionRequest(p):(this.addSessionRequestToSessionRequestQueue(p),this.processSessionRequestQueue())}catch(u){await this.sendError({id:c,topic:n,error:u}),this.client.logger.error(u)}},this.onSessionRequestResponse=(r,n)=>{let{id:o}=n,s=nr("session_request",o);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);Vr(n)?this.events.emit(nr("session_request",o),{result:n.result}):xr(n)&&this.events.emit(nr("session_request",o),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{let{id:o,params:s}=n;try{let i=`${r}_session_event_${s.event.name}`,a=Wf.get(i);if(a&&this.isRequestOutOfSync(a,o)){this.client.logger.info(`Discarding out of sync request - ${o}`);return}this.isValidEmit({topic:r,...s}),this.client.events.emit("session_event",{id:o,topic:r,params:s}),Wf.set(i,o)}catch(i){await this.sendError({id:o,topic:r,error:i}),this.client.logger.error(i)}},this.onSessionAuthenticateResponse=(r,n)=>{let{id:o}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Vr(n)?this.events.emit(nr("session_request",o),{result:n.result}):xr(n)&&this.events.emit(nr("session_request",o),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{let{topic:n,payload:o,attestation:s,encryptedId:i,transportType:a}=r;try{let{requester:c,authPayload:l,expiryTimestamp:u}=o.params,d=await this.getVerifyContext({attestationId:s,hash:ci(JSON.stringify(o)),encryptedId:i,metadata:c.metadata,transportType:a}),p={requester:c,pairingTopic:n,id:o.id,authPayload:l,verifyContext:d,expiryTimestamp:u};await this.setAuthRequest(o.id,{request:p,pairingTopic:n,transportType:a}),a===Cr.link_mode&&c.metadata.redirect?.universal&&this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:o.params,id:o.id,verifyContext:d})}catch(c){this.client.logger.error(c);let l=o.params.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),d=this.getAppLinkIfEnabled(o.params.requester.metadata,a),p={type:Ac,receiverPublicKey:l,senderPublicKey:u};await this.sendError({id:o.id,topic:n,error:c,encodeOpts:p,rpcOpts:So.wc_sessionAuthenticate.autoReject,appLink:d})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Pl.idle,this.processSessionRequestQueue()},(0,At.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{let o=this.client.core.history.pending;o.length>0&&o.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{this.events.emit(nr("session_request",s.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Pl.active){this.client.logger.info("session request queue is already active.");return}let r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{if(this.emittedSessionRequests.has(r.id)){this.client.logger.warn({id:r.id},`Skipping emitting \`session_request\` event for duplicate request. id: ${r.id}`);return}this.sessionRequestQueue.state=Pl.active,this.emittedSessionRequests.add(r.id),this.client.events.emit("session_request",r)},this.cleanupInProgress=!1,this.cleanupOrphanedSubscriptions=async()=>{let r=this.client.core.relayer.subscriber.topics;if(r.length===0)return;let n=new Set(this.client.session.keys),o=new Set(this.client.core.pairing.pairings.keys),s=new Set([...this.pendingSessions.values()].map(a=>a.sessionTopic)),i;if(this.client.auth.authKeys.keys.includes(eh)){let{responseTopic:a}=this.client.auth.authKeys.get(eh);i=a}for(let a of r)if(!n.has(a)&&!o.has(a)&&!s.has(a)&&a!==i){this.client.logger.info(`Cleaning up orphaned subscriber topic: ${a}`);try{await this.client.core.relayer.subscriber.unsubscribe(a)}catch(c){this.client.logger.warn(c,`Failed to clean up orphaned subscription: ${a}`)}}},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;let n=this.client.proposal.getAll().find(o=>o.pairingTopic===r.topic);
6195n&&this.onSessionProposeRequest({topic:r.topic,payload:lr("wc_sessionPropose",{...n,requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties,scopedProperties:n.scopedProperties},n.id),attestation:n.attestation,encryptedId:n.encryptedId})},this.isValidConnect=async r=>{if(!Ko(r)){let{message:l}=Ee("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}let{pairingTopic:n,requiredNamespaces:o,optionalNamespaces:s,sessionProperties:i,scopedProperties:a,relays:c}=r;if(yn(n)||await this.isValidPairingTopic(n),!zY(c,!0)){let{message:l}=Ee("MISSING_OR_INVALID",`connect() relays: ${c}`);throw new Error(l)}if(o&&!yn(o)&&Da(o)!==0){let l="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(l):this.client.logger.warn(l),this.validateNamespaces(o,"requiredNamespaces")}if(s&&!yn(s)&&Da(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),i&&!yn(i)&&this.validateSessionProps(i,"sessionProperties"),a&&!yn(a)){this.validateSessionProps(a,"scopedProperties");let l=Object.keys(o||{}).concat(Object.keys(s||{}));if(!Object.keys(a).every(u=>l.includes(u.split(":")[0])))throw new Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(a)}, required/optional namespaces: ${JSON.stringify(l)}`)}},this.validateNamespaces=(r,n)=>{let o=VY(r,"connect()",n);if(o)throw new Error(o.message)},this.isValidApprove=async r=>{if(!Ko(r))throw new Error(Ee("MISSING_OR_INVALID",`approve() params: ${r}`).message);let{id:n,namespaces:o,relayProtocol:s,sessionProperties:i,scopedProperties:a}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);let c=this.client.proposal.get(n),l=WA(o,"approve()");if(l)throw new Error(l.message);let u=FO(c.requiredNamespaces,o,"approve()");if(u)throw new Error(u.message);if(!ln(s,!0)){let{message:d}=Ee("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(d)}if(i&&!yn(i)&&this.validateSessionProps(i,"sessionProperties"),a&&!yn(a)){this.validateSessionProps(a,"scopedProperties");let d=new Set(Object.keys(o));if(!Object.keys(a).every(p=>d.has(p.split(":")[0])))throw new Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(a)}, approved namespaces: ${Array.from(d).join(", ")}`)}},this.isValidReject=async r=>{if(!Ko(r)){let{message:s}=Ee("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}let{id:n,reason:o}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!qY(o)){let{message:s}=Ee("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(o)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!Ko(r)){let{message:l}=Ee("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(l)}let{relay:n,controller:o,namespaces:s,expiry:i}=r;if(!HO(n)){let{message:l}=Ee("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(l)}let a=$Y(o,"onSessionSettleRequest()");if(a)throw new Error(a.message);let c=WA(s,"onSessionSettleRequest()");if(c)throw new Error(c.message);if(Ki(i)){let{message:l}=Ee("EXPIRED","onSessionSettleRequest()");throw new Error(l)}},this.isValidUpdate=async r=>{if(!Ko(r)){let{message:c}=Ee("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(c)}let{topic:n,namespaces:o}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);
6195let s=this.client.session.get(n),i=WA(o,"update()");if(i)throw new Error(i.message);let a=FO(s.requiredNamespaces,o,"update()");if(a)throw new Error(a.message)},this.isValidExtend=async r=>{if(!Ko(r)){let{message:o}=Ee("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(o)}let{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Ko(r)){let{message:c}=Ee("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(c)}let{topic:n,request:o,chainId:s,expiry:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);let{namespaces:a}=this.client.session.get(n);if(!$O(a,s)){let{message:c}=Ee("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(c)}if(!WY(o)){let{message:c}=Ee("MISSING_OR_INVALID",`request() ${JSON.stringify(o)}`);throw new Error(c)}if(!GY(a,s,o.method)){let{message:c}=Ee("MISSING_OR_INVALID",`request() method: ${o.method}`);throw new Error(c)}this.validateRequestExpiry(i)},this.isValidRespond=async r=>{if(!Ko(r)){let{message:i}=Ee("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(i)}let{topic:n,response:o}=r;try{await this.isValidSessionTopic(n)}catch(i){throw r?.response?.id&&this.cleanupAfterResponse(r),i}if(!KY(o)){let{message:i}=Ee("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(o)}`);throw new Error(i)}let s=this.client.pendingRequest.get(o.id);if(s.topic!==n){let{message:i}=Ee("MISMATCHED_TOPIC",`Request response topic mismatch. reqId: ${o.id}, expected topic: ${s.topic}, received topic: ${n}`);throw new Error(i)}},this.isValidPing=async r=>{if(!Ko(r)){let{message:o}=Ee("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(o)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Ko(r)){let{message:a}=Ee("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(a)}let{topic:n,event:o,chainId:s}=r;await this.isValidSessionTopic(n);let{namespaces:i}=this.client.session.get(n);if(!$O(i,s)){let{message:a}=Ee("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(a)}if(!ZY(o)){let{message:a}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(a)}if(!YY(i,s,o.name)){let{message:a}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(o)}`);throw new Error(a)}},this.isValidDisconnect=async r=>{if(!Ko(r)){let{message:o}=Ee("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(o)}let{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{let{chains:n,uri:o,domain:s,nonce:i}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!ln(o,!1))throw new Error("uri is required parameter");if(!ln(s,!1))throw new Error("domain is required parameter");if(!ln(i,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(c=>Ec(c).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:a}=Ec(n[0]);if(a!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{let{attestationId:n,hash:o,encryptedId:s,metadata:i,transportType:a}=r,c={verified:{verifyUrl:i.verifyUrl||wy,validation:"UNKNOWN",origin:i.url||""}};try{if(a===Cr.link_mode){let u=this.getAppLinkIfEnabled(i,a);return c.verified.validation=u&&new URL(u).origin===new URL(i.url).origin?"VALID":"INVALID",c}let l=await this.client.core.verify.resolve({attestationId:n,hash:o,encryptedId:s,verifyUrl:i.verifyUrl});l&&(c.verified.origin=l.origin,c.verified.isScam=l.isScam,c.verified.validation=l.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`),c},this.validateSessionProps=(r,n)=>{Object.values(r).forEach((o,s)=>{if(o==null){let{message:i}=Ee("MISSING_OR_INVALID",`${n} must contain an existing value for each key. Received: ${o} for key ${Object.keys(r)[s]}`);throw new Error(i)}})},this.getPendingAuthRequest=r=>{let n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let o=0,s=this.recentlyDeletedLimit/2;
vendor: 4,899 bytes, line 6195
6195for(let i of this.recentlyDeletedMap.keys()){if(o++>=s)break;this.recentlyDeletedMap.delete(i)}}},this.checkRecentlyDeleted=r=>{let n=this.recentlyDeletedMap.get(r);if(n){let{message:o}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(o)}},this.isLinkModeEnabled=(r,n)=>!r||n!==Cr.link_mode?!1:this.client.metadata?.redirect?.linkMode===!0&&this.client.metadata?.redirect?.universal!==void 0&&this.client.metadata?.redirect?.universal!==""&&r?.redirect?.universal!==void 0&&r?.redirect?.universal!==""&&r?.redirect?.linkMode===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof global?.Linking<"u",this.getAppLinkIfEnabled=(r,n)=>this.isLinkModeEnabled(r,n)?r?.redirect?.universal:void 0,this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;let n=EO(r,"topic")||"",o=decodeURIComponent(EO(r,"wc_ev")||""),s=this.client.session.keys.includes(n);s&&this.client.session.update(n,{transportType:Cr.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:o,sessionExists:s})},this.registerLinkModeListeners=async()=>{if(Zx()||Yd()&&this.client.metadata.redirect?.linkMode){let r=global?.Linking;if(typeof r<"u"){r.addEventListener("url",this.handleLinkModeMessage,this.client.name);let n=await r.getInitialURL();n&&setTimeout(()=>{this.handleLinkModeMessage({url:n})},50)}}},this.getTVFApproveParams=r=>{try{let n=UO(r.namespaces),o=BY(r.namespaces),s=kY(r.namespaces),i=r.sessionProperties,a=r.scopedProperties;return{approvedChains:n,approvedMethods:o,approvedEvents:s,sessionProperties:i,scopedProperties:a}}catch(n){return this.client.logger.warn(n,"Error getting TVF approve params"),{}}},this.getTVFParams=(r,n,o)=>{if(!n.request?.method)return{};let s={correlationId:r,rpcMethods:[n.request.method],chainId:n.chainId};try{let i=this.extractTxHashesFromResult(n.request,o);s.txHashes=i,s.contractAddresses=this.isValidContractData(n.request.params)?[n.request.params?.[0]?.to]:[]}catch(i){this.client.logger.warn(i,"Error getting TVF params")}return s},this.isValidContractData=r=>{if(!r)return!1;try{let n=r?.data||r?.[0]?.data;if(!n.startsWith("0x"))return!1;let o=n.slice(2);return/^[0-9a-fA-F]*$/.test(o)?o.length%2===0:!1}catch{}return!1},this.extractTxHashesFromResult=(r,n)=>{try{if(!n)return[];let o=r.method,s=MPe[o];if(o==="sui_signTransaction")return[fY(n.transactionBytes)];if(o==="near_signTransaction")return[CO(n)];if(o==="near_signTransactions")return n.map(a=>CO(a));if(o==="xrpl_signTransactionFor"||o==="xrpl_signTransaction")return[n.tx_json?.hash];if(o==="polkadot_signTransaction")return[eJ({transaction:r.params.transactionPayload,signature:n.signature})];if(o==="algo_signTxn")return Os(n)?n.map(a=>SO(a)):[SO(n)];if(o==="cosmos_signDirect")return[hY(n)];if(o==="wallet_sendCalls")return mY(n);if(o==="canton_prepareSignExecute")return tJ(r.params,n);if(typeof n=="string")return[n];let i=n[s.key];if(Os(i))return o==="solana_signAllTransactions"?i.map(a=>pY(a)):i;if(typeof i=="string")return[i]}catch(o){this.client.logger.warn(o,"Error extracting tx hashes from result")}return[]}}async processPendingMessageEvents(){try{let t=this.client.session.keys,r=this.client.core.relayer.messages.getWithoutAck(t);for(let[n,o]of Object.entries(r))for(let s of o)try{await this.onProviderMessageEvent({topic:n,message:s,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${n}, message: ${s}`)}}catch(t){this.client.logger.warn(t,"processPendingMessageEvents failed")}}isInitialized(){if(!this.initialized){let{message:t}=Ee("NOT_INITIALIZED",this.name);throw new Error(t)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(un.message,t=>{this.onProviderMessageEvent(t)})}async onRelayMessage(t){let{topic:r,message:n,attestation:o,transportType:s}=t,{publicKey:i}=this.client.auth.authKeys.keys.includes(eh)?this.client.auth.authKeys.get(eh):{publicKey:void 0};try{try{if(s!==Cr.link_mode&&this.client.core.crypto.getPayloadType(n,ka)===Qd){this.client.logger.warn(`onRelayMessage() -> non-link mode TYPE_2 payload ignored: ${n}`);return}}catch{}let a=await this.client.core.crypto.decode(r,n,{receiverPublicKey:i,encoding:s===Cr.link_mode?ka:jn});Cc(a)?(this.client.core.history.set(r,a),await this.onRelayEventRequest({topic:r,payload:a,attestation:o,transportType:s,encryptedId:ci(n)})):Gi(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a,transportType:s}),this.client.core.history.delete(r,a.id)):(this.client.logger.error(`onRelayMessage() -> unknown payload: ${JSON.stringify(a)}`),await this.onRelayEventUnknownPayload({topic:r,payload:a,transportType:s})),await this.client.core.relayer.messages.ack(r,n)}catch(a){this.client.logger.error(`onRelayMessage() ->
6195 failed to process an inbound message: ${n}`),this.client.logger.error(a?.message)}}registerExpirerEvents(){this.client.core.expirer.on(Xi.expired,async t=>{let{topic:r,id:n}=VA(t.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,Ee("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,Ee("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerSubscriptionCleanup(){this.client.core.heartbeat.on("heartbeat_pulse",async()=>{if(!this.cleanupInProgress){this.cleanupInProgress=!0;try{await this.cleanupOrphanedSubscriptions()}catch(t){this.client.logger.warn(t)}finally{this.cleanupInProgress=!1}}})}registerPairingEvents(){this.client.core.pairing.events.on(Jf.create,t=>this.onPairingCreated(t)),this.client.core.pairing.events.on(Jf.delete,t=>{this.addToRecentlyDeleted(t.topic,"pairing")})}isValidPairingTopic(t){if(!ln(t,!1)){let{message:r}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${t}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(t)){let{message:r}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${t}`);throw new Error(r)}if(Ki(this.client.core.pairing.pairings.get(t).expiry)){let{message:r}=Ee("EXPIRED",`pairing topic: ${t}`);throw new Error(r)}}async isValidSessionTopic(t){if(!ln(t,!1)){let{message:r}=Ee("MISSING_OR_INVALID",`session topic should be a string: ${t}`);throw new Error(r)}if(this.checkRecentlyDeleted(t),!this.client.session.keys.includes(t)){let{message:r}=Ee("NO_MATCHING_KEY",`session topic doesn't exist: ${t}`);throw new Error(r)}if(Ki(this.client.session.get(t).expiry)){await this.deleteSession({topic:t});let{message:r}=Ee("EXPIRED",`session topic: ${t}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(t)){let{message:r}=Ee("MISSING_OR_INVALID",`session topic does not exist in keychain: ${t}`);throw await this.deleteSession({topic:t}),new Error(r)}}async isValidSessionOrPairingTopic(t){if(this.checkRecentlyDeleted(t),this.client.session.keys.includes(t))await this.isValidSessionTopic(t);else if(this.client.core.pairing.pairings.keys.includes(t))this.isValidPairingTopic(t);else if(ln(t,!1)){let{message:r}=Ee("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${t}`);throw new Error(r)}else{let{message:r}=Ee("MISSING_OR_INVALID",`session or pairing topic should be a string: ${t}`);throw new Error(r)}}async isValidProposalId(t){if(!jY(t)){let{message:r}=Ee("MISSING_OR_INVALID",`proposal id should be a number: ${t}`);throw new Error(r)}if(!this.client.proposal.keys.includes(t)){let{message:r}=Ee("NO_MATCHING_KEY",`proposal id doesn't exist: ${t}`);throw new Error(r)}if(Ki(this.client.proposal.get(t).expiryTimestamp)){await this.deleteProposal(t);let{message:r}=Ee("EXPIRED",`proposal id: ${t}`);throw new Error(r)}}validateRequestExpiry(t){if(t&&!JY(t,_B)){let{message:r}=Ee("MISSING_OR_INVALID",`request() expiry: ${t}. Expiry must be a number (in seconds) between ${_B.min} and ${_B.max}`);throw new Error(r)}}},NB=class extends _l{constructor(t,r){super(t,r,DPe,LB),this.core=t,this.logger=r}},RB=class extends _l{constructor(t,r){super(t,r,UPe,LB),this.core=t,this.logger=r}},OB=class extends _l{constructor(t,r){super(t,r,HPe,LB,n=>n.id),this.core=t,this.logger=r}},BB=class extends _l{constructor(t,r){super(t,r,zPe,qC,()=>eh),this.core=t,this.logger=r}},kB=class extends _l{constructor(t,r){super(t,r,jPe,qC),this.core=t,this.logger=r}},DB=class extends _l{constructor(t,r){super(t,r,qPe,qC,n=>n.id),this.core=t,this.logger=r}},UB=class{constructor(t,r){this.core=t,this.logger=r,this.authKeys=new BB(this.core,this.logger),this.pairingTopics=new kB(this.core,this.logger),this.requests=new DB(this.core,this.logger)}
vendor: 5,764 bytes, line 6195
6195async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}},WPe=class SQ extends aC{constructor(t){super(t),this.protocol=EQ,this.version=AQ,this.name=TB.name,this.events=new jC.EventEmitter,this.on=(n,o)=>this.events.on(n,o),this.once=(n,o)=>this.events.once(n,o),this.off=(n,o)=>this.events.off(n,o),this.removeListener=(n,o)=>this.events.removeListener(n,o),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(o){throw this.logger.error(o.message),o}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(o){throw this.logger.error(o.message),o}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(o){throw this.logger.error(o.message),o}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(o){throw this.logger.error(o.message),o}},this.update=async n=>{try{return await this.engine.update(n)}catch(o){throw this.logger.error(o.message),o}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(o){throw this.logger.error(o.message),o}},this.request=async n=>{try{return await this.engine.request(n)}catch(o){throw this.logger.error(o.message),o}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(o){throw this.logger.error(o.message),o}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(o){throw this.logger.error(o.message),o}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(o){throw this.logger.error(o.message),o}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(o){throw this.logger.error(o.message),o}},this.find=n=>{try{return this.engine.find(n)}catch(o){throw this.logger.error(o.message),o}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,o)=>{try{return console.warn("[WalletConnect] `authenticate` is deprecated and will be removed in a future release. Use `connect()`'s `authentication` instead to establish an authenticated session."),await this.engine.authenticate(n,o)}catch(s){throw this.logger.error(s.message),s}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(o){throw this.logger.error(o.message),o}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(o){throw this.logger.error(o.message),o}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(o){throw this.logger.error(o.message),o}},this.name=t?.name||TB.name,this.metadata=rY(t?.metadata),this.signConfig=t?.signConfig;let r=ay({logger:t?.logger||TB.logger,name:this.name});this.logger=r,this.core=t?.core||new bQ(t),this.session=new RB(this.core,this.logger),this.proposal=new NB(this.core,this.logger),this.pendingRequest=new OB(this.core,this.logger),this.engine=new PB(this),this.auth=new UB(this.core,this.logger)}static async init(t){let r=new SQ(t);return await r.initialize(),r}get context(){return rr(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success")}catch(t){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(t.message),t}}};var IQ=WPe;Sc();uy();ZC();var zQ=Lt(Cs(),1),UQ="error",eNe="wss://relay.walletconnect.org",tNe="wc",jQ="universal_provider",GC=`${tNe}@2:${jQ}:`,qQ="https://rpc.walletconnect.org/v1/",WQ="generic",rNe=`${qQ}bundler`,Ey="call_status",nNe=86400,WB={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};function KQ(e,t,r){let n=Ec(e);return t.rpcMap?.[n.reference]||`${qQ}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function oNe(e){return e.includes(":")?e.split(":")[1]:e}function ZQ(e){return e.map(t=>`${t.split(":")[0]}:${t.split(":")[1]}`)}function sNe(e,t){let r=Object.keys(t.namespaces).filter(o=>o.includes(e));if(!r.length)return[];let n=[];return r.forEach(o=>{let s=t.namespaces[o].accounts;n.push(...s)}),n}function LQ(e){return Object.fromEntries(Object.entries(e).filter(([t,r])=>r?.chains?.length&&r?.chains?.length>0))}function YC(e={},t={}){let r=LQ(MQ(e)),n=LQ(MQ(t));return dB(r,n)}function MQ(e){let t={};if(!Da(e))return t;for(let[r,n]of Object.entries(e)){let o=e8(r)?[r]:n.chains,s=n.methods||[],i=n.events||[],a=n.rpcMap||{},c=e1(r);t[c]={...t[c],...n,chains:xc(o,t[c]?.chains),methods:xc(s,t[c]?.methods),events:xc(i,t[c]?.events)},(Da(a)||Da(t[c]?.rpcMap||{}))&&(t[c].rpcMap={...a,...t[c]?.rpcMap})}return t}function HQ(e){return e.includes(":")?e.split(":")[2]:e}function $Q(e){let t={};for(let[r,n]of Object.entries(e)){let o=n.methods||[],s=n.events||[],i=n.accounts||[],a=e8(r)?[r]:n.chains?n.chains:ZQ(n.accounts);t[r]={chains:a,methods:o,events:s,accounts:i}}return t}function HB(e){return typeof e=="number"?e:e.includes("0x")?parseInt(e,16):(e=e.includes(":")?e.split(":")[1]:e,isNaN(Number(e))?e:Number(e))}function iNe(e){try{let t=JSON.parse(e);return typeof t=="object"&&t!==null&&!Array.isArray(t)}catch{return!1}}var GQ={},Ay=e=>GQ[e],$B=(e,t)=>{GQ[e]=t},FQ="eip155",aNe=["atomic","flow-control","paymasterService","sessionKeys","auxiliaryFunds"],cNe=e=>e&&e.startsWith("0x")?BigInt(e).toString(10):e,FB=e=>e&&e.startsWith("0x")?e:`0x${BigInt(e).toString(16)}`,VQ=e=>Object.keys(e).filter(t=>aNe.includes(t)).reduce((t,r)=>(t[r]=lNe(e[r]),t),{}),lNe=e=>typeof e=="string"&&iNe(e)?JSON.parse(e):e,uNe=(e,t,r)=>{let{sessionProperties:n={},scopedProperties:o={}}=e,s={};if(!Da(o)&&!Da(n))return;
6195let i=VQ(n);for(let a of r){let c=cNe(a);if(!c)continue;s[FB(c)]=i;let l=o?.[`${FQ}:${c}`];if(l){let u=l?.[`${FQ}:${c}:${t}`];s[FB(c)]={...s[FB(c)],...VQ(u||l)}}}for(let[a,c]of Object.entries(s))Object.keys(c).length===0&&delete s[a];return Object.keys(s).length>0?s:void 0},VB,zB=class e{constructor(t){this.storage=t}async getItem(t){return await this.storage.getItem(t)}async setItem(t,r){return await this.storage.setItem(t,r)}async removeItem(t){return await this.storage.removeItem(t)}static getStorage(t){return VB||(VB=new e(t)),VB}};async function dNe(e,t){let r=Ec(e.result.capabilities.caip345.caip2),n=e.result.capabilities.caip345.transactionHashes,o=await Promise.allSettled(n.map(d=>pNe(r.reference,d,t))),s=o.filter(d=>d.status==="fulfilled").map(d=>d.value).filter(d=>d);o.filter(d=>d.status==="rejected").forEach(d=>console.warn("Failed to fetch transaction receipt:",d.reason));let i=!s.length||s.some(d=>!d),a=s.every(d=>d?.status==="0x1"),c=s.every(d=>d?.status==="0x0"),l=s.some(d=>d?.status==="0x0"),u;return i?u=100:a?u=200:c?u=500:l&&(u=600),{id:e.result.id,version:e.request.version,atomic:e.request.atomicRequired,chainId:e.request.chainId,capabilities:e.result.capabilities,receipts:s,status:u}}async function pNe(e,t,r){return await r(parseInt(e)).request(lr("eth_getTransactionReceipt",[t]))}async function fNe({sendCalls:e,storage:t}){let r=await t.getItem(Ey);await t.setItem(Ey,{...r,[e.result.id]:{request:e.request,result:e.result,expiry:en(nNe)}})}async function hNe({resultId:e,storage:t}){let r=await t.getItem(Ey);if(r){delete r[e],await t.setItem(Ey,r);for(let n in r)Ki(r[n].expiry)&&delete r[n];await t.setItem(Ey,r)}}async function mNe({resultId:e,storage:t}){let r=(await t.getItem(Ey))?.[e];if(r&&!Ki(r.expiry))return r;await hNe({resultId:e,storage:t})}var jB=class{constructor(t){this.name="eip155",this.namespace=t.namespace,this.events=Ay("events"),this.client=Ay("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain()),this.storage=zB.getStorage(this.client.core.storage)}async request(t){switch(t.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(t);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(t);case"wallet_getCallsStatus":return await this.getCallStatus(t);case"wallet_sendCalls":return await this.sendCalls(t)}return this.namespace.methods.includes(t.request.method)?await this.client.request(t):this.getHttpProvider().request(t.request)}updateNamespace(t){this.namespace=Object.assign(this.namespace,t)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(parseInt(t),r);let n=this.chainId;this.chainId=parseInt(t),this.events.emit(WB.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${t}`,previousCaipChainId:`${this.name}:${n}`})}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}createHttpProvider(t,r){let n=r||KQ(`${this.name}:${t}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ji(new Ha(n,Ay("disableProviderPing")))}setHttpProvider(t,r){let n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProviders(){let t={};return this.namespace.chains.forEach(r=>{let n=parseInt(oNe(r));t[n]=this.createHttpProvider(n,this.namespace.rpcMap?.[r])}),t}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(t){let r=t||this.chainId;return this.httpProviders[r]||(this.httpProviders={...this.httpProviders,[r]:this.createHttpProvider(r)},this.httpProviders[r])}async handleSwitchChain(t){let r=t.request.params?t.request.params[0]?.chainId:"0x0";r=r.startsWith("0x")?r:`0x${r}`;let n=parseInt(r,16);if(this.isChainApproved(n))this.setDefaultChain(`${n}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:t.to
vendor: 5,444 bytes, line 6195
6195pic,request:{method:t.request.method,params:[{chainId:r}]},chainId:this.namespace.chains?.[0]}),this.setDefaultChain(`${n}`);else throw new Error(`Failed to switch to chain 'eip155:${n}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(t){return this.namespace.chains.includes(`${this.name}:${t}`)}async getCapabilities(t){let r=t.request?.params?.[0],n=t.request?.params?.[1]||[];if(!r)throw new Error("Missing address parameter in `wallet_getCapabilities` request");let o=this.client.session.get(t.topic),s=o?.sessionProperties?.capabilities||{},i=n.length>0?n.join(","):`0x${this.chainId.toString(16)}`,a=`${r}${i}`,c=s?.[a];if(c)return c;let l;try{l=uNe(o,r,n)}catch(d){console.warn("Failed to extract capabilities from session",d)}if(l)return l;let u=await this.client.request(t);try{await this.client.session.update(t.topic,{sessionProperties:{...o.sessionProperties||{},capabilities:{...s||{},[a]:u}}})}catch(d){console.warn("Failed to update session with capabilities",d)}return u}async getCallStatus(t){let r=this.client.session.get(t.topic),n=r.sessionProperties?.bundler_name;if(n){let i=this.getBundlerUrl(t.chainId,n);try{return await this.getUserOperationReceipt(i,t)}catch(a){console.warn("Failed to fetch call status from bundler",a,i)}}let o=r.sessionProperties?.bundler_url;if(o)try{return await this.getUserOperationReceipt(o,t)}catch(i){console.warn("Failed to fetch call status from custom bundler",i,o)}let s=await mNe({resultId:t.request.params?.[0],storage:this.storage});if(s)try{return await dNe(s,this.getHttpProvider.bind(this))}catch(i){console.warn("Failed to fetch call status from stored send calls",i,s)}if(this.namespace.methods.includes(t.request.method))return await this.client.request(t);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(t,r){let n=new URL(t),o=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(lr("eth_getUserOperationReceipt",[r.request.params?.[0]]))});if(!o.ok)throw new Error(`Failed to fetch user operation receipt - ${o.status}`);return await o.json()}getBundlerUrl(t,r){return`${rNe}?projectId=${this.client.core.projectId}&chainId=${t}&bundler=${r}`}async sendCalls(t){let r=await this.client.request(t),n=t.request.params?.[0],o=r?.id,s=r?.capabilities||{},i=s?.caip345?.caip2,a=s?.caip345?.transactionHashes;return!o||!i||!a?.length||await fNe({sendCalls:{request:n,result:r},storage:this.storage}),r}},qB=class{constructor(t){this.name=WQ,this.namespace=t.namespace,this.events=Ay("events"),this.client=Ay("client"),this.chainId=this.getDefaultChain(),this.name=this.getNamespaceName(),this.httpProviders=this.createHttpProviders()}updateNamespace(t){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(t.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(t.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(t.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(t.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(t){return this.namespace.methods.includes(t.request.method)?this.client.request(t):this.getHttpProvider(t.chainId).request(t.request)}setDefaultChain(t,r){this.httpProviders[t]||this.setHttpProvider(t,r);let n=this.chainId;this.chainId=t,this.events.emit(WB.DEFAULT_CHAIN_CHANGED,{currentCaipChainId:`${this.name}:${t}`,previousCaipChainId:`${this.name}:${n}`})}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return t.split(":")[1]}getNamespaceName(){let t=this.namespace.chains[0];if(!t)throw new Error("ChainId not found");return Ec(t).namespace}getAccounts(){let t=this.namespace.accounts;return t?[...new Set(t.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){let t={};return this.namespace?.accounts?.forEach(r=>{let n=Ec(r),o=this.namespace?.rpcMap?.[`${n.namespace}:${n.reference}`];t[n.reference]=this.createHttpProvider(r,o)}),t}getHttpProvider(t){let r=Ec(t).reference,n=this.httpProviders[r];if(typeof n>"u")throw new Error(`JSON-RPC provider for ${t} not found`);return n}setHttpProvider(t,r){let n=this.createHttpProvider(t,r);n&&(this.httpProviders[t]=n)}createHttpProvider(t,r){let n=r||KQ(t,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${t}`);return new Ji(new Ha(n,Ay("disableProviderPing")))}},gNe=class YQ{constructor(t){this.events=new zQ.default,this.rpcProviders={},this.disableProviderPing=!1,this.providerOpts=t,this.logger=ay({logger:t.logger??UQ,name:this.providerOpts.name??jQ}),this.disableProviderPing=t?.disableProviderPing||!1}static async init(t){let r=new YQ(t);return await r.initialize(),r}async request(t,r,n){let[o,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(o).request({request:{...t},chainId:`${o}:${s}`,topic:this.session.topic,expiry:n})}sendAsync(t,r,n,o){let s=new Date().getTime();this.request(t,n,o).then(i=>r(null,oo(s,i))).catch(i=>r(i,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");
6195return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties}),await this.requestAccounts()}async disconnect(){if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:this.session?.topic,reason:cr("USER_DISCONNECTED")}),await this.cleanup()}async connect(t){if(!this.client)throw new Error("Sign Client not initialized");if(this.connectParams=t,this.setNamespaces(t),this.cleanupPendingPairings(),!t.skipPairing)return await this.pair(t.pairingTopic)}async authenticate(t,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(t),await this.cleanupPendingPairings();let{uri:n,response:o}=await this.client.authenticate(t,r);n&&(this.uri=n,this.events.emit("display_uri",n));let s=await o();if(this.session=s.session,this.session){let i=$Q(this.session.namespaces);this.namespaces=YC(this.namespaces,i),await this.persist("namespaces",this.namespaces),this.onConnect()}return s}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}removeListener(t,r){this.events.removeListener(t,r)}off(t,r){this.events.off(t,r)}get isWalletConnect(){return!0}async pair(t){let{uri:r,approval:n}=await this.client.connect({pairingTopic:t,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties,scopedProperties:this.scopedProperties,authentication:this.connectParams?.authentication,walletPay:this.connectParams?.walletPay});r&&(this.uri=r,this.events.emit("display_uri",r));let o=await n();this.session=o;let s=$Q(o.namespaces);return this.namespaces=YC(this.namespaces,s),await this.persist("namespaces",this.namespaces),await this.persist("optionalNamespaces",this.optionalNamespaces),this.onConnect(),this.session}setDefaultChain(t,r){try{if(!this.session)return;let[n,o]=this.validateChain(t),s=this.getProvider(n);s?s.setDefaultChain(o,r):this.session&&this.logger.warn(`Provider for namespace '${n}' not found in setDefaultChain`)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(t={}){try{this.logger.info("Cleaning up inactive pairings...");let r=this.client.pairing.getAll();if(!Os(r))return;for(let n of r)t.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}catch(r){this.logger.warn(r,"Failed to cleanup pending pairings")}}abortPairingAttempt(){this.logger.warn("abortPairingAttempt is deprecated. This is now a no-op.")}async checkStorage(){this.namespaces=await this.getFromStore("namespaces")||{},this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.session&&this.createProviders()}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){if(this.client=this.providerOpts.client||await IQ.init({core:this.providerOpts.core,logger:this.providerOpts.logger||UQ,relayUrl:this.providerOpts.relayUrl||eNe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.providerOpts.session)try{this.session=this.client.session.get(this.providerOpts.session.topic)}catch(t){throw this.logger.error(t,"Failed to get session"),new Error(`The provided session: ${this.providerOpts?.session?.topic} doesn't exist in the Sign client`)}else{let t=this.client.session.getAll();this.session=t[0]}this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");let t=[...new Set(Object.keys(this.session.namespaces).map(r=>e1(r)))];$B("client",this.client),$B("events",this.events),$B("disableProviderPing",this.disableProviderPing),t.forEach(r=>{if(!this.session)return;let n=sNe(r,this.session);if(n?.length===0)return;let o=ZQ(n),s={...YC(this.namespaces,this.optionalNamespaces)[r],accounts:n,chains:o};r==="eip155"?this.rpcProviders[r]=new jB({namespace:s}):this.rpcProviders[r]=new qB({namespace:s})})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",t=>{let{topic:r}=t;r===this.session?.topic&&this.events.emit("session_ping",t)}
6195),this.client.on("session_event",t=>{let{params:r,topic:n}=t;if(n!==this.session?.topic)return;let{event:o}=r;if(o.name==="accountsChanged"){let s=o.data;s&&Os(s)&&this.events.emit("accountsChanged",s.map(HQ))}else if(o.name==="chainChanged"){let s=r.chainId,i=r.event.data,a=e1(s),c=HB(s)!==HB(i)?`${a}:${HB(i)}`:s;this.onChainChanged({currentCaipChainId:c})}else this.events.emit(o.name,o.data);this.events.emit("session_event",t)}),this.client.on("session_update",({topic:t,params:r})=>{if(t!==this.session?.topic)return;let{namespaces:n}=r,o=this.client?.session.get(t);this.session={...o,namespaces:n},this.onSessionUpdate(),this.events.emit("session_update",{topic:t,params:r})}),this.client.on("session_delete",async t=>{t.topic===this.session?.topic&&(await this.cleanup(),this.events.emit("session_delete",t),this.events.emit("disconnect",{...cr("USER_DISCONNECTED"),data:t.topic}))}),this.on(WB.DEFAULT_CHAIN_CHANGED,t=>{this.onChainChanged({...t,internal:!0})})}getProvider(t){return this.rpcProviders[t]||this.rpcProviders[WQ]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(t=>{this.getProvider(t).updateNamespace(this.session?.namespaces[t])})}setNamespaces(t){let{namespaces:r={},optionalNamespaces:n={},sessionProperties:o,scopedProperties:s}=t;this.optionalNamespaces=YC(r,n),this.sessionProperties=o,this.scopedProperties=s}validateChain(t){let[r,n]=t?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(i=>e1(i)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];let o=e1(Object.keys(this.namespaces)[0]),s=this.rpcProviders[o].getDefaultChain();return[o,s]}async requestAccounts(){let[t]=this.validateChain();return await this.getProvider(t).requestAccounts()}async onChainChanged({currentCaipChainId:t,previousCaipChainId:r,internal:n=!1}){if(!this.namespaces)return;let[o,s]=this.validateChain(t);if(s){if(this.updateNamespaceChain(o,s),n)this.events.emit("chainChanged",s),this.emitAccountsChangedOnChainChange({namespace:o,currentCaipChainId:t,previousCaipChainId:r});else{let i=this.getProvider(o);i?i.setDefaultChain(s):this.session&&this.logger.warn(`Provider for namespace '${o}' not found during chain change`)}await this.persist("namespaces",this.namespaces)}}emitAccountsChangedOnChainChange({namespace:t,currentCaipChainId:r,previousCaipChainId:n}){try{if(n===r)return;let o=this.session?.namespaces[t]?.accounts;if(!o)return;let s=o.filter(i=>i.includes(`${r}:`)).map(HQ);if(!Os(s))return;this.events.emit("accountsChanged",s)}catch(o){this.logger.warn(o,"Failed to emit accountsChanged on chain change")}}updateNamespaceChain(t,r){if(!this.namespaces)return;let n=this.namespaces[t]?t:`${t}:${r}`,o={chains:[],methods:[],events:[],defaultChain:r};this.namespaces[n]?this.namespaces[n]&&(this.namespaces[n].defaultChain=r):this.namespaces[n]=o}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.connectParams=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,await this.deleteFromStore("namespaces"),await this.deleteFromStore("optionalNamespaces"),await this.deleteFromStore("sessionProperties"),this.session=void 0,this.cleanupPendingPairings({deletePairings:!0}),await this.cleanupStorage()}async persist(t,r){let n=this.session?.topic||"";await this.client.core.storage.setItem(`${GC}/${t}${n}`,r)}async getFromStore(t){let r=this.session?.topic||"";return await this.client.core.storage.getItem(`${GC}/${t}${r}`)}async deleteFromStore(t){let r=this.session?.topic||"";await this.client.core.storage.removeItem(`${GC}/${t}${r}`)}async cleanupStorage(){try{if(this.client?.session.length>0)return;let t=await this.client.core.storage.getKeys();for(let r of t)r.startsWith(GC)&&await this.client.core.storage.removeItem(r)}catch(t){this.logger.warn(t,"Failed to cleanup storage")}}},KB=gNe;var ZYe="wc",GYe="ethereum_provider",YYe=`${ZYe}@2:${GYe}:`,JYe="https://rpc.walletconnect.org/v1/",jz=["eth_sendTransaction","personal_sign"],QYe=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],qz=["chainChanged","accountsChanged"],XYe=["chainChanged","accountsChanged","message","disconnect","connect"],eJe=async()=>{let{createAppKit:e}=await Promise.resolve().then(()=>(yve(),gve));return e};function cP(e){return Number(e[0].split(":")[1])}function aP(e){return`0x${e.toString(16)}`}function tJe(e){let{chains:t,optionalChains:r,methods:n,optionalMethods:o,events:s,optionalEvents:i,rpcMap:a}=e;if(!Os(t))throw new Error("Invalid chains");let c={chains:t,methods:n||jz,events:s||qz,rpcMap:{...t.length?{[cP(t)]:a[cP(t)]}:{}}},l=s?.filter(f=>!qz.includes(f)),u=n?.filter(f=>!jz.includes(f));if(!r&&!i&&!o&&!l?.length&&!u?.length)return{required:t.length?c:void 0};let d=l?.length&&u?.length||!r,p={chains:[...new Set(d?c.chains.concat(r||[]):r)],methods:[...new Set(c.methods.concat(o?.length?o:QYe))],events:[...new Set(c.events.concat(i?.length?
vendor: 4,854 bytes, line 6195
6195i:XYe))],rpcMap:a};return{required:t.length?c:void 0,optional:r.length?p:void 0}}var rJe=class bve{constructor(){this.events=new wve.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=YYe,this.on=(t,r)=>(this.events.on(t,r),this),this.once=(t,r)=>(this.events.once(t,r),this),this.removeListener=(t,r)=>(this.events.removeListener(t,r),this),this.off=(t,r)=>(this.events.off(t,r),this),this.parseAccount=t=>this.isCompatibleChainId(t)?this.parseAccountId(t).address:t,this.signer={},this.rpc={}}static async init(t){let r=new bve;return await r.initialize(t),r}async request(t,r){return await this.signer.request(t,this.formatChainId(this.chainId),r)}sendAsync(t,r,n){this.signer.sendAsync(t,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(t);let{required:r,optional:n}=tJe(this.rpc);try{let o=await new Promise(async(i,a)=>{this.rpc.showQrModal&&(this.modal?.open(),this.modal?.subscribeState(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),a(new Error("Connection request reset. Please try again.")))}));let c=t?.scopedProperties?{[this.namespace]:t.scopedProperties}:void 0;await this.signer.connect({namespaces:{...r&&{[this.namespace]:r}},...n&&{optionalNamespaces:{[this.namespace]:n}},pairingTopic:t?.pairingTopic,scopedProperties:c}).then(l=>{i(l)}).catch(l=>{this.modal?.showErrorMessage("Unable to connect"),a(new Error(l.message))})});if(!o)return;let s=wO(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:aP(this.chainId)})}catch(o){throw this.signer.logger.error(o),o}finally{this.modal?.close()}}async authenticate(t,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:t?.chains});try{let n=await new Promise(async(s,i)=>{this.rpc.showQrModal&&(this.modal?.open(),this.modal?.subscribeState(a=>{!a.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),i(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate({...t,chains:this.rpc.chains},r).then(a=>{s(a)}).catch(a=>{this.modal?.showErrorMessage("Unable to connect"),i(new Error(a.message))})}),o=n.session;if(o){let s=wO(o.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:aP(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal?.close()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",t=>{let{params:r}=t,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",t)}),this.signer.on("accountsChanged",t=>{this.accounts=this.parseAccounts(t),this.events.emit("accountsChanged",this.accounts)}),this.signer.on("chainChanged",t=>{let r=parseInt(t);this.chainId=r,this.events.emit("chainChanged",aP(this.chainId)),this.persist()}),this.signer.on("session_update",t=>{this.events.emit("session_update",t)}),this.signer.on("session_delete",t=>{this.reset(),this.events.emit("session_delete",t),this.events.emit("disconnect",{...cr("USER_DISCONNECTED"),data:t.topic,name:"USER_DISCONNECTED"})}),this.signer.on("display_uri",t=>{this.events.emit("display_uri",t)})}switchEthereumChain(t){this.request({method:"wallet_switchEthereumChain",params:[{chainId:t.toString(16)}]})}isCompatibleChainId(t){return typeof t=="string"?t.startsWith(`${this.namespace}:`):!1}formatChainId(t){return`${this.namespace}:${t}`}parseChainId(t){return Number(t.split(":")[1])}setChainIds(t){let r=t.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",aP(this.chainId)),this.persist())}setChainId(t){if(this.isCompatibleChainId(t)){let r=this.parseChainId(t);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(t){let[r,n,o]=t.split(":");return{chainId:`${r}:${n}`,address:o}}setAccounts(t){this.accounts=t.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}
vendor: 5,707 bytes, lines 6195-6204
6195getRpcConfig(t){let r=t?.chains??[],n=t?.optionalChains??[],o=r.concat(n);if(!o.length)throw new Error("No chains specified in either `chains` or `optionalChains`");let s=r.length?t?.methods||jz:[],i=r.length?t?.events||qz:[],a=t?.optionalMethods||[],c=t?.optionalEvents||[],l=t?.rpcMap||this.buildRpcMap(o,t.projectId),u=t?.qrModalOptions||void 0;return{chains:r?.map(d=>this.formatChainId(d)),optionalChains:n.map(d=>this.formatChainId(d)),methods:s,events:i,optionalMethods:a,optionalEvents:c,rpcMap:l,showQrModal:!!t?.showQrModal,qrModalOptions:u,projectId:t.projectId,metadata:t.metadata}}buildRpcMap(t,r){let n={};return t.forEach(o=>{n[o]=this.getRpcUrl(o,r)}),n}async initialize(t){if(this.rpc=this.getRpcConfig(t),this.chainId=this.rpc.chains.length?cP(this.rpc.chains):cP(this.rpc.optionalChains),this.signer=await KB.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:t.disableProviderPing,relayUrl:t.relayUrl,storage:t.storage,storageOptions:t.storageOptions,customStoragePrefix:t.customStoragePrefix,telemetryEnabled:t.telemetryEnabled,logger:t.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{let n=await eJe(),{convertWCMToAppKitOptions:o}=await Promise.resolve().then(function(){return aJe}),s=o({...this.rpc.qrModalOptions,chains:[...new Set([...this.rpc.chains,...this.rpc.optionalChains])],metadata:this.rpc.metadata,projectId:this.rpc.projectId});if(!s.networks.length)throw new Error("No networks found for WalletConnect");r=n({...s,universalProvider:this.signer,manualWCControl:!0,enableMobileFullScreen:this.rpc.qrModalOptions?.enableMobileFullScreen===!0})}catch(n){throw console.warn(n),new Error("To use QR modal, please install @reown/appkit package")}if(r)try{this.modal=r}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(t){if(!t)return;let{chains:r,optionalChains:n,rpcMap:o}=t;r&&Os(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=o?.[s]||this.getRpcUrl(s)})),n&&Os(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n?.map(s=>this.formatChainId(s)),n.forEach(s=>{this.rpc.rpcMap[s]=o?.[s]||this.getRpcUrl(s)}))}getRpcUrl(t,r){return this.rpc.rpcMap?.[t]||`${JYe}?chainId=eip155:${t}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{let t=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${t}`]?this.session.namespaces[`${this.namespace}:${t}`]:this.session.namespaces[this.namespace];this.setChainIds(t?[this.formatChainId(t)]:r?.accounts),this.setAccounts(r?.accounts)}catch(t){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(t),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(t){return typeof t=="string"||t instanceof String?[this.parseAccount(t)]:t.map(r=>this.parseAccount(r))}},nJe=rJe;function oJe(e){if(e)return{"--w3m-font-family":e["--wcm-font-family"],"--w3m-accent":e["--wcm-accent-color"],"--w3m-color-mix":e["--wcm-background-color"],"--w3m-z-index":e["--wcm-z-index"]?Number(e["--wcm-z-index"]):void 0,"--w3m-qr-color":e["--wcm-accent-color"],"--w3m-font-size-master":e["--wcm-text-medium-regular-size"],"--w3m-border-radius-master":e["--wcm-container-border-radius"],"--w3m-color-mix-strength":0}}var sJe=e=>{let[t,r]=e.split(":");return xve({id:r,caipNetworkId:e,chainNamespace:t,name:"",nativeCurrency:{name:"",symbol:"",decimals:8},rpcUrls:{default:{http:["https://rpc.walletconnect.org/v1"]}}})};function iJe(e){let t=e.chains?.map(sJe).filter(Boolean);if(t.length===0)throw new Error("At least one chain must be specified");let r=t.find(o=>o.id===e.defaultChain?.id),n={projectId:e.projectId,networks:t,themeMode:e.themeMode,themeVariables:oJe(e.themeVariables),chainImages:e.chainImages,connectorImages:e.walletImages,defaultNetwork:r,metadata:{...e.metadata,name:e.metadata?.name||"WalletConnect",description:e.metadata?.description||"Connect to WalletConnect-compatible wallets",url:e.metadata?.url||"https://walletconnect.org",icons:e.metadata?.icons||["https://walletconnect.org/walletconnect-logo.png"]},showWallets:!0,featuredWalletIds:e.explorerRecommendedWalletIds==="NONE"?[]:Array.isArray(e.explorerRecommendedWalletIds)?e.explorerRecommendedWalletIds:[],excludeWalletIds:e.explorerExcludedWalletIds==="ALL"?[]:Array.isArray(e.explorerExcludedWalletIds)?e.explorerExcludedWalletIds:[],enableEIP6963:!1,enableInjected:!1,enableCoinbase:!0,enableWalletConnect:!0,features:{email:!1,socials:!1}};if(e.mobileWallets?.length||e.desktopWallets?.length){let o=[...(e.mobileWallets||[]).map(a=>({id:a.id,name:a.name,links:a.links})),...(e.desktopWallets||[]).map(a=>({id:a.id,name:a.name,links:{native:a.links.native,universal:a.links.universal}}))],s=[...n.featuredWalletIds||[],...n.excludeWalletIds||[]],i=o.filter(a=>!s.includes(a.id));i.length&&(n.customWallets=i)}return n}function xve(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}var aJe=Object.freeze({__proto__:null,convertWCMToAppKitOptions:iJe,defineChain:xve});export{nJe as EthereumProvider,KB as UniversalProvider};
6196/*! Bundled license information:
6197
6198tslib/tslib.es6.js:
6199  (*! *****************************************************************************
6200  Copyright (c) Microsoft Corporation.
6201  
6202  Permission to use, copy, modify, and/or distribute this software for any
6203  purpose with or without fee is hereby granted.
6204  
6205  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
6206  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
6207  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
6208  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
6209  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
6210  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
6211  PERFORMANCE OF THIS SOFTWARE.
6212  ***************************************************************************** *)
6213
6214@scure/base/lib/esm/index.js:
6215  (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
6216
6217@noble/ciphers/esm/utils.js:
6218@walletconnect/utils/dist/index.js:
6219  (*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
6220
6221@scure/bip39/esm/index.js:
6222  (*! scure-bip39 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
6223
6224@walletconnect/relay-auth/dist/index.es.js:
6225  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
6226  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
6227
6228@noble/hashes/esm/utils.js:
6229@noble/hashes/esm/utils.js:
6230@noble/hashes/esm/utils.js:
6231  (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
6232
6233@noble/curves/esm/abstract/utils.js:
6234@noble/curves/esm/abstract/modular.js:
6235@noble/curves/esm/abstract/curve.js:
6236@noble/curves/esm/abstract/weierstrass.js:
6237@noble/curves/esm/_shortw_utils.js:
6238@noble/curves/esm/secp256k1.js:
6239@noble/curves/esm/abstract/utils.js:
6240@noble/curves/esm/abstract/modular.js:
6241@noble/curves/esm/abstract/curve.js:
6242@noble/curves/esm/abstract/weierstrass.js:
6243@noble/curves/esm/_shortw_utils.js:
6244@noble/curves/esm/secp256k1.js:
6245@noble/curves/esm/abstract/utils.js:
6246@noble/curves/esm/abstract/modular.js:
6247@noble/curves/esm/abstract/curve.js:
6248@noble/curves/esm/abstract/weierstrass.js:
6249@noble/curves/esm/_shortw_utils.js:
6250@noble/curves/esm/secp256k1.js:
6251@noble/curves/esm/utils.js:
6252@noble/curves/esm/abstract/modular.js:
6253@noble/curves/esm/abstract/curve.js:
6254@noble/curves/esm/abstract/edwards.js:
6255@noble/curves/esm/abstract/montgomery.js:
6256@noble/curves/esm/ed25519.js:
6257@noble/curves/esm/abstract/weierstrass.js:
6258@noble/curves/esm/_shortw_utils.js:
6259@noble/curves/esm/nist.js:
6260@noble/curves/esm/p256.js:
6261  (*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
6262
6263@lit/reactive-element/css-tag.js:
6264@lit/reactive-element/css-tag.mjs:
6265  (**
6266   * @license
6267   * Copyright 2019 Google LLC
6268   * SPDX-License-Identifier: BSD-3-Clause
6269   *)
6270
6271@lit/reactive-element/reactive-element.js:
6272lit-html/lit-html.js:
6273lit-element/lit-element.js:
6274@lit/reactive-element/decorators/custom-element.js:
6275@lit/reactive-element/decorators/property.js:
6276@lit/reactive-element/decorators/state.js:
6277@lit/reactive-element/decorators/event-options.js:
6278@lit/reactive-element/decorators/base.js:
6279@lit/reactive-element/decorators/query.js:
6280@lit/reactive-element/decorators/query-all.js:
6281@lit/reactive-element/decorators/query-async.js:
6282@lit/reactive-element/decorators/query-assigned-nodes.js:
6283@lit/reactive-element/reactive-element.mjs:
6284lit-html/lit-html.mjs:
6285lit-element/lit-element.mjs:
6286@lit/reactive-element/decorators/custom-element.mjs:
6287@lit/reactive-element/decorators/property.mjs:
6288lit-html/directive.js:
6289lit-html/async-directive.js:
6290  (**
6291   * @license
6292   * Copyright 2017 Google LLC
6293   * SPDX-License-Identifier: BSD-3-Clause
6294   *)
6295
6296lit-html/is-server.js:
6297  (**
6298   * @license
6299   * Copyright 2022 Google LLC
6300   * SPDX-License-Identifier: BSD-3-Clause
6301   *)
6302
6303@lit/reactive-element/decorators/query-assigned-elements.js:
6304  (**
6305   * @license
6306   * Copyright 2021 Google LLC
6307   * SPDX-License-Identifier: BSD-3-Clause
6308   *)
6309
6310lit-html/directives/if-defined.js:
6311lit-html/directives/class-map.js:
6312  (**
6313   * @license
6314   * Copyright 2018 Google LLC
6315   * SPDX-License-Identifier: BSD-3-Clause
6316   *)
6317
6318lit-html/static.js:
6319lit-html/directive-helpers.js:
6320lit-html/directives/ref.js:
6321  (**
6322   * @license
6323   * Copyright 2020 Google LLC
6324   * SPDX-License-Identifier: BSD-3-Clause
6325   *)
6326*/

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.