1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/walletConnect-B-KVLXv3.js","assets/events-DQ172AOg.js","assets/browser-CVs-ImMB.js","assets/main-C77D1zRs.js","assets/Dashboard-8lB-xNUa.js","assets/CeremonyCounter-CbOUucBO.js","assets/heldOutputs-BiXnI4z3.js","assets/zkdefi-Ck38Gwfu.js","assets/useFeeConfig-DEFOuITj.js","assets/PrivateSend-D0vosNmc.js","assets/priorityFee-B-S0oop4.js","assets/zk-viz-DlAubO7u.js","assets/DenomVault-DROeH09V.js","assets/usePayout-CgSIDgu9.js","assets/DestinationWarning-DOR8rlrk.js","assets/PayoutOptions-0WCpzWGt.js","assets/ClaimFunds-aSvr7GOn.js","assets/useFlexDiscount-D3WT7ZJ9.js","assets/Streams-D8z2QHam.js","assets/Cards-B3ki-rAv.js","assets/banking-DOBpQ8ZX.js","assets/OffRamp-DOxl9M12.js","assets/noteActivation-CdSPpQEs.js","assets/Banking-CMwimUOu.js","assets/Ceremony-YwfZNq_U.js","assets/DeFiSwap-CPAQGjaC.js","assets/jupTokens-DMXvjBRA.js","assets/publicSwap-88mAB7Wp.js","assets/LiquidityPools-Cy_DxROV.js","assets/ClaimDenom-CnEsvbhz.js","assets/ScreenReceive-0hDlpoQD.js","assets/receiveAddresses-CPf9HDu8.js","assets/payPrivate-Bff8_fqt.js","assets/ScreenSettings-D974tv-b.js","assets/ScreenPay-Fsjg026E.js"])))=>i.map(i=>d[i]); 2(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qg(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){var o=!1;try{o=this instanceof i}catch{}return o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var o=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,o.get?o:{enumerable:!0,get:function(){return e[i]}})}),n}var ep={exports:{}},mc={};var kb;function e5(){if(kb)return mc;kb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return mc.Fragment=t,mc.jsx=n,mc.jsxs=n,mc}var Ub;function t5(){return Ub||(Ub=1,ep.exports=e5()),ep.exports}var w=t5(),tp={},yc={},jb;function n5(){if(jb)return yc;jb=1,yc.byteLength=f,yc.toByteArray=y,yc.fromByteArray=D;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,l=i.length;o<l;
vendor: 4,566 bytes, line 2
2++o)e[o]=i[o],t[i.charCodeAt(o)]=o;t[45]=62,t[95]=63;function u(U){var L=U.length;if(L%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=U.indexOf("=");k===-1&&(k=L);var j=k===L?0:4-k%4;return[k,j]}function f(U){var L=u(U),k=L[0],j=L[1];return(k+j)*3/4-j}function h(U,L,k){return(L+k)*3/4-k}function y(U){var L,k=u(U),j=k[0],M=k[1],W=new n(h(U,j,M)),K=0,se=M>0?j-4:j,re;for(re=0;re<se;re+=4)L=t[U.charCodeAt(re)]<<18|t[U.charCodeAt(re+1)]<<12|t[U.charCodeAt(re+2)]<<6|t[U.charCodeAt(re+3)],W[K++]=L>>16&255,W[K++]=L>>8&255,W[K++]=L&255;return M===2&&(L=t[U.charCodeAt(re)]<<2|t[U.charCodeAt(re+1)]>>4,W[K++]=L&255),M===1&&(L=t[U.charCodeAt(re)]<<10|t[U.charCodeAt(re+1)]<<4|t[U.charCodeAt(re+2)]>>2,W[K++]=L>>8&255,W[K++]=L&255),W}function _(U){return e[U>>18&63]+e[U>>12&63]+e[U>>6&63]+e[U&63]}function A(U,L,k){for(var j,M=[],W=L;W<k;W+=3)j=(U[W]<<16&16711680)+(U[W+1]<<8&65280)+(U[W+2]&255),M.push(_(j));return M.join("")}function D(U){for(var L,k=U.length,j=k%3,M=[],W=16383,K=0,se=k-j;K<se;K+=W)M.push(A(U,K,K+W>se?se:K+W));return j===1?(L=U[k-1],M.push(e[L>>2]+e[L<<4&63]+"==")):j===2&&(L=(U[k-2]<<8)+U[k-1],M.push(e[L>>10]+e[L>>4&63]+e[L<<2&63]+"=")),M.join("")}return yc}var Sf={};var Lb;function r5(){return Lb||(Lb=1,Sf.read=function(e,t,n,i,o){var l,u,f=o*8-i-1,h=(1<<f)-1,y=h>>1,_=-7,A=n?o-1:0,D=n?-1:1,U=e[t+A];for(A+=D,l=U&(1<<-_)-1,U>>=-_,_+=f;_>0;l=l*256+e[t+A],A+=D,_-=8);for(u=l&(1<<-_)-1,l>>=-_,_+=i;_>0;u=u*256+e[t+A],A+=D,_-=8);if(l===0)l=1-y;else{if(l===h)return u?NaN:(U?-1:1)*(1/0);u=u+Math.pow(2,i),l=l-y}return(U?-1:1)*u*Math.pow(2,l-i)},Sf.write=function(e,t,n,i,o,l){var u,f,h,y=l*8-o-1,_=(1<<y)-1,A=_>>1,D=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,U=i?0:l-1,L=i?1:-1,k=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,u=_):(u=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-u))<1&&(u--,h*=2),u+A>=1?t+=D/h:t+=D*Math.pow(2,1-A),t*h>=2&&(u++,h/=2),u+A>=_?(f=0,u=_):u+A>=1?(f=(t*h-1)*Math.pow(2,o),u=u+A):(f=t*Math.pow(2,A-1)*Math.pow(2,o),u=0));o>=8;e[n+U]=f&255,U+=L,f/=256,o-=8);for(u=u<<o|f,y+=o;y>0;e[n+U]=u&255,U+=L,u/=256,y-=8);e[n+U-L]|=k*128}),Sf}var zb;function e1(){return zb||(zb=1,(function(e){const t=n5(),n=r5(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=W,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,f.TYPED_ARRAY_SUPPORT=l(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const H=new Uint8Array(1),S={foo:function(){return 42}};return Object.setPrototypeOf(S,Uint8Array.prototype),Object.setPrototypeOf(H,S),H.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function u(H){if(H>o)throw new RangeError('The value "'+H+'" is invalid for option "size"');const S=new Uint8Array(H);return Object.setPrototypeOf(S,f.prototype),S}function f(H,S,I){if(typeof H=="number"){if(typeof S=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return A(H)}return h(H,S,I)}f.poolSize=8192;function h(H,S,I){if(typeof H=="string")return D(H,S);if(ArrayBuffer.isView(H))return L(H);if(H==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof H);if(jn(H,ArrayBuffer)||H&&jn(H.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(jn(H,SharedArrayBuffer)||H&&jn(H.buffer,SharedArrayBuffer)))return k(H,S,I);if(typeof H=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Y=H.valueOf&&H.valueOf();if(Y!=null&&Y!==H)return f.from(Y,S,I);const ge=j(H);if(ge)return ge;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof H[Symbol.toPrimitive]=="function")return f.from(H[Symbol.toPrimitive]("string"),S,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof H)}f.from=function(H,S,I){return h(H,S,I)},Object.setPrototypeOf(f.prototype,Uint8Array.prototype),Object.setPrototypeOf(f,Uint8Array);function y(H){if(typeof H!="number")throw new TypeError('"size" argument must be of type number');
vendor: 18,896 bytes, line 2
2if(H<0)throw new RangeError('The value "'+H+'" is invalid for option "size"')}function _(H,S,I){return y(H),H<=0?u(H):S!==void 0?typeof I=="string"?u(H).fill(S,I):u(H).fill(S):u(H)}f.alloc=function(H,S,I){return _(H,S,I)};function A(H){return y(H),u(H<0?0:M(H)|0)}f.allocUnsafe=function(H){return A(H)},f.allocUnsafeSlow=function(H){return A(H)};function D(H,S){if((typeof S!="string"||S==="")&&(S="utf8"),!f.isEncoding(S))throw new TypeError("Unknown encoding: "+S);const I=K(H,S)|0;let Y=u(I);const ge=Y.write(H,S);return ge!==I&&(Y=Y.slice(0,ge)),Y}function U(H){const S=H.length<0?0:M(H.length)|0,I=u(S);for(let Y=0;Y<S;Y+=1)I[Y]=H[Y]&255;return I}function L(H){if(jn(H,Uint8Array)){const S=new Uint8Array(H);return k(S.buffer,S.byteOffset,S.byteLength)}return U(H)}function k(H,S,I){if(S<0||H.byteLength<S)throw new RangeError('"offset" is outside of buffer bounds');if(H.byteLength<S+(I||0))throw new RangeError('"length" is outside of buffer bounds');let Y;return S===void 0&&I===void 0?Y=new Uint8Array(H):I===void 0?Y=new Uint8Array(H,S):Y=new Uint8Array(H,S,I),Object.setPrototypeOf(Y,f.prototype),Y}function j(H){if(f.isBuffer(H)){const S=M(H.length)|0,I=u(S);return I.length===0||H.copy(I,0,0,S),I}if(H.length!==void 0)return typeof H.length!="number"||Fe(H.length)?u(0):U(H);if(H.type==="Buffer"&&Array.isArray(H.data))return U(H.data)}function M(H){if(H>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return H|0}function W(H){return+H!=H&&(H=0),f.alloc(+H)}f.isBuffer=function(S){return S!=null&&S._isBuffer===!0&&S!==f.prototype},f.compare=function(S,I){if(jn(S,Uint8Array)&&(S=f.from(S,S.offset,S.byteLength)),jn(I,Uint8Array)&&(I=f.from(I,I.offset,I.byteLength)),!f.isBuffer(S)||!f.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(S===I)return 0;let Y=S.length,ge=I.length;for(let be=0,Re=Math.min(Y,ge);be<Re;++be)if(S[be]!==I[be]){Y=S[be],ge=I[be];break}return Y<ge?-1:ge<Y?1:0},f.isEncoding=function(S){switch(String(S).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(S,I){if(!Array.isArray(S))throw new TypeError('"list" argument must be an Array of Buffers');if(S.length===0)return f.alloc(0);let Y;if(I===void 0)for(I=0,Y=0;Y<S.length;++Y)I+=S[Y].length;const ge=f.allocUnsafe(I);let be=0;for(Y=0;Y<S.length;++Y){let Re=S[Y];if(jn(Re,Uint8Array))be+Re.length>ge.length?(f.isBuffer(Re)||(Re=f.from(Re)),Re.copy(ge,be)):Uint8Array.prototype.set.call(ge,Re,be);else if(f.isBuffer(Re))Re.copy(ge,be);else throw new TypeError('"list" argument must be an Array of Buffers');be+=Re.length}return ge};function K(H,S){if(f.isBuffer(H))return H.length;if(ArrayBuffer.isView(H)||jn(H,ArrayBuffer))return H.byteLength;if(typeof H!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof H);const I=H.length,Y=arguments.length>2&&arguments[2]===!0;if(!Y&&I===0)return 0;let ge=!1;for(;;)switch(S){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Bt(H).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return jt(H).length;default:if(ge)return Y?-1:Bt(H).length;S=(""+S).toLowerCase(),ge=!0}}f.byteLength=K;function se(H,S,I){let Y=!1;if((S===void 0||S<0)&&(S=0),S>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,S>>>=0,I<=S))return"";for(H||(H="utf8");;)switch(H){case"hex":return G(this,S,I);case"utf8":case"utf-8":return g(this,S,I);case"ascii":return B(this,S,I);case"latin1":case"binary":return z(this,S,I);case"base64":return N(this,S,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return J(this,S,I);default:if(Y)throw new TypeError("Unknown encoding: "+H);H=(H+"").toLowerCase(),Y=!0}}f.prototype._isBuffer=!0;function re(H,S,I){const Y=H[S];H[S]=H[I],H[I]=Y}f.prototype.swap16=function(){const S=this.length;if(S%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<S;I+=2)re(this,I,I+1);return this},f.prototype.swap32=function(){const S=this.length;if(S%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<S;I+=4)re(this,I,I+3),re(this,I+1,I+2);return this},f.prototype.swap64=function(){const S=this.length;if(S%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<S;I+=8)re(this,I,I+7),re(this,I+1,I+6),re(this,I+2,I+5),re(this,I+3,I+4);return this},f.prototype.toString=function(){const S=this.length;return S===0?"":arguments.length===0?g(this,0,S):se.apply(this,arguments)},f.prototype.toLocaleString=f.prototype.toString,f.prototype.equals=function(S){if(!f.isBuffer(S))throw new TypeError("Argument must be a Buffer");return this===S?!0:f.compare(this,S)===0},f.prototype.inspect=function(){let S="";const I=e.INSPECT_MAX_BYTES;return S=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(S+=" ... "),"<Buffer "+S+">"},i&&(f.prototype[i]=f.prototype.inspect),f.prototype.compare=function(S,I,Y,ge,be){if(jn(S,Uint8Array)&&(S=f.from(S,S.offset,S.byteLength)),!f.isBuffer(S))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof S);if(I===void 0&&(I=0),Y===void 0&&(Y=S?S.length:0),ge===void 0&&(ge=0),be===void 0&&(be=this.length),I<0||Y>S.length||ge<0||be>this.length)throw new RangeError("out of range index");if(ge>=be&&I>=Y)return 0;if(ge>=be)return-1;if(I>=Y)return 1;if(I>>>=0,Y>>>=0,ge>>>=0,be>>>=0,this===S)return 0;let Re=be-ge,ft=Y-I;const dt=Math.min(Re,ft),rt=this.slice(ge,be),Zt=S.slice(I,Y);for(let pt=0;pt<dt;++pt)if(rt[pt]!==Zt[pt]){Re=rt[pt],ft=Zt[pt];break}return Re<ft?-1:ft<Re?1:0};function te(H,S,I,Y,ge){if(H.length===0)return-1;if(typeof I=="string"?(Y=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,Fe(I)&&(I=ge?0:H.length-1),I<0&&(I=H.length+I),I>=H.length){if(ge)return-1;I=H.length-1}else if(I<0)if(ge)I=0;else return-1;if(typeof S=="string"&&(S=f.from(S,Y)),f.isBuffer(S))return S.length===0?-1:pe(H,S,I,Y,ge);if(typeof S=="number")return S=S&255,typeof Uint8Array.prototype.indexOf=="function"?ge?Uint8Array.prototype.indexOf.call(H,S,I):Uint8Array.prototype.lastIndexOf.call(H,S,I):pe(H,[S],I,Y,ge);throw new TypeError("val must be string, number or Buffer")}function pe(H,S,I,Y,ge){let be=1,Re=H.length,ft=S.length;if(Y!==void 0&&(Y=String(Y).toLowerCase(),Y==="ucs2"||Y==="ucs-2"||Y==="utf16le"||Y==="utf-16le")){if(H.length<2||S.length<2)return-1;be=2,Re/=2,ft/=2,I/=2}function dt(Zt,pt){return be===1?Zt[pt]:Zt.readUInt16BE(pt*be)}let rt;if(ge){let Zt=-1;for(rt=I;rt<Re;rt++)if(dt(H,rt)===dt(S,Zt===-1?0:rt-Zt)){if(Zt===-1&&(Zt=rt),rt-Zt+1===ft)return Zt*be}else Zt!==-1&&(rt-=rt-Zt),Zt=-1}else for(I+ft>Re&&(I=Re-ft),rt=I;rt>=0;rt--){let Zt=!0;for(let pt=0;pt<ft;pt++)if(dt(H,rt+pt)!==dt(S,pt)){Zt=!1;break}if(Zt)return rt}return-1}f.prototype.includes=function(S,I,Y){return this.indexOf(S,I,Y)!==-1},f.prototype.indexOf=function(S,I,Y){return te(this,S,I,Y,!0)},f.prototype.lastIndexOf=function(S,I,Y){return te(this,S,I,Y,!1)};function we(H,S,I,Y){I=Number(I)||0;const ge=H.length-I;Y?(Y=Number(Y),Y>ge&&(Y=ge)):Y=ge;const be=S.length;Y>be/2&&(Y=be/2);let Re;for(Re=0;Re<Y;++Re){const ft=parseInt(S.substr(Re*2,2),16);if(Fe(ft))return Re;H[I+Re]=ft}return Re}function X(H,S,I,Y){return Lt(Bt(S,H.length-I),H,I,Y)}function Z(H,S,I,Y){return Lt(Ze(S),H,I,Y)}function ae(H,S,I,Y){return Lt(jt(S),H,I,Y)}function ce(H,S,I,Y){return Lt(an(S,H.length-I),H,I,Y)}f.prototype.write=function(S,I,Y,ge){if(I===void 0)ge="utf8",Y=this.length,I=0;else if(Y===void 0&&typeof I=="string")ge=I,Y=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(Y)?(Y=Y>>>0,ge===void 0&&(ge="utf8")):(ge=Y,Y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const be=this.length-I;if((Y===void 0||Y>be)&&(Y=be),S.length>0&&(Y<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");ge||(ge="utf8");let Re=!1;for(;;)switch(ge){case"hex":return we(this,S,I,Y);case"utf8":case"utf-8":return X(this,S,I,Y);case"ascii":case"latin1":case"binary":return Z(this,S,I,Y);case"base64":return ae(this,S,I,Y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ce(this,S,I,Y);default:if(Re)throw new TypeError("Unknown encoding: "+ge);ge=(""+ge).toLowerCase(),Re=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(H,S,I){return S===0&&I===H.length?t.fromByteArray(H):t.fromByteArray(H.slice(S,I))}function g(H,S,I){I=Math.min(H.length,I);const Y=[];let ge=S;for(;ge<I;){const be=H[ge];let Re=null,ft=be>239?4:be>223?3:be>191?2:1;if(ge+ft<=I){let dt,rt,Zt,pt;switch(ft){case 1:be<128&&(Re=be);break;case 2:dt=H[ge+1],(dt&192)===128&&(pt=(be&31)<<6|dt&63,pt>127&&(Re=pt));break;case 3:dt=H[ge+1],rt=H[ge+2],(dt&192)===128&&(rt&192)===128&&(pt=(be&15)<<12|(dt&63)<<6|rt&63,pt>2047&&(pt<55296||pt>57343)&&(Re=pt));break;case 4:dt=H[ge+1],rt=H[ge+2],Zt=H[ge+3],(dt&192)===128&&(rt&192)===128&&(Zt&192)===128&&(pt=(be&15)<<18|(dt&63)<<12|(rt&63)<<6|Zt&63,pt>65535&&pt<1114112&&(Re=pt))}}Re===null?(Re=65533,ft=1):Re>65535&&(Re-=65536,Y.push(Re>>>10&1023|55296),Re=56320|Re&1023),Y.push(Re),ge+=ft}return E(Y)}const v=4096;function E(H){const S=H.length;if(S<=v)return String.fromCharCode.apply(String,H);let I="",Y=0;for(;Y<S;)I+=String.fromCharCode.apply(String,H.slice(Y,Y+=v));return I}function B(H,S,I){let Y="";I=Math.min(H.length,I);for(let ge=S;ge<I;++ge)Y+=String.fromCharCode(H[ge]&127);return Y}function z(H,S,I){let Y="";I=Math.min(H.length,I);for(let ge=S;ge<I;++ge)Y+=String.fromCharCode(H[ge]);return Y}function G(H,S,I){const Y=H.length;(!S||S<0)&&(S=0),(!I||I<0||I>Y)&&(I=Y);let ge="";for(let be=S;be<I;++be)ge+=qe[H[be]];return ge}function J(H,S,I){const Y=H.slice(S,I);let ge="";for(let be=0;be<Y.length-1;be+=2)ge+=String.fromCharCode(Y[be]+Y[be+1]*256);return ge}f.prototype.slice=function(S,I){const Y=this.length;S=~~S,I=I===void 0?Y:~~I,S<0?(S+=Y,S<0&&(S=0)):S>Y&&(S=Y),I<0?(I+=Y,I<0&&(I=0)):I>Y&&(I=Y),I<S&&(I=S);const ge=this.subarray(S,I);return Object.setPrototypeOf(ge,f.prototype),ge};function T(H,S,I){if(H%1!==0||H<0)throw new RangeError("offset is not uint");if(H+S>I)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(S,I,Y){S=S>>>0,I=I>>>0,Y||T(S,I,this.length);let ge=this[S],be=1,Re=0;for(;++Re<I&&(be*=256);)ge+=this[S+Re]*be;return ge},f.prototype.readUintBE=f.prototype.readUIntBE=function(S,I,Y){S=S>>>0,I=I>>>0,Y||T(S,I,this.length);let ge=this[S+--I],be=1;for(;I>0&&(be*=256);)ge+=this[S+--I]*be;return ge},f.prototype.readUint8=f.prototype.readUInt8=function(S,I){return S=S>>>0,I||T(S,1,this.length),this[S]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(S,I){return S=S>>>0,I||T(S,2,this.length),this[S]|this[S+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(S,I){return S=S>>>0,I||T(S,2,this.length),this[S]<<8|this[S+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(S,I){return S=S>>>0,I||T(S,4,this.length),(this[S]|this[S+1]<<8|this[S+2]<<16)+this[S+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(S,I){return S=S>>>0,I||T(S,4,this.length),this[S]*16777216+(this[S+1]<<16|this[S+2]<<8|this[S+3])},f.prototype.readBigUInt64LE=Yt(function(S){S=S>>>0,At(S,"offset");const I=this[S],Y=this[S+7];(I===void 0||Y===void 0)&&tt(S,this.length-8);const ge=I+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24,be=this[++S]+this[++S]*2**8+this[++S]*2**16+Y*2**24;return BigInt(ge)+(BigInt(be)<<BigInt(32))}),f.prototype.readBigUInt64BE=Yt(function(S){S=S>>>0,At(S,"offset");const I=this[S],Y=this[S+7];(I===void 0||Y===void 0)&&tt(S,this.length-8);const ge=I*2**24+this[++S]*2**16+this[++S]*2**8+this[++S],be=this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+Y;return(BigInt(ge)<<BigInt(32))+BigInt(be)}),f.prototype.readIntLE=function(S,I,Y){S=S>>>0,I=I>>>0,Y||T(S,I,this.length);let ge=this[S],be=1,Re=0;for(;++Re<I&&(be*=256);)ge+=this[S+Re]*be;return be*=128,ge>=be&&(ge-=Math.pow(2,8*I)),ge},f.prototype.readIntBE=function(S,I,Y){S=S>>>0,I=I>>>0,Y||T(S,I,this.length);let ge=I,be=1,Re=this[S+--ge];for(;ge>0&&(be*=256);)Re+=this[S+--ge]*be;return be*=128,Re>=be&&(Re-=Math.pow(2,8*I)),Re},f.prototype.readInt8=function(S,I){return S=S>>>0,I||T(S,1,this.length),this[S]&128?(255-this[S]+1)*-1:this[S]},f.prototype.readInt16LE=function(S,I){S=S>>>0,I||T(S,2,this.length);const Y=this[S]|this[S+1]<<8;return Y&32768?Y|4294901760:Y},f.prototype.readInt16BE=function(S,I){S=S>>>0,I||T(S,2,this.length);const Y=this[S+1]|this[S]<<8;return Y&32768?Y|4294901760:Y},f.prototype.readInt32LE=function(S,I){return S=S>>>0,I||T(S,4,this.length),this[S]|this[S+1]<<8|this[S+2]<<16|this[S+3]<<24},f.prototype.readInt32BE=function(S,I){return S=S>>>0,I||T(S,4,this.length),this[S]<<24|this[S+1]<<16|this[S+2]<<8|this[S+3]},f.prototype.readBigInt64LE=Yt(function(S){S=S>>>0,At(S,"offset");const I=this[S],Y=this[S+7];(I===void 0||Y===void 0)&&tt(S,this.length-8);const ge=this[S+4]+this[S+5]*2**8+this[S+6]*2**16+(Y<<24);return(BigInt(ge)<<BigInt(32))+BigInt(I+this[++S]*2**8+this[++S]*2**16+this[++S]*2**24)}),f.prototype.readBigInt64BE=Yt(function(S){S=S>>>0,At(S,"offset");const I=this[S],Y=this[S+7];(I===void 0||Y===void 0)&&tt(S,this.length-8);const ge=(I<<24)+this[++S]*2**16+this[++S]*2**8+this[++S];return(BigInt(ge)<<BigInt(32))+BigInt(this[++S]*2**24+this[++S]*2**16+this[++S]*2**8+Y)}),f.prototype.readFloatLE=function(S,I){return S=S>>>0,I||T(S,4,this.length),n.read(this,S,!0,23,4)},f.prototype.readFloatBE=function(S,I){return S=S>>>0,I||T(S,4,this.length),n.read(this,S,!1,23,4)},f.prototype.readDoubleLE=function(S,I){return S=S>>>0,I||T(S,8,this.length),n.read(this,S,!0,52,8)},f.prototype.readDoubleBE=function(S,I){return S=S>>>0,I||T(S,8,this.length),n.read(this,S,!1,52,8)};function m(H,S,I,Y,ge,be){if(!f.isBuffer(H))throw new TypeError('"buffer" argument must be a Buffer instance');if(S>ge||S<be)throw new RangeError('"value" argument is out of bounds');if(I+Y>H.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(S,I,Y,ge){if(S=+S,I=I>>>0,Y=Y>>>0,!ge){const ft=Math.pow(2,8*Y)-1;m(this,S,I,Y,ft,0)}let be=1,Re=0;for(this[I]=S&255;++Re<Y&&(be*=256);)this[I+Re]=S/be&255;return I+Y},f.prototype.writeUintBE=f.prototype.writeUIntBE=function(S,I,Y,ge){if(S=+S,I=I>>>0,Y=Y>>>0,!ge){const ft=Math.pow(2,8*Y)-1;m(this,S,I,Y,ft,0)}let be=Y-1,Re=1;for(this[I+be]=S&255;--be>=0&&(Re*=256);)this[I+be]=S/Re&255;return I+Y},f.prototype.writeUint8=f.prototype.writeUInt8=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,1,255,0),this[I]=S&255,I+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,2,65535,0),this[I]=S&255,this[I+1]=S>>>8,I+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,2,65535,0),this[I]=S>>>8,this[I+1]=S&255,I+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,4,4294967295,0),this[I+3]=S>>>24,this[I+2]=S>>>16,this[I+1]=S>>>8,this[I]=S&255,I+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,4,4294967295,0),this[I]=S>>>24,this[I+1]=S>>>16,this[I+2]=S>>>8,this[I+3]=S&255,I+4};function b(H,S,I,Y,ge){He(S,Y,ge,H,I,7);let be=Number(S&BigInt(4294967295));H[I++]=be,be=be>>8,H[I++]=be,be=be>>8,H[I++]=be,be=be>>8,H[I++]=be;let Re=Number(S>>BigInt(32)&BigInt(4294967295));return H[I++]=Re,Re=Re>>8,H[I++]=Re,Re=Re>>8,H[I++]=Re,Re=Re>>8,H[I++]=Re,I}function O(H,S,I,Y,ge){He(S,Y,ge,H,I,7);let be=Number(S&BigInt(4294967295));H[I+7]=be,be=be>>8,H[I+6]=be,be=be>>8,H[I+5]=be,be=be>>8,H[I+4]=be;let Re=Number(S>>BigInt(32)&BigInt(4294967295));return H[I+3]=Re,Re=Re>>8,H[I+2]=Re,Re=Re>>8,H[I+1]=Re,Re=Re>>8,H[I]=Re,I+8}f.prototype.writeBigUInt64LE=Yt(function(S,I=0){return b(this,S,I,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=Yt(function(S,I=0){return O(this,S,I,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(S,I,Y,ge){if(S=+S,I=I>>>0,!ge){const dt=Math.pow(2,8*Y-1);m(this,S,I,Y,dt-1,-dt)}let be=0,Re=1,ft=0;for(this[I]=S&255;++be<Y&&(Re*=256);)S<0&&ft===0&&this[I+be-1]!==0&&(ft=1),this[I+be]=(S/Re>>0)-ft&255;return I+Y},f.prototype.writeIntBE=function(S,I,Y,ge){if(S=+S,I=I>>>0,!ge){const dt=Math.pow(2,8*Y-1);m(this,S,I,Y,dt-1,-dt)}let be=Y-1,Re=1,ft=0;for(this[I+be]=S&255;--be>=0&&(Re*=256);)S<0&&ft===0&&this[I+be+1]!==0&&(ft=1),this[I+be]=(S/Re>>0)-ft&255;return I+Y},f.prototype.writeInt8=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,1,127,-128),S<0&&(S=255+S+1),this[I]=S&255,I+1},f.prototype.writeInt16LE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,2,32767,-32768),this[I]=S&255,this[I+1]=S>>>8,I+2},f.prototype.writeInt16BE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,2,32767,-32768),this[I]=S>>>8,this[I+1]=S&255,I+2},f.prototype.writeInt32LE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,4,2147483647,-2147483648),this[I]=S&255,this[I+1]=S>>>8,this[I+2]=S>>>16,this[I+3]=S>>>24,I+4},f.prototype.writeInt32BE=function(S,I,Y){return S=+S,I=I>>>0,Y||m(this,S,I,4,2147483647,-2147483648),S<0&&(S=4294967295+S+1),this[I]=S>>>24,this[I+1]=S>>>16,this[I+2]=S>>>8,this[I+3]=S&255,I+4},f.prototype.writeBigInt64LE=Yt(function(S,I=0){return b(this,S,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=Yt(function(S,I=0){return O(this,S,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function P(H,S,I,Y,ge,be){if(I+Y>H.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function ne(H,S,I,Y,ge){return S=+S,I=I>>>0,ge||P(H,S,I,4),n.write(H,S,I,Y,23,4),I+4}f.prototype.writeFloatLE=function(S,I,Y){return ne(this,S,I,!0,Y)},f.prototype.writeFloatBE=function(S,I,Y){return ne(this,S,I,!1,Y)};function ue(H,S,I,Y,ge){return S=+S,I=I>>>0,ge||P(H,S,I,8),n.write(H,S,I,Y,52,8),I+8}f.prototype.writeDoubleLE=function(S,I,Y){return ue(this,S,I,!0,Y)},f.prototype.writeDoubleBE=function(S,I,Y){return ue(this,S,I,!1,Y)},f.prototype.copy=function(S,I,Y,ge){if(!f.isBuffer(S))throw new TypeError("argument should be a Buffer");if(Y||(Y=0),!ge&&ge!==0&&(ge=this.length),I>=S.length&&(I=S.length),I||(I=0),ge>0&&ge<Y&&(ge=Y),ge===Y||S.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(Y<0||Y>=this.length)throw new RangeError("Index out of range");if(ge<0)throw new RangeError("sourceEnd out of bounds");ge>this.length&&(ge=this.length),S.length-I<ge-Y&&(ge=S.length-I+Y);const be=ge-Y;
vendor: 4,485 bytes, line 2
2return this===S&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,Y,ge):Uint8Array.prototype.set.call(S,this.subarray(Y,ge),I),be},f.prototype.fill=function(S,I,Y,ge){if(typeof S=="string"){if(typeof I=="string"?(ge=I,I=0,Y=this.length):typeof Y=="string"&&(ge=Y,Y=this.length),ge!==void 0&&typeof ge!="string")throw new TypeError("encoding must be a string");if(typeof ge=="string"&&!f.isEncoding(ge))throw new TypeError("Unknown encoding: "+ge);if(S.length===1){const Re=S.charCodeAt(0);(ge==="utf8"&&Re<128||ge==="latin1")&&(S=Re)}}else typeof S=="number"?S=S&255:typeof S=="boolean"&&(S=Number(S));if(I<0||this.length<I||this.length<Y)throw new RangeError("Out of range index");if(Y<=I)return this;I=I>>>0,Y=Y===void 0?this.length:Y>>>0,S||(S=0);let be;if(typeof S=="number")for(be=I;be<Y;++be)this[be]=S;else{const Re=f.isBuffer(S)?S:f.from(S,ge),ft=Re.length;if(ft===0)throw new TypeError('The value "'+S+'" is invalid for argument "value"');for(be=0;be<Y-I;++be)this[be+I]=Re[be%ft]}return this};const Te={};function ve(H,S,I){Te[H]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:S.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${H}]`,this.stack,delete this.name}get code(){return H}set code(ge){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ge,writable:!0})}toString(){return`${this.name} [${H}]: ${this.message}`}}}ve("ERR_BUFFER_OUT_OF_BOUNDS",function(H){return H?`${H} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ve("ERR_INVALID_ARG_TYPE",function(H,S){return`The "${H}" argument must be of type number. Received type ${typeof S}`},TypeError),ve("ERR_OUT_OF_RANGE",function(H,S,I){let Y=`The value of "${H}" is out of range.`,ge=I;return Number.isInteger(I)&&Math.abs(I)>2**32?ge=Xe(String(I)):typeof I=="bigint"&&(ge=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(ge=Xe(ge)),ge+="n"),Y+=` It must be ${S}. Received ${ge}`,Y},RangeError);function Xe(H){let S="",I=H.length;const Y=H[0]==="-"?1:0;for(;I>=Y+4;I-=3)S=`_${H.slice(I-3,I)}${S}`;return`${H.slice(0,I)}${S}`}function mt(H,S,I){At(S,"offset"),(H[S]===void 0||H[S+I]===void 0)&&tt(S,H.length-(I+1))}function He(H,S,I,Y,ge,be){if(H>I||H<S){const Re=typeof S=="bigint"?"n":"";let ft;throw S===0||S===BigInt(0)?ft=`>= 0${Re} and < 2${Re} ** ${(be+1)*8}${Re}`:ft=`>= -(2${Re} ** ${(be+1)*8-1}${Re}) and < 2 ** ${(be+1)*8-1}${Re}`,new Te.ERR_OUT_OF_RANGE("value",ft,H)}mt(Y,ge,be)}function At(H,S){if(typeof H!="number")throw new Te.ERR_INVALID_ARG_TYPE(S,"number",H)}function tt(H,S,I){throw Math.floor(H)!==H?(At(H,I),new Te.ERR_OUT_OF_RANGE("offset","an integer",H)):S<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${S}`,H)}const Rt=/[^+/0-9A-Za-z-_]/g;function qn(H){if(H=H.split("=")[0],H=H.trim().replace(Rt,""),H.length<2)return"";for(;H.length%4!==0;)H=H+"=";return H}function Bt(H,S){S=S||1/0;let I;const Y=H.length;let ge=null;const be=[];for(let Re=0;Re<Y;++Re){if(I=H.charCodeAt(Re),I>55295&&I<57344){if(!ge){if(I>56319){(S-=3)>-1&&be.push(239,191,189);continue}else if(Re+1===Y){(S-=3)>-1&&be.push(239,191,189);continue}ge=I;continue}if(I<56320){(S-=3)>-1&&be.push(239,191,189),ge=I;continue}I=(ge-55296<<10|I-56320)+65536}else ge&&(S-=3)>-1&&be.push(239,191,189);if(ge=null,I<128){if((S-=1)<0)break;be.push(I)}else if(I<2048){if((S-=2)<0)break;be.push(I>>6|192,I&63|128)}else if(I<65536){if((S-=3)<0)break;be.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((S-=4)<0)break;be.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return be}function Ze(H){const S=[];for(let I=0;I<H.length;++I)S.push(H.charCodeAt(I)&255);return S}function an(H,S){let I,Y,ge;const be=[];for(let Re=0;Re<H.length&&!((S-=2)<0);++Re)I=H.charCodeAt(Re),Y=I>>8,ge=I%256,be.push(ge),be.push(Y);return be}function jt(H){return t.toByteArray(qn(H))}function Lt(H,S,I,Y){let ge;for(ge=0;ge<Y&&!(ge+I>=S.length||ge>=H.length);++ge)S[ge+I]=H[ge];return ge}function jn(H,S){return H instanceof S||H!=null&&H.constructor!=null&&H.constructor.name!=null&&H.constructor.name===S.name}function Fe(H){return H!==H}const qe=(function(){const H="0123456789abcdef",S=new Array(256);for(let I=0;I<16;++I){const Y=I*16;for(let ge=0;ge<16;++ge)S[Y+ge]=H[I]+H[ge]}return S})();function Yt(H){return typeof BigInt>"u"?Wt:H}function Wt(){throw new Error("BigInt not supported")}})(tp)),tp}
vendor: 19,898 bytes, lines 2-4
2var Tt=e1(),np={exports:{}},kt={};var Pb;function i5(){if(Pb)return kt;Pb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),A=Symbol.for("react.activity"),D=Symbol.iterator;function U(T){return T===null||typeof T!="object"?null:(T=D&&T[D]||T["@@iterator"],typeof T=="function"?T:null)}var L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,j={};function M(T,m,b){this.props=T,this.context=m,this.refs=j,this.updater=b||L}M.prototype.isReactComponent={},M.prototype.setState=function(T,m){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,m,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function W(){}W.prototype=M.prototype;function K(T,m,b){this.props=T,this.context=m,this.refs=j,this.updater=b||L}var se=K.prototype=new W;se.constructor=K,k(se,M.prototype),se.isPureReactComponent=!0;var re=Array.isArray;function te(){}var pe={H:null,A:null,T:null,S:null},we=Object.prototype.hasOwnProperty;function X(T,m,b){var O=b.ref;return{$$typeof:e,type:T,key:m,ref:O!==void 0?O:null,props:b}}function Z(T,m){return X(T.type,m,T.props)}function ae(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function ce(T){var m={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(b){return m[b]})}var N=/\/+/g;function g(T,m){return typeof T=="object"&&T!==null&&T.key!=null?ce(""+T.key):m.toString(36)}function v(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(te,te):(T.status="pending",T.then(function(m){T.status==="pending"&&(T.status="fulfilled",T.value=m)},function(m){T.status==="pending"&&(T.status="rejected",T.reason=m)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function E(T,m,b,O,P){var ne=typeof T;(ne==="undefined"||ne==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(ne){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case e:case t:ue=!0;break;case _:return ue=T._init,E(ue(T._payload),m,b,O,P)}}if(ue)return P=P(T),ue=O===""?"."+g(T,0):O,re(P)?(b="",ue!=null&&(b=ue.replace(N,"$&/")+"/"),E(P,m,b,"",function(Xe){return Xe})):P!=null&&(ae(P)&&(P=Z(P,b+(P.key==null||T&&T.key===P.key?"":(""+P.key).replace(N,"$&/")+"/")+ue)),m.push(P)),1;ue=0;var Te=O===""?".":O+":";if(re(T))for(var ve=0;ve<T.length;ve++)O=T[ve],ne=Te+g(O,ve),ue+=E(O,m,b,ne,P);else if(ve=U(T),typeof ve=="function")for(T=ve.call(T),ve=0;!(O=T.next()).done;)O=O.value,ne=Te+g(O,ve++),ue+=E(O,m,b,ne,P);else if(ne==="object"){if(typeof T.then=="function")return E(v(T),m,b,O,P);throw m=String(T),Error("Objects are not valid as a React child (found: "+(m==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":m)+"). If you meant to render a collection of children, use an array instead.")}return ue}function B(T,m,b){if(T==null)return T;var O=[],P=0;return E(T,O,"","",function(ne){return m.call(b,ne,P++)}),O}function z(T){if(T._status===-1){var m=T._result;m=m(),m.then(function(b){(T._status===0||T._status===-1)&&(T._status=1,T._result=b)},function(b){(T._status===0||T._status===-1)&&(T._status=2,T._result=b)}),T._status===-1&&(T._status=0,T._result=m)}if(T._status===1)return T._result.default;throw T._result}var G=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var m=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(m))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},J={map:B,forEach:function(T,m,b){B(T,function(){m.apply(this,arguments)},b)},count:function(T){var m=0;return B(T,function(){m++}),m},toArray:function(T){return B(T,function(m){return m})||[]},only:function(T){if(!ae(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return kt.Activity=A,kt.Children=J,kt.Component=M,kt.Fragment=n,kt.Profiler=o,kt.PureComponent=K,kt.StrictMode=i,kt.Suspense=h,kt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=pe,kt.__COMPILER_RUNTIME={__proto__:null,c:function(T){return pe.H.useMemoCache(T)}},kt.cache=function(T){return function(){return T.apply(null,arguments)}},kt.cacheSignal=function(){return null},kt.cloneElement=function(T,m,b){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var O=k({},T.props),P=T.key;if(m!=null)for(ne in m.key!==void 0&&(P=""+m.key),m)!we.call(m,ne)||ne==="key"||ne==="__self"||ne==="__source"||ne==="ref"&&m.ref===void 0||(O[ne]=m[ne]);var ne=arguments.length-2;if(ne===1)O.children=b;else if(1<ne){for(var ue=Array(ne),Te=0;Te<ne;Te++)ue[Te]=arguments[Te+2];O.children=ue}return X(T.type,P,O)},kt.createContext=function(T){return T={$$typeof:u,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:l,_context:T},T},kt.createElement=function(T,m,b){var O,P={},ne=null;if(m!=null)for(O in m.key!==void 0&&(ne=""+m.key),m)we.call(m,O)&&O!=="key"&&O!=="__self"&&O!=="__source"&&(P[O]=m[O]);var ue=arguments.length-2;if(ue===1)P.children=b;else if(1<ue){for(var Te=Array(ue),ve=0;ve<ue;ve++)Te[ve]=arguments[ve+2];P.children=Te}if(T&&T.defaultProps)for(O in ue=T.defaultProps,ue)P[O]===void 0&&(P[O]=ue[O]);return X(T,ne,P)},kt.createRef=function(){return{current:null}},kt.forwardRef=function(T){return{$$typeof:f,render:T}},kt.isValidElement=ae,kt.lazy=function(T){return{$$typeof:_,_payload:{_status:-1,_result:T},_init:z}},kt.memo=function(T,m){return{$$typeof:y,type:T,compare:m===void 0?null:m}},kt.startTransition=function(T){var m=pe.T,b={};pe.T=b;try{var O=T(),P=pe.S;P!==null&&P(b,O),typeof O=="object"&&O!==null&&typeof O.then=="function"&&O.then(te,G)}catch(ne){G(ne)}finally{m!==null&&b.types!==null&&(m.types=b.types),pe.T=m}},kt.unstable_useCacheRefresh=function(){return pe.H.useCacheRefresh()},kt.use=function(T){return pe.H.use(T)},kt.useActionState=function(T,m,b){return pe.H.useActionState(T,m,b)},kt.useCallback=function(T,m){return pe.H.useCallback(T,m)},kt.useContext=function(T){return pe.H.useContext(T)},kt.useDebugValue=function(){},kt.useDeferredValue=function(T,m){return pe.H.useDeferredValue(T,m)},kt.useEffect=function(T,m){return pe.H.useEffect(T,m)},kt.useEffectEvent=function(T){return pe.H.useEffectEvent(T)},kt.useId=function(){return pe.H.useId()},kt.useImperativeHandle=function(T,m,b){return pe.H.useImperativeHandle(T,m,b)},kt.useInsertionEffect=function(T,m){return pe.H.useInsertionEffect(T,m)},kt.useLayoutEffect=function(T,m){return pe.H.useLayoutEffect(T,m)},kt.useMemo=function(T,m){return pe.H.useMemo(T,m)},kt.useOptimistic=function(T,m){return pe.H.useOptimistic(T,m)},kt.useReducer=function(T,m,b){return pe.H.useReducer(T,m,b)},kt.useRef=function(T){return pe.H.useRef(T)},kt.useState=function(T){return pe.H.useState(T)},kt.useSyncExternalStore=function(T,m,b){return pe.H.useSyncExternalStore(T,m,b)},kt.useTransition=function(){return pe.H.useTransition()},kt.version="19.2.4",kt}var Hb;function t1(){return Hb||(Hb=1,np.exports=i5()),np.exports}var Me=t1();const iE=Xc(Me);var rp={exports:{}},wc={},ip={exports:{}},sp={};var Vb;function s5(){return Vb||(Vb=1,(function(e){function t(E,B){var z=E.length;E.push(B);e:for(;0<z;){var G=z-1>>>1,J=E[G];if(0<o(J,B))E[G]=B,E[z]=J,z=G;else break e}}function n(E){return E.length===0?null:E[0]}function i(E){if(E.length===0)return null;var B=E[0],z=E.pop();if(z!==B){E[0]=z;e:for(var G=0,J=E.length,T=J>>>1;G<T;){var m=2*(G+1)-1,b=E[m],O=m+1,P=E[O];if(0>o(b,z))O<J&&0>o(P,b)?(E[G]=P,E[O]=z,G=O):(E[G]=b,E[m]=z,G=m);else if(O<J&&0>o(P,z))E[G]=P,E[O]=z,G=O;else break e}}return B}function o(E,B){var z=E.sortIndex-B.sortIndex;return z!==0?z:E.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],y=[],_=1,A=null,D=3,U=!1,L=!1,k=!1,j=!1,M=typeof setTimeout=="function"?setTimeout:null,W=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function se(E){for(var B=n(y);B!==null;){if(B.callback===null)i(y);else if(B.startTime<=E)i(y),B.sortIndex=B.expirationTime,t(h,B);else break;B=n(y)}}function re(E){if(k=!1,se(E),!L)if(n(h)!==null)L=!0,te||(te=!0,ce());else{var B=n(y);B!==null&&v(re,B.startTime-E)}}var te=!1,pe=-1,we=5,X=-1;function Z(){return j?!0:!(e.unstable_now()-X<we)}function ae(){if(j=!1,te){var E=e.unstable_now();X=E;var B=!0;try{e:{L=!1,k&&(k=!1,W(pe),pe=-1),U=!0;var z=D;try{t:{for(se(E),A=n(h);A!==null&&!(A.expirationTime>E&&Z());){var G=A.callback;if(typeof G=="function"){A.callback=null,D=A.priorityLevel;var J=G(A.expirationTime<=E);if(E=e.unstable_now(),typeof J=="function"){A.callback=J,se(E),B=!0;break t}A===n(h)&&i(h),se(E)}else i(h);A=n(h)}if(A!==null)B=!0;else{var T=n(y);T!==null&&v(re,T.startTime-E),B=!1}}break e}finally{A=null,D=z,U=!1}B=void 0}}finally{B?ce():te=!1}}}var ce;if(typeof K=="function")ce=function(){K(ae)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,g=N.port2;N.port1.onmessage=ae,ce=function(){g.postMessage(null)}}else ce=function(){M(ae,0)};function v(E,B){pe=M(function(){E(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):we=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return D},e.unstable_next=function(E){switch(D){case 1:case 2:case 3:var B=3;break;default:B=D}var z=D;D=B;try{return E()}finally{D=z}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(E,B){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var z=D;D=E;try{return B()}finally{D=z}},e.unstable_scheduleCallback=function(E,B,z){var G=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?G+z:G):z=G,E){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=z+J,E={id:_++,callback:B,priorityLevel:E,startTime:z,expirationTime:J,sortIndex:-1},z>G?(E.sortIndex=z,t(y,E),n(h)===null&&E===n(y)&&(k?(W(pe),pe=-1):k=!0,v(re,z-G))):(E.sortIndex=J,t(h,E),L||U||(L=!0,te||(te=!0,ce()))),E},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(E){var B=D;return function(){var z=D;D=B;try{return E.apply(this,arguments)}finally{D=z}}}})(sp)),sp}var Fb;function a5(){return Fb||(Fb=1,ip.exports=s5()),ip.exports}var ap={exports:{}},Tr={};var Kb;function o5(){if(Kb)return Tr;Kb=1;var e=t1();function t(h){var y="https://react.dev/errors/"+h;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)y+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+h+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,y,_){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:A==null?null:""+A,children:h,containerInfo:y,implementation:_}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,y){if(h==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Tr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Tr.createPortal=function(h,y){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(t(299));return l(h,y,null,_)},Tr.flushSync=function(h){var y=u.T,_=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=y,i.p=_,i.d.f()}},Tr.preconnect=function(h,y){typeof h=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,i.d.C(h,y))},Tr.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},Tr.preinit=function(h,y){if(typeof h=="string"&&y&&typeof y.as=="string"){var _=y.as,A=f(_,y.crossOrigin),D=typeof y.integrity=="string"?y.integrity:void 0,U=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;_==="style"?i.d.S(h,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:A,integrity:D,fetchPriority:U}):_==="script"&&i.d.X(h,{crossOrigin:A,integrity:D,fetchPriority:U,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Tr.preinitModule=function(h,y){if(typeof h=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var _=f(y.as,y.crossOrigin);i.d.M(h,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&i.d.M(h)},Tr.preload=function(h,y){if(typeof h=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var _=y.as,A=f(_,y.crossOrigin);i.d.L(h,_,{crossOrigin:A,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Tr.preloadModule=function(h,y){if(typeof h=="string")if(y){var _=f(y.as,y.crossOrigin);i.d.m(h,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else i.d.m(h)},Tr.requestFormReset=function(h){i.d.r(h)},Tr.unstable_batchedUpdates=function(h,y){return h(y)},Tr.useFormState=function(h,y,_){return u.H.useFormState(h,y,_)},Tr.useFormStatus=function(){return u.H.useHostTransitionStatus()},Tr.version="19.2.4",Tr}var qb;function sE(){if(qb)return ap.exports;qb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ap.exports=o5(),ap.exports}var $b;function l5(){if($b)return wc;$b=1;var e=a5(),t=t1(),n=sE();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function u(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function h(r){if(l(r)!==r)throw Error(i(188))}function y(r){var s=r.alternate;if(!s){if(s=l(r),s===null)throw Error(i(188));return s!==r?null:r}for(var a=r,c=s;;){var d=a.return;if(d===null)break;var p=d.alternate;if(p===null){if(c=d.return,c!==null){a=c;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===a)return h(d),r;if(p===c)return h(d),s;p=p.sibling}throw Error(i(188))}if(a.return!==c.return)a=d,c=p;else{for(var R=!1,q=d.child;q;){if(q===a){R=!0,a=d,c=p;break}if(q===c){R=!0,c=d,a=p;break}q=q.sibling}if(!R){for(q=p.child;q;){if(q===a){R=!0,a=p,c=d;break}if(q===c){R=!0,c=p,a=d;break}q=q.sibling}if(!R)throw Error(i(189))}}if(a.alternate!==c)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?r:s}function _(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=_(r),s!==null)return s;r=r.sibling}return null}var A=Object.assign,D=Symbol.for("react.element"),U=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),K=Symbol.for("react.context"),se=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),pe=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),ae=Symbol.iterator;function ce(r){return r===null||typeof r!="object"?null:(r=ae&&r[ae]||r["@@iterator"],typeof r=="function"?r:null)}var N=Symbol.for("react.client.reference");function g(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===N?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case k:return"Fragment";case M:return"Profiler";case j:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case X:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case L:return"Portal";case K:return r.displayName||"Context";case W:return(r._context.displayName||"Context")+".Consumer";case se:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case pe:return s=r.displayName||null,s!==null?s:g(r.type)||"Memo";case we:s=r._payload,r=r._init;try{return g(r(s))}catch{}}return null}var v=Array.isArray,E=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},G=[],J=-1;function T(r){return{current:r}}function m(r){0>J||(r.current=G[J],G[J]=null,J--)}function b(r,s){J++,G[J]=r.current,r.current=s}var O=T(null),P=T(null),ne=T(null),ue=T(null);function Te(r,s){switch(b(ne,s),b(P,r),b(O,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?ib(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=ib(s),r=sb(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}m(O),b(O,r)}function ve(){m(O),m(P),m(ne)}function Xe(r){r.memoizedState!==null&&b(ue,r);var s=O.current,a=sb(s,r.type);s!==a&&(b(P,r),b(O,a))}function mt(r){P.current===r&&(m(O),m(P)),ue.current===r&&(m(ue),dc._currentValue=z)}var He,At;function tt(r){if(He===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);He=s&&s[1]||"",At=-1<a.stack.indexOf(` 3 at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return` 4`+He+r+At}var Rt=!1;function qn(r,s){if(!r||Rt)return"";Rt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var je=function(){throw Error()};if(Object.defineProperty(je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(je,[])}catch(De){var Se=De}Reflect.construct(r,[],je)}
vendor: 6,659 bytes, lines 4-9
4else{try{je.call()}catch(De){Se=De}r.call(je.prototype)}}else{try{throw Error()}catch(De){Se=De}(je=r())&&typeof je.catch=="function"&&je.catch(function(){})}}catch(De){if(De&&Se&&typeof De.stack=="string")return[De.stack,Se.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),R=p[0],q=p[1];if(R&&q){var oe=R.split(` 5`),Ee=q.split(` 6`);for(d=c=0;c<oe.length&&!oe[c].includes("DetermineComponentFrameRoot");)c++;for(;d<Ee.length&&!Ee[d].includes("DetermineComponentFrameRoot");)d++;if(c===oe.length||d===Ee.length)for(c=oe.length-1,d=Ee.length-1;1<=c&&0<=d&&oe[c]!==Ee[d];)d--;for(;1<=c&&0<=d;c--,d--)if(oe[c]!==Ee[d]){if(c!==1||d!==1)do if(c--,d--,0>d||oe[c]!==Ee[d]){var Oe=` 7`+oe[c].replace(" at new "," at ");return r.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",r.displayName)),Oe}while(1<=c&&0<=d);break}}}finally{Rt=!1,Error.prepareStackTrace=a}return(a=r?r.displayName||r.name:"")?tt(a):""}function Bt(r,s){switch(r.tag){case 26:case 27:case 5:return tt(r.type);case 16:return tt("Lazy");case 13:return r.child!==s&&s!==null?tt("Suspense Fallback"):tt("Suspense");case 19:return tt("SuspenseList");case 0:case 15:return qn(r.type,!1);case 11:return qn(r.type.render,!1);case 1:return qn(r.type,!0);case 31:return tt("Activity");default:return""}}function Ze(r){try{var s="",a=null;do s+=Bt(r,a),a=r,r=r.return;while(r);return s}catch(c){return` 8Error generating stack: `+c.message+` 9`+c.stack}}var an=Object.prototype.hasOwnProperty,jt=e.unstable_scheduleCallback,Lt=e.unstable_cancelCallback,jn=e.unstable_shouldYield,Fe=e.unstable_requestPaint,qe=e.unstable_now,Yt=e.unstable_getCurrentPriorityLevel,Wt=e.unstable_ImmediatePriority,H=e.unstable_UserBlockingPriority,S=e.unstable_NormalPriority,I=e.unstable_LowPriority,Y=e.unstable_IdlePriority,ge=e.log,be=e.unstable_setDisableYieldValue,Re=null,ft=null;function dt(r){if(typeof ge=="function"&&be(r),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Re,r)}catch{}}var rt=Math.clz32?Math.clz32:gn,Zt=Math.log,pt=Math.LN2;function gn(r){return r>>>=0,r===0?32:31-(Zt(r)/pt|0)|0}var Di=256,vn=262144,In=4194304;function yi(r){var s=r&42;if(s!==0)return s;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function on(r,s,a){var c=r.pendingLanes;if(c===0)return 0;var d=0,p=r.suspendedLanes,R=r.pingedLanes;r=r.warmLanes;var q=c&134217727;return q!==0?(c=q&~p,c!==0?d=yi(c):(R&=q,R!==0?d=yi(R):a||(a=q&~r,a!==0&&(d=yi(a))))):(q=c&~p,q!==0?d=yi(q):R!==0?d=yi(R):a||(a=c&~r,a!==0&&(d=yi(a)))),d===0?0:s!==0&&s!==d&&(s&p)===0&&(p=d&-d,a=s&-s,p>=a||p===32&&(a&4194048)!==0)?s:d}function un(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Oi(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tn(){var r=In;return In<<=1,(In&62914560)===0&&(In=4194304),r}function xn(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Ni(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Ln(r,s,a,c,d,p){var R=r.pendingLanes;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=a,r.entangledLanes&=a,r.errorRecoveryDisabledLanes&=a,r.shellSuspendCounter=0;var q=r.entanglements,oe=r.expirationTimes,Ee=r.hiddenUpdates;for(a=R&~a;0<a;){var Oe=31-rt(a),je=1<<Oe;q[Oe]=0,oe[Oe]=-1;var Se=Ee[Oe];if(Se!==null)for(Ee[Oe]=null,Oe=0;Oe<Se.length;Oe++){var De=Se[Oe];De!==null&&(De.lane&=-536870913)}a&=~je}c!==0&&Xt(r,c,0),p!==0&&d===0&&r.tag!==0&&(r.suspendedLanes|=p&~(R&~s))}function Xt(r,s,a){r.pendingLanes|=s,r.suspendedLanes&=~s;var c=31-rt(s);r.entangledLanes|=s,r.entanglements[c]=r.entanglements[c]|1073741824|a&261930}function Os(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var c=31-rt(a),d=1<<c;d&s|r[c]&s&&(r[c]|=s),a&=~d}}function C(r,s){var a=s&-s;return a=(a&42)!==0?1:V(a),(a&(r.suspendedLanes|s))!==0?0:a}function V(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function F(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function x(){var r=B.p;return r!==0?r:(r=window.event,r===void 0?32:Rb(r.type))}function $(r,s){var a=B.p;try{return B.p=r,s()}finally{B.p=a}}var me=Math.random().toString(36).slice(2),he="__reactFiber$"+me,Ie="__reactProps$"+me,Ve="__reactContainer$"+me,$e="__reactEvents$"+me,Ke="__reactListeners$"+me,Gt="__reactHandles$"+me,et="__reactResources$"+me,gt="__reactMarker$"+me;function xt(r){delete r[he],delete r[Ie],delete r[$e],delete r[Ke],delete r[Gt]}function _t(r){var s=r[he];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Ve]||a[he]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=db(r);r!==null;){if(a=r[he])return a;r=db(r)}return s}r=a,a=r.parentNode}return null}function Et(r){if(r=r[he]||r[Ve]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function yt(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function wt(r){var s=r[et];return s||(s=r[et]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function st(r){r[gt]=!0}var nt=new Set,ut={};function Ge(r,s){Qe(r,s),Qe(r+"Capture",s)}function Qe(r,s){for(ut[r]=s,r=0;r<s.length;r++)nt.add(s[r])}var at=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u
9037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ye={},Ce={};function Be(r){return an.call(Ce,r)?!0:an.call(Ye,r)?!1:at.test(r)?Ce[r]=!0:(Ye[r]=!0,!1)}function Le(r,s,a){if(Be(s))if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+a)}}function Ne(r,s,a){if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+a)}}function ke(r,s,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttributeNS(s,a,""+c)}}function ze(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function bt(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Nt(r,s,a){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var d=c.get,p=c.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return d.call(this)},set:function(R){a=""+R,p.call(this,R)}}),Object.defineProperty(r,s,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(R){a=""+R},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Dt(r){if(!r._valueTracker){var s=bt(r)?"checked":"value";r._valueTracker=Nt(r,s,""+r[s])}}function Ot(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),c="";return r&&(c=bt(r)?r.checked?"true":"false":r.value),r=c,r!==a?(s.setValue(r),!0):!1}function ie(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Ht=/[\n"\\]/g;function Mt(r){return r.replace(Ht,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}
vendor: 4,390 bytes, line 9
9function Qt(r,s,a,c,d,p,R,q){r.name="",R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?r.type=R:r.removeAttribute("type"),s!=null?R==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+ze(s)):r.value!==""+ze(s)&&(r.value=""+ze(s)):R!=="submit"&&R!=="reset"||r.removeAttribute("value"),s!=null?Jt(r,R,ze(s)):a!=null?Jt(r,R,ze(a)):c!=null&&r.removeAttribute("value"),d==null&&p!=null&&(r.defaultChecked=!!p),d!=null&&(r.checked=d&&typeof d!="function"&&typeof d!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?r.name=""+ze(q):r.removeAttribute("name")}function zt(r,s,a,c,d,p,R,q){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(r.type=p),s!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){Dt(r);return}a=a!=null?""+ze(a):"",s=s!=null?""+ze(s):a,q||s===r.value||(r.value=s),r.defaultValue=s}c=c??d,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=q?r.checked:!!c,r.defaultChecked=!!c,R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(r.name=R),Dt(r)}function Jt(r,s,a){s==="number"&&ie(r.ownerDocument)===r||r.defaultValue===""+a||(r.defaultValue=""+a)}function Vt(r,s,a,c){if(r=r.options,s){s={};for(var d=0;d<a.length;d++)s["$"+a[d]]=!0;for(a=0;a<r.length;a++)d=s.hasOwnProperty("$"+r[a].value),r[a].selected!==d&&(r[a].selected=d),d&&c&&(r[a].defaultSelected=!0)}else{for(a=""+ze(a),s=null,d=0;d<r.length;d++){if(r[d].value===a){r[d].selected=!0,c&&(r[d].defaultSelected=!0);return}s!==null||r[d].disabled||(s=r[d])}s!==null&&(s.selected=!0)}}function zn(r,s,a){if(s!=null&&(s=""+ze(s),s!==r.value&&(r.value=s),a==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=a!=null?""+ze(a):""}function fn(r,s,a,c){if(s==null){if(c!=null){if(a!=null)throw Error(i(92));if(v(c)){if(1<c.length)throw Error(i(93));c=c[0]}a=c}a==null&&(a=""),s=a}a=ze(s),r.defaultValue=a,c=r.textContent,c===a&&c!==""&&c!==null&&(r.value=c),Dt(r)}function mn(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Pn=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function On(r,s,a){var c=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":c?r.setProperty(s,a):typeof a!="number"||a===0||Pn.has(s)?s==="float"?r.cssFloat=a:r[s]=(""+a).trim():r[s]=a+"px"}function $n(r,s,a){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var d in s)c=s[d],s.hasOwnProperty(d)&&a[d]!==c&&On(r,d,c)}else for(var p in s)s.hasOwnProperty(p)&&On(r,p,s[p])}function rr(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
9dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),dr=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function hu(r){return dr.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function ns(){}var Jd=null;function Xd(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var go=null,mo=null;function rm(r){var s=Et(r);if(s&&(r=s.stateNode)){var a=r[Ie]||null;e:switch(r=s.stateNode,s.type){case"input":if(Qt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Mt(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var c=a[s];if(c!==r&&c.form===r.form){var d=c[Ie]||null;if(!d)throw Error(i(90));Qt(c,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(s=0;s<a.length;s++)c=a[s],c.form===r.form&&Ot(c)}break e;case"textarea":zn(r,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&Vt(r,!!a.multiple,s,!1)}}}var Qd=!1;function im(r,s,a){if(Qd)return r(s,a);Qd=!0;try{var c=r(s);return c}finally{if(Qd=!1,(go!==null||mo!==null)&&(ef(),go&&(s=go,r=mo,mo=go=null,rm(s),r)))for(s=0;s<r.length;s++)rm(r[s])}}function Cl(r,s){var a=r.stateNode;if(a===null)return null;var c=a[Ie]||null;if(c===null)return null;a=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(i(231,s,typeof a));return a}var rs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eh=!1;if(rs)try{var Ml={};Object.defineProperty(Ml,"passive",{get:function(){eh=!0}}),window.addEventListener("test",Ml,Ml),window.removeEventListener("test",Ml,Ml)}catch{eh=!1}var Ns=null,th=null,pu=null;
vendor: 5,478 bytes, line 9
9function sm(){if(pu)return pu;var r,s=th,a=s.length,c,d="value"in Ns?Ns.value:Ns.textContent,p=d.length;for(r=0;r<a&&s[r]===d[r];r++);var R=a-r;for(c=1;c<=R&&s[a-c]===d[p-c];c++);return pu=d.slice(r,1<c?1-c:void 0)}function gu(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function mu(){return!0}function am(){return!1}function Gr(r){function s(a,c,d,p,R){this._reactName=a,this._targetInst=d,this.type=c,this.nativeEvent=p,this.target=R,this.currentTarget=null;for(var q in r)r.hasOwnProperty(q)&&(a=r[q],this[q]=a?a(p):p[q]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?mu:am,this.isPropagationStopped=am,this}return A(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=mu)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=mu)},persist:function(){},isPersistent:mu}),s}var Ia={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yu=Gr(Ia),Bl=A({},Ia,{view:0,detail:0}),X6=Gr(Bl),nh,rh,Dl,wu=A({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sh,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Dl&&(Dl&&r.type==="mousemove"?(nh=r.screenX-Dl.screenX,rh=r.screenY-Dl.screenY):rh=nh=0,Dl=r),nh)},movementY:function(r){return"movementY"in r?r.movementY:rh}}),om=Gr(wu),Q6=A({},wu,{dataTransfer:0}),eS=Gr(Q6),tS=A({},Bl,{relatedTarget:0}),ih=Gr(tS),nS=A({},Ia,{animationName:0,elapsedTime:0,pseudoElement:0}),rS=Gr(nS),iS=A({},Ia,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),sS=Gr(iS),aS=A({},Ia,{data:0}),lm=Gr(aS),oS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},cS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uS(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=cS[r])?!!s[r]:!1}function sh(){return uS}var fS=A({},Bl,{key:function(r){if(r.key){var s=oS[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=gu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?lS[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sh,charCode:function(r){return r.type==="keypress"?gu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?gu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),dS=Gr(fS),hS=A({},wu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cm=Gr(hS),pS=A({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sh}),gS=Gr(pS),mS=A({},Ia,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=Gr(mS),wS=A({},wu,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),bS=Gr(wS),vS=A({},Ia,{newState:0,oldState:0}),xS=Gr(vS),ES=[9,13,27,32],ah=rs&&"CompositionEvent"in window,Ol=null;rs&&"documentMode"in document&&(Ol=document.documentMode);var SS=rs&&"TextEvent"in window&&!Ol,um=rs&&(!ah||Ol&&8<Ol&&11>=Ol),fm=" ",dm=!1;function hm(r,s){switch(r){case"keyup":return ES.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pm(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var yo=!1;function AS(r,s){switch(r){case"compositionend":return pm(s);case"keypress":return s.which!==32?null:(dm=!0,fm);case"textInput":return r=s.data,r===fm&&dm?null:r;default:return null}}function _S(r,s){if(yo)return r==="compositionend"||!ah&&hm(r,s)?(r=sm(),pu=th=Ns=null,yo=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return um&&s.locale!=="ko"?null:s.data;default:return null}}var IS={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gm(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!IS[r.type]:s==="textarea"}
vendor: 5,650 bytes, line 9
9function mm(r,s,a,c){go?mo?mo.push(c):mo=[c]:go=c,s=lf(s,"onChange"),0<s.length&&(a=new yu("onChange","change",null,a,c),r.push({event:a,listeners:s}))}var Nl=null,kl=null;function TS(r){Xw(r,0)}function bu(r){var s=yt(r);if(Ot(s))return r}function ym(r,s){if(r==="change")return s}var wm=!1;if(rs){var oh;if(rs){var lh="oninput"in document;if(!lh){var bm=document.createElement("div");bm.setAttribute("oninput","return;"),lh=typeof bm.oninput=="function"}oh=lh}else oh=!1;wm=oh&&(!document.documentMode||9<document.documentMode)}function vm(){Nl&&(Nl.detachEvent("onpropertychange",xm),kl=Nl=null)}function xm(r){if(r.propertyName==="value"&&bu(kl)){var s=[];mm(s,kl,r,Xd(r)),im(TS,s)}}function RS(r,s,a){r==="focusin"?(vm(),Nl=s,kl=a,Nl.attachEvent("onpropertychange",xm)):r==="focusout"&&vm()}function CS(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return bu(kl)}function MS(r,s){if(r==="click")return bu(s)}function BS(r,s){if(r==="input"||r==="change")return bu(s)}function DS(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var si=typeof Object.is=="function"?Object.is:DS;function Ul(r,s){if(si(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),c=Object.keys(s);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var d=a[c];if(!an.call(s,d)||!si(r[d],s[d]))return!1}return!0}function Em(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Sm(r,s){var a=Em(r);r=0;for(var c;a;){if(a.nodeType===3){if(c=r+a.textContent.length,r<=s&&c>=s)return{node:a,offset:s-r};r=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Em(a)}}function Am(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Am(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function _m(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=ie(r.document);s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=ie(r.document)}return s}function ch(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var OS=rs&&"documentMode"in document&&11>=document.documentMode,wo=null,uh=null,jl=null,fh=!1;function Im(r,s,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;fh||wo==null||wo!==ie(c)||(c=wo,"selectionStart"in c&&ch(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),jl&&Ul(jl,c)||(jl=c,c=lf(uh,"onSelect"),0<c.length&&(s=new yu("onSelect","select",null,s,a),r.push({event:s,listeners:c}),s.target=wo)))}function Ta(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var bo={animationend:Ta("Animation","AnimationEnd"),animationiteration:Ta("Animation","AnimationIteration"),animationstart:Ta("Animation","AnimationStart"),transitionrun:Ta("Transition","TransitionRun"),transitionstart:Ta("Transition","TransitionStart"),transitioncancel:Ta("Transition","TransitionCancel"),transitionend:Ta("Transition","TransitionEnd")},dh={},Tm={};rs&&(Tm=document.createElement("div").style,"AnimationEvent"in window||(delete bo.animationend.animation,delete bo.animationiteration.animation,delete bo.animationstart.animation),"TransitionEvent"in window||delete bo.transitionend.transition);function Ra(r){if(dh[r])return dh[r];if(!bo[r])return r;var s=bo[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in Tm)return dh[r]=s[a];return r}var Rm=Ra("animationend"),Cm=Ra("animationiteration"),Mm=Ra("animationstart"),NS=Ra("transitionrun"),kS=Ra("transitionstart"),US=Ra("transitioncancel"),Bm=Ra("transitionend"),Dm=new Map,hh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hh.push("scrollEnd");function ki(r,s){Dm.set(r,s),Ge(s,[r])}var vu=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},wi=[],vo=0,ph=0;function xu(){for(var r=vo,s=ph=vo=0;s<r;){var a=wi[s];wi[s++]=null;var c=wi[s];wi[s++]=null;var d=wi[s];wi[s++]=null;var p=wi[s];if(wi[s++]=null,c!==null&&d!==null){var R=c.pending;R===null?d.next=d:(d.next=R.next,R.next=d),c.pending=d}p!==0&&Om(a,d,p)}}function Eu(r,s,a,c){wi[vo++]=r,wi[vo++]=s,wi[vo++]=a,wi[vo++]=c,ph|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function gh(r,s,a,c){return Eu(r,s,a,c),Su(r)}function Ca(r,s){return Eu(r,null,null,s),Su(r)}
vendor: 2,117 bytes, line 9
9function Om(r,s,a){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a);for(var d=!1,p=r.return;p!==null;)p.childLanes|=a,c=p.alternate,c!==null&&(c.childLanes|=a),p.tag===22&&(r=p.stateNode,r===null||r._visibility&1||(d=!0)),r=p,p=p.return;return r.tag===3?(p=r.stateNode,d&&s!==null&&(d=31-rt(a),r=p.hiddenUpdates,c=r[d],c===null?r[d]=[s]:c.push(s),s.lane=a|536870912),p):null}function Su(r){if(50<sc)throw sc=0,A0=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var xo={};function jS(r,s,a,c){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(r,s,a,c){return new jS(r,s,a,c)}function mh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function is(r,s){var a=r.alternate;return a===null?(a=ai(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&65011712,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a.refCleanup=r.refCleanup,a}function Nm(r,s){r.flags&=65011714;var a=r.alternate;return a===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,s=a.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}
vendor: 13,426 bytes, line 9
9function Au(r,s,a,c,d,p){var R=0;if(c=r,typeof r=="function")mh(r)&&(R=1);else if(typeof r=="string")R=V4(r,a,O.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case X:return r=ai(31,a,s,d),r.elementType=X,r.lanes=p,r;case k:return Ma(a.children,d,p,s);case j:R=8,d|=24;break;case M:return r=ai(12,a,s,d|2),r.elementType=M,r.lanes=p,r;case re:return r=ai(13,a,s,d),r.elementType=re,r.lanes=p,r;case te:return r=ai(19,a,s,d),r.elementType=te,r.lanes=p,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case K:R=10;break e;case W:R=9;break e;case se:R=11;break e;case pe:R=14;break e;case we:R=16,c=null;break e}R=29,a=Error(i(130,r===null?"null":typeof r,"")),c=null}return s=ai(R,a,s,d),s.elementType=r,s.type=c,s.lanes=p,s}function Ma(r,s,a,c){return r=ai(7,r,c,s),r.lanes=a,r}function yh(r,s,a){return r=ai(6,r,null,s),r.lanes=a,r}function km(r){var s=ai(18,null,null,0);return s.stateNode=r,s}function wh(r,s,a){return s=ai(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var Um=new WeakMap;function bi(r,s){if(typeof r=="object"&&r!==null){var a=Um.get(r);return a!==void 0?a:(s={value:r,source:s,stack:Ze(s)},Um.set(r,s),s)}return{value:r,source:s,stack:Ze(s)}}var Eo=[],So=0,_u=null,Ll=0,vi=[],xi=0,ks=null,Ki=1,qi="";function ss(r,s){Eo[So++]=Ll,Eo[So++]=_u,_u=r,Ll=s}function jm(r,s,a){vi[xi++]=Ki,vi[xi++]=qi,vi[xi++]=ks,ks=r;var c=Ki;r=qi;var d=32-rt(c)-1;c&=~(1<<d),a+=1;var p=32-rt(s)+d;if(30<p){var R=d-d%5;p=(c&(1<<R)-1).toString(32),c>>=R,d-=R,Ki=1<<32-rt(s)+d|a<<d|c,qi=p+r}else Ki=1<<p|a<<d|c,qi=r}function bh(r){r.return!==null&&(ss(r,1),jm(r,1,0))}function vh(r){for(;r===_u;)_u=Eo[--So],Eo[So]=null,Ll=Eo[--So],Eo[So]=null;for(;r===ks;)ks=vi[--xi],vi[xi]=null,qi=vi[--xi],vi[xi]=null,Ki=vi[--xi],vi[xi]=null}function Lm(r,s){vi[xi++]=Ki,vi[xi++]=qi,vi[xi++]=ks,Ki=s.id,qi=s.overflow,ks=r}var wr=null,Nn=null,ln=!1,Us=null,Ei=!1,xh=Error(i(519));function js(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zl(bi(s,r)),xh}function zm(r){var s=r.stateNode,a=r.type,c=r.memoizedProps;switch(s[he]=r,s[Ie]=c,a){case"dialog":tn("cancel",s),tn("close",s);break;case"iframe":case"object":case"embed":tn("load",s);break;case"video":case"audio":for(a=0;a<oc.length;a++)tn(oc[a],s);break;case"source":tn("error",s);break;case"img":case"image":case"link":tn("error",s),tn("load",s);break;case"details":tn("toggle",s);break;case"input":tn("invalid",s),zt(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":tn("invalid",s);break;case"textarea":tn("invalid",s),fn(s,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||c.suppressHydrationWarning===!0||nb(s.textContent,a)?(c.popover!=null&&(tn("beforetoggle",s),tn("toggle",s)),c.onScroll!=null&&tn("scroll",s),c.onScrollEnd!=null&&tn("scrollend",s),c.onClick!=null&&(s.onclick=ns),s=!0):s=!1,s||js(r,!0)}function Pm(r){for(wr=r.return;wr;)switch(wr.tag){case 5:case 31:case 13:Ei=!1;return;case 27:case 3:Ei=!0;return;default:wr=wr.return}}function Ao(r){if(r!==wr)return!1;if(!ln)return Pm(r),ln=!0,!1;var s=r.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=r.type,a=!(a!=="form"&&a!=="button")||z0(r.type,r.memoizedProps)),a=!a),a&&Nn&&js(r),Pm(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Nn=fb(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Nn=fb(r)}else s===27?(s=Nn,Js(r.type)?(r=K0,K0=null,Nn=r):Nn=s):Nn=wr?Ai(r.stateNode.nextSibling):null;return!0}function Ba(){Nn=wr=null,ln=!1}function Eh(){var r=Us;return r!==null&&(Xr===null?Xr=r:Xr.push.apply(Xr,r),Us=null),r}function zl(r){Us===null?Us=[r]:Us.push(r)}var Sh=T(null),Da=null,as=null;function Ls(r,s,a){b(Sh,s._currentValue),s._currentValue=a}function os(r){r._currentValue=Sh.current,m(Sh)}function Ah(r,s,a){for(;r!==null;){var c=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),r===a)break;r=r.return}}function _h(r,s,a,c){var d=r.child;for(d!==null&&(d.return=r);d!==null;){var p=d.dependencies;if(p!==null){var R=d.child;p=p.firstContext;e:for(;p!==null;){var q=p;p=d;for(var oe=0;oe<s.length;oe++)if(q.context===s[oe]){p.lanes|=a,q=p.alternate,q!==null&&(q.lanes|=a),Ah(p.return,a,r),c||(R=null);break e}p=q.next}}else if(d.tag===18){if(R=d.return,R===null)throw Error(i(341));R.lanes|=a,p=R.alternate,p!==null&&(p.lanes|=a),Ah(R,a,r),R=null}else R=d.child;if(R!==null)R.return=d;else for(R=d;R!==null;){if(R===r){R=null;break}if(d=R.sibling,d!==null){d.return=R.return,R=d;break}R=R.return}d=R}}function _o(r,s,a,c){r=null;for(var d=s,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var R=d.alternate;if(R===null)throw Error(i(387));if(R=R.memoizedProps,R!==null){var q=d.type;si(d.pendingProps.value,R.value)||(r!==null?r.push(q):r=[q])}}else if(d===ue.current){if(R=d.alternate,R===null)throw Error(i(387));R.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(r!==null?r.push(dc):r=[dc])}d=d.return}r!==null&&_h(s,r,a,c),s.flags|=262144}function Iu(r){for(r=r.firstContext;r!==null;){if(!si(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Oa(r){Da=r,as=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function br(r){return Hm(Da,r)}function Tu(r,s){return Da===null&&Oa(r),Hm(r,s)}function Hm(r,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},as===null){if(r===null)throw Error(i(308));as=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else as=as.next=s;return a}var LS=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(a,c){r.push(c)}};this.abort=function(){s.aborted=!0,r.forEach(function(a){return a()})}},zS=e.unstable_scheduleCallback,PS=e.unstable_NormalPriority,ir={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ih(){return{controller:new LS,data:new Map,refCount:0}}function Pl(r){r.refCount--,r.refCount===0&&zS(PS,function(){r.controller.abort()})}var Hl=null,Th=0,Io=0,To=null;function HS(r,s){if(Hl===null){var a=Hl=[];Th=0,Io=M0(),To={status:"pending",value:void 0,then:function(c){a.push(c)}}}return Th++,s.then(Vm,Vm),s}function Vm(){if(--Th===0&&Hl!==null){To!==null&&(To.status="fulfilled");var r=Hl;Hl=null,Io=0,To=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function VS(r,s){var a=[],c={status:"pending",value:null,reason:null,then:function(d){a.push(d)}};return r.then(function(){c.status="fulfilled",c.value=s;for(var d=0;d<a.length;d++)(0,a[d])(s)},function(d){for(c.status="rejected",c.reason=d,d=0;d<a.length;d++)(0,a[d])(void 0)}),c}var Fm=E.S;E.S=function(r,s){Iw=qe(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&HS(r,s),Fm!==null&&Fm(r,s)};var Na=T(null);function Rh(){var r=Na.current;return r!==null?r:Rn.pooledCache}function Ru(r,s){s===null?b(Na,Na.current):b(Na,s.pool)}function Km(){var r=Rh();return r===null?null:{parent:ir._currentValue,pool:r}}var Ro=Error(i(460)),Ch=Error(i(474)),Cu=Error(i(542)),Mu={then:function(){}};function qm(r){return r=r.status,r==="fulfilled"||r==="rejected"}function $m(r,s,a){switch(a=r[a],a===void 0?r.push(s):a!==s&&(s.then(ns,ns),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Gm(r),r;default:if(typeof s.status=="string")s.then(ns,ns);else{if(r=Rn,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(c){if(s.status==="pending"){var d=s;d.status="fulfilled",d.value=c}},function(c){if(s.status==="pending"){var d=s;d.status="rejected",d.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,Gm(r),r}throw Ua=s,Ro}}function ka(r){try{var s=r._init;return s(r._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Ua=a,Ro):a}}var Ua=null;function Wm(){if(Ua===null)throw Error(i(459));var r=Ua;return Ua=null,r}function Gm(r){if(r===Ro||r===Cu)throw Error(i(483))}var Co=null,Vl=0;function Bu(r){var s=Vl;return Vl+=1,Co===null&&(Co=[]),$m(Co,r,s)}function Fl(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Du(r,s){throw s.$$typeof===D?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Ym(r){function s(ye,fe){if(r){var xe=ye.deletions;xe===null?(ye.deletions=[fe],ye.flags|=16):xe.push(fe)}}function a(ye,fe){if(!r)return null;for(;fe!==null;)s(ye,fe),fe=fe.sibling;return null}function c(ye){for(var fe=new Map;ye!==null;)ye.key!==null?fe.set(ye.key,ye):fe.set(ye.index,ye),ye=ye.sibling;return fe}function d(ye,fe){return ye=is(ye,fe),ye.index=0,ye.sibling=null,ye}function p(ye,fe,xe){return ye.index=xe,r?(xe=ye.alternate,xe!==null?(xe=xe.index,xe<fe?(ye.flags|=67108866,fe):xe):(ye.flags|=67108866,fe)):(ye.flags|=1048576,fe)}function R(ye){return r&&ye.alternate===null&&(ye.flags|=67108866),ye}function q(ye,fe,xe,Ue){return fe===null||fe.tag!==6?(fe=yh(xe,ye.mode,Ue),fe.return=ye,fe):(fe=d(fe,xe),fe.return=ye,fe)}function oe(ye,fe,xe,Ue){var vt=xe.type;return vt===k?Oe(ye,fe,xe.props.children,Ue,xe.key):fe!==null&&(fe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===we&&ka(vt)===fe.type)?(fe=d(fe,xe.props),Fl(fe,xe),fe.return=ye,fe):(fe=Au(xe.type,xe.key,xe.props,null,ye.mode,Ue),Fl(fe,xe),fe.return=ye,fe)}function Ee(ye,fe,xe,Ue){return fe===null||fe.tag!==4||fe.stateNode.containerInfo!==xe.containerInfo||fe.stateNode.implementation!==xe.implementation?(fe=wh(xe,ye.mode,Ue),fe.return=ye,fe):(fe=d(fe,xe.children||[]),fe.return=ye,fe)}function Oe(ye,fe,xe,Ue,vt){return fe===null||fe.tag!==7?(fe=Ma(xe,ye.mode,Ue,vt),fe.return=ye,fe):(fe=d(fe,xe),fe.return=ye,fe)}function je(ye,fe,xe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return fe=yh(""+fe,ye.mode,xe),fe.return=ye,fe;if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case U:return xe=Au(fe.type,fe.key,fe.props,null,ye.mode,xe),Fl(xe,fe),xe.return=ye,xe;case L:return fe=wh(fe,ye.mode,xe),fe.return=ye,fe;case we:return fe=ka(fe),je(ye,fe,xe)}if(v(fe)||ce(fe))return fe=Ma(fe,ye.mode,xe,null),fe.return=ye,fe;if(typeof fe.then=="function")return je(ye,Bu(fe),xe);if(fe.$$typeof===K)return je(ye,Tu(ye,fe),xe);Du(ye,fe)}return null}function Se(ye,fe,xe,Ue){var vt=fe!==null?fe.key:null;if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return vt!==null?null:q(ye,fe,""+xe,Ue);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case U:return xe.key===vt?oe(ye,fe,xe,Ue):null;case L:return xe.key===vt?Ee(ye,fe,xe,Ue):null;case we:return xe=ka(xe),Se(ye,fe,xe,Ue)}if(v(xe)||ce(xe))return vt!==null?null:Oe(ye,fe,xe,Ue,null);if(typeof xe.then=="function")return Se(ye,fe,Bu(xe),Ue);if(xe.$$typeof===K)return Se(ye,fe,Tu(ye,xe),Ue);Du(ye,xe)}return null}function De(ye,fe,xe,Ue,vt){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return ye=ye.get(xe)||null,q(fe,ye,""+Ue,vt);if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case U:return ye=ye.get(Ue.key===null?xe:Ue.key)||null,oe(fe,ye,Ue,vt);case L:return ye=ye.get(Ue.key===null?xe:Ue.key)||null,Ee(fe,ye,Ue,vt);case we:return Ue=ka(Ue),De(ye,fe,xe,Ue,vt)}if(v(Ue)||ce(Ue))return ye=ye.get(xe)||null,Oe(fe,ye,Ue,vt,null);if(typeof Ue.then=="function")return De(ye,fe,xe,Bu(Ue),vt);if(Ue.$$typeof===K)return De(ye,fe,xe,Tu(fe,Ue),vt);Du(fe,Ue)}return null}function ct(ye,fe,xe,Ue){for(var vt=null,dn=null,ht=fe,Ft=fe=0,rn=null;ht!==null&&Ft<xe.length;Ft++){ht.index>Ft?(rn=ht,ht=null):rn=ht.sibling;var hn=Se(ye,ht,xe[Ft],Ue);if(hn===null){ht===null&&(ht=rn);break}r&&ht&&hn.alternate===null&&s(ye,ht),fe=p(hn,fe,Ft),dn===null?vt=hn:dn.sibling=hn,dn=hn,ht=rn}if(Ft===xe.length)return a(ye,ht),ln&&ss(ye,Ft),vt;if(ht===null){for(;Ft<xe.length;Ft++)ht=je(ye,xe[Ft],Ue),ht!==null&&(fe=p(ht,fe,Ft),dn===null?vt=ht:dn.sibling=ht,dn=ht);return ln&&ss(ye,Ft),vt}for(ht=c(ht);Ft<xe.length;Ft++)rn=De(ht,ye,Ft,xe[Ft],Ue),rn!==null&&(r&&rn.alternate!==null&&ht.delete(rn.key===null?Ft:rn.key),fe=p(rn,fe,Ft),dn===null?vt=rn:dn.sibling=rn,dn=rn);return r&&ht.forEach(function(na){return s(ye,na)}),ln&&ss(ye,Ft),vt}function It(ye,fe,xe,Ue){if(xe==null)throw Error(i(151));for(var vt=null,dn=null,ht=fe,Ft=fe=0,rn=null,hn=xe.next();ht!==null&&!hn.done;Ft++,hn=xe.next()){ht.index>Ft?(rn=ht,ht=null):rn=ht.sibling;var na=Se(ye,ht,hn.value,Ue);if(na===null){ht===null&&(ht=rn);break}r&&ht&&na.alternate===null&&s(ye,ht),fe=p(na,fe,Ft),dn===null?vt=na:dn.sibling=na,dn=na,ht=rn}if(hn.done)return a(ye,ht),ln&&ss(ye,Ft),vt;if(ht===null){for(;!hn.done;Ft++,hn=xe.next())hn=je(ye,hn.value,Ue),hn!==null&&(fe=p(hn,fe,Ft),dn===null?vt=hn:dn.sibling=hn,dn=hn);return ln&&ss(ye,Ft),vt}for(ht=c(ht);!hn.done;Ft++,hn=xe.next())hn=De(ht,ye,Ft,hn.value,Ue),hn!==null&&(r&&hn.alternate!==null&&ht.delete(hn.key===null?Ft:hn.key),fe=p(hn,fe,Ft),dn===null?vt=hn:dn.sibling=hn,dn=hn);return r&&ht.forEach(function(Q4){return s(ye,Q4)}),ln&&ss(ye,Ft),vt}function An(ye,fe,xe,Ue){if(typeof xe=="object"&&xe!==null&&xe.type===k&&xe.key===null&&(xe=xe.props.children),typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case U:e:{for(var vt=xe.key;
vendor: 2,783 bytes, line 9
9fe!==null;){if(fe.key===vt){if(vt=xe.type,vt===k){if(fe.tag===7){a(ye,fe.sibling),Ue=d(fe,xe.props.children),Ue.return=ye,ye=Ue;break e}}else if(fe.elementType===vt||typeof vt=="object"&&vt!==null&&vt.$$typeof===we&&ka(vt)===fe.type){a(ye,fe.sibling),Ue=d(fe,xe.props),Fl(Ue,xe),Ue.return=ye,ye=Ue;break e}a(ye,fe);break}else s(ye,fe);fe=fe.sibling}xe.type===k?(Ue=Ma(xe.props.children,ye.mode,Ue,xe.key),Ue.return=ye,ye=Ue):(Ue=Au(xe.type,xe.key,xe.props,null,ye.mode,Ue),Fl(Ue,xe),Ue.return=ye,ye=Ue)}return R(ye);case L:e:{for(vt=xe.key;fe!==null;){if(fe.key===vt)if(fe.tag===4&&fe.stateNode.containerInfo===xe.containerInfo&&fe.stateNode.implementation===xe.implementation){a(ye,fe.sibling),Ue=d(fe,xe.children||[]),Ue.return=ye,ye=Ue;break e}else{a(ye,fe);break}else s(ye,fe);fe=fe.sibling}Ue=wh(xe,ye.mode,Ue),Ue.return=ye,ye=Ue}return R(ye);case we:return xe=ka(xe),An(ye,fe,xe,Ue)}if(v(xe))return ct(ye,fe,xe,Ue);if(ce(xe)){if(vt=ce(xe),typeof vt!="function")throw Error(i(150));return xe=vt.call(xe),It(ye,fe,xe,Ue)}if(typeof xe.then=="function")return An(ye,fe,Bu(xe),Ue);if(xe.$$typeof===K)return An(ye,fe,Tu(ye,xe),Ue);Du(ye,xe)}return typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint"?(xe=""+xe,fe!==null&&fe.tag===6?(a(ye,fe.sibling),Ue=d(fe,xe),Ue.return=ye,ye=Ue):(a(ye,fe),Ue=yh(xe,ye.mode,Ue),Ue.return=ye,ye=Ue),R(ye)):a(ye,fe)}return function(ye,fe,xe,Ue){try{Vl=0;var vt=An(ye,fe,xe,Ue);return Co=null,vt}catch(ht){if(ht===Ro||ht===Cu)throw ht;var dn=ai(29,ht,null,ye.mode);return dn.lanes=Ue,dn.return=ye,dn}}}var ja=Ym(!0),Zm=Ym(!1),zs=!1;function Mh(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Bh(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Ps(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Hs(r,s,a){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(pn&2)!==0){var d=c.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),c.pending=s,s=Su(r),Om(r,null,a),s}return Eu(r,c,s,a),Su(r)}function Kl(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,Os(r,a)}}function Dh(r,s){var a=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var d=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var R={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?d=p=R:p=p.next=R,a=a.next}while(a!==null);p===null?d=p=s:p=p.next=s}else d=p=s;a={baseState:c.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},r.updateQueue=a;return}
vendor: 5,009 bytes, line 9
9r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}var Oh=!1;function ql(){if(Oh){var r=To;if(r!==null)throw r}}function $l(r,s,a,c){Oh=!1;var d=r.updateQueue;zs=!1;var p=d.firstBaseUpdate,R=d.lastBaseUpdate,q=d.shared.pending;if(q!==null){d.shared.pending=null;var oe=q,Ee=oe.next;oe.next=null,R===null?p=Ee:R.next=Ee,R=oe;var Oe=r.alternate;Oe!==null&&(Oe=Oe.updateQueue,q=Oe.lastBaseUpdate,q!==R&&(q===null?Oe.firstBaseUpdate=Ee:q.next=Ee,Oe.lastBaseUpdate=oe))}if(p!==null){var je=d.baseState;R=0,Oe=Ee=oe=null,q=p;do{var Se=q.lane&-536870913,De=Se!==q.lane;if(De?(nn&Se)===Se:(c&Se)===Se){Se!==0&&Se===Io&&(Oh=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var ct=r,It=q;Se=s;var An=a;switch(It.tag){case 1:if(ct=It.payload,typeof ct=="function"){je=ct.call(An,je,Se);break e}je=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=It.payload,Se=typeof ct=="function"?ct.call(An,je,Se):ct,Se==null)break e;je=A({},je,Se);break e;case 2:zs=!0}}Se=q.callback,Se!==null&&(r.flags|=64,De&&(r.flags|=8192),De=d.callbacks,De===null?d.callbacks=[Se]:De.push(Se))}else De={lane:Se,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Oe===null?(Ee=Oe=De,oe=je):Oe=Oe.next=De,R|=Se;if(q=q.next,q===null){if(q=d.shared.pending,q===null)break;De=q,q=De.next,De.next=null,d.lastBaseUpdate=De,d.shared.pending=null}}while(!0);Oe===null&&(oe=je),d.baseState=oe,d.firstBaseUpdate=Ee,d.lastBaseUpdate=Oe,p===null&&(d.shared.lanes=0),$s|=R,r.lanes=R,r.memoizedState=je}}function Jm(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function Xm(r,s){var a=r.callbacks;if(a!==null)for(r.callbacks=null,r=0;r<a.length;r++)Jm(a[r],s)}var Mo=T(null),Ou=T(0);function Qm(r,s){r=ms,b(Ou,r),b(Mo,s),ms=r|s.baseLanes}function Nh(){b(Ou,ms),b(Mo,Mo.current)}function kh(){ms=Ou.current,m(Mo),m(Ou)}var oi=T(null),Si=null;function Vs(r){var s=r.alternate;b(Qn,Qn.current&1),b(oi,r),Si===null&&(s===null||Mo.current!==null||s.memoizedState!==null)&&(Si=r)}function Uh(r){b(Qn,Qn.current),b(oi,r),Si===null&&(Si=r)}function ey(r){r.tag===22?(b(Qn,Qn.current),b(oi,r),Si===null&&(Si=r)):Fs()}function Fs(){b(Qn,Qn.current),b(oi,oi.current)}function li(r){m(oi),Si===r&&(Si=null),m(Qn)}var Qn=T(0);function Nu(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||V0(a)||F0(a)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var ls=0,Pt=null,En=null,sr=null,ku=!1,Bo=!1,La=!1,Uu=0,Wl=0,Do=null,FS=0;function Wn(){throw Error(i(321))}function jh(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!si(r[a],s[a]))return!1;return!0}function Lh(r,s,a,c,d,p){return ls=p,Pt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,E.H=r===null||r.memoizedState===null?jy:Qh,La=!1,p=a(c,d),La=!1,Bo&&(p=ny(s,a,c,d)),ty(r),p}function ty(r){E.H=Zl;var s=En!==null&&En.next!==null;if(ls=0,sr=En=Pt=null,ku=!1,Wl=0,Do=null,s)throw Error(i(300));r===null||ar||(r=r.dependencies,r!==null&&Iu(r)&&(ar=!0))}function ny(r,s,a,c){Pt=r;var d=0;do{if(Bo&&(Do=null),Wl=0,Bo=!1,25<=d)throw Error(i(301));if(d+=1,sr=En=null,r.updateQueue!=null){var p=r.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}E.H=Ly,p=s(a,c)}while(Bo);return p}function KS(){var r=E.H,s=r.useState()[0];return s=typeof s.then=="function"?Gl(s):s,r=r.useState()[0],(En!==null?En.memoizedState:null)!==r&&(Pt.flags|=1024),s}function zh(){var r=Uu!==0;return Uu=0,r}function Ph(r,s,a){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~a}function Hh(r){if(ku){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}ku=!1}ls=0,sr=En=Pt=null,Bo=!1,Wl=Uu=0,Do=null}function Vr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?Pt.memoizedState=sr=r:sr=sr.next=r,sr}function er(){if(En===null){var r=Pt.alternate;r=r!==null?r.memoizedState:null}else r=En.next;var s=sr===null?Pt.memoizedState:sr.next;if(s!==null)sr=s,En=r;else{if(r===null)throw Pt.alternate===null?Error(i(467)):Error(i(310));En=r,r={memoizedState:En.memoizedState,baseState:En.baseState,baseQueue:En.baseQueue,queue:En.queue,next:null},sr===null?Pt.memoizedState=sr=r:sr=sr.next=r}return sr}function ju(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Gl(r){var s=Wl;return Wl+=1,Do===null&&(Do=[]),r=$m(Do,r,s),s=Pt,(sr===null?s.memoizedState:sr.next)===null&&(s=s.alternate,E.H=s===null||s.memoizedState===null?jy:Qh),r}function Lu(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Gl
vendor: 9,149 bytes, line 9
9(r);if(r.$$typeof===K)return br(r)}throw Error(i(438,String(r)))}function Vh(r){var s=null,a=Pt.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var c=Pt.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(d){return d.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=ju(),Pt.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(r),c=0;c<r;c++)a[c]=Z;return s.index++,a}function cs(r,s){return typeof s=="function"?s(r):s}function zu(r){var s=er();return Fh(s,En,r)}function Fh(r,s,a){var c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var d=r.baseQueue,p=c.pending;if(p!==null){if(d!==null){var R=d.next;d.next=p.next,p.next=R}s.baseQueue=d=p,c.pending=null}if(p=r.baseState,d===null)r.memoizedState=p;else{s=d.next;var q=R=null,oe=null,Ee=s,Oe=!1;do{var je=Ee.lane&-536870913;if(je!==Ee.lane?(nn&je)===je:(ls&je)===je){var Se=Ee.revertLane;if(Se===0)oe!==null&&(oe=oe.next={lane:0,revertLane:0,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null}),je===Io&&(Oe=!0);else if((ls&Se)===Se){Ee=Ee.next,Se===Io&&(Oe=!0);continue}else je={lane:0,revertLane:Ee.revertLane,gesture:null,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},oe===null?(q=oe=je,R=p):oe=oe.next=je,Pt.lanes|=Se,$s|=Se;je=Ee.action,La&&a(p,je),p=Ee.hasEagerState?Ee.eagerState:a(p,je)}else Se={lane:je,revertLane:Ee.revertLane,gesture:Ee.gesture,action:Ee.action,hasEagerState:Ee.hasEagerState,eagerState:Ee.eagerState,next:null},oe===null?(q=oe=Se,R=p):oe=oe.next=Se,Pt.lanes|=je,$s|=je;Ee=Ee.next}while(Ee!==null&&Ee!==s);if(oe===null?R=p:oe.next=q,!si(p,r.memoizedState)&&(ar=!0,Oe&&(a=To,a!==null)))throw a;r.memoizedState=p,r.baseState=R,r.baseQueue=oe,c.lastRenderedState=p}return d===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function Kh(r){var s=er(),a=s.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=r;var c=a.dispatch,d=a.pending,p=s.memoizedState;if(d!==null){a.pending=null;var R=d=d.next;do p=r(p,R.action),R=R.next;while(R!==d);si(p,s.memoizedState)||(ar=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),a.lastRenderedState=p}return[p,c]}function ry(r,s,a){var c=Pt,d=er(),p=ln;if(p){if(a===void 0)throw Error(i(407));a=a()}else a=s();var R=!si((En||d).memoizedState,a);if(R&&(d.memoizedState=a,ar=!0),d=d.queue,Wh(ay.bind(null,c,d,r),[r]),d.getSnapshot!==s||R||sr!==null&&sr.memoizedState.tag&1){if(c.flags|=2048,Oo(9,{destroy:void 0},sy.bind(null,c,d,a,s),null),Rn===null)throw Error(i(349));p||(ls&127)!==0||iy(c,s,a)}return a}function iy(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=Pt.updateQueue,s===null?(s=ju(),Pt.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function sy(r,s,a,c){s.value=a,s.getSnapshot=c,oy(s)&&ly(r)}function ay(r,s,a){return a(function(){oy(s)&&ly(r)})}function oy(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!si(r,a)}catch{return!0}}function ly(r){var s=Ca(r,2);s!==null&&Qr(s,r,2)}function qh(r){var s=Vr();if(typeof r=="function"){var a=r;if(r=a(),La){dt(!0);try{a()}finally{dt(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:r},s}function cy(r,s,a,c){return r.baseState=a,Fh(r,En,typeof c=="function"?c:cs)}function qS(r,s,a,c,d){if(Vu(r))throw Error(i(485));if(r=s.action,r!==null){var p={payload:d,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){p.listeners.push(R)}};E.T!==null?a(!0):p.isTransition=!1,c(p),a=s.pending,a===null?(p.next=s.pending=p,uy(s,p)):(p.next=a.next,s.pending=a.next=p)}}function uy(r,s){var a=s.action,c=s.payload,d=r.state;if(s.isTransition){var p=E.T,R={};E.T=R;try{var q=a(d,c),oe=E.S;oe!==null&&oe(R,q),fy(r,s,q)}catch(Ee){$h(r,s,Ee)}finally{p!==null&&R.types!==null&&(p.types=R.types),E.T=p}}else try{p=a(d,c),fy(r,s,p)}catch(Ee){$h(r,s,Ee)}}function fy(r,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){dy(r,s,c)},function(c){return $h(r,s,c)}):dy(r,s,a)}function dy(r,s,a){s.status="fulfilled",s.value=a,hy(s),r.state=a,s=r.pending,s!==null&&(a=s.next,a===s?r.pending=null:(a=a.next,s.next=a,uy(r,a)))}function $h(r,s,a){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=a,hy(s),s=s.next;while(s!==c)}r.action=null}function hy(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function py(r,s){return s}function gy(r,s){if(ln){var a=Rn.formState;if(a!==null){e:{var c=Pt;if(ln){if(Nn){t:{for(var d=Nn,p=Ei;d.nodeType!==8;){if(!p){d=null;break t}if(d=Ai(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){Nn=Ai(d.nextSibling),c=d.data==="F!";break e}}js(c)}c=!1}c&&(s=a[0])}}return a=Vr(),a.memoizedState=a.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:py,lastRenderedState:s},a.queue=c,a=Ny.bind(null,Pt,c),c.dispatch=a,c=qh(!1),p=Xh.bind(null,Pt,!1,c.queue),c=Vr(),d={state:s,dispatch:null,action:r,pending:null},c.queue=d,a=qS.bind(null,Pt,d,p,a),d.dispatch=a,c.memoizedState=r,[s,a,!1]}function my(r){var s=er();return yy(s,En,r)}function yy(r,s,a){if(s=Fh(r,s,py)[0],r=zu(cs)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=Gl(s)}catch(R){throw R===Ro?Cu:R}else c=s;s=er();var d=s.queue,p=d.dispatch;return a!==s.memoizedState&&(Pt.flags|=2048,Oo(9,{destroy:void 0},$S.bind(null,d,a),null)),[c,p,r]}function $S(r,s){r.action=s}function wy(r){var s=er(),a=En;if(a!==null)return yy(s,a,r);er(),s=s.memoizedState,a=er();var c=a.queue.dispatch;return a.memoizedState=r,[s,c,!1]}function Oo(r,s,a,c){return r={tag:r,create:a,deps:c,inst:s,next:null},s=Pt.updateQueue,s===null&&(s=ju(),Pt.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=r.next=r:(c=a.next,a.next=r,r.next=c,s.lastEffect=r),r}function by(){return er().memoizedState}function Pu(r,s,a,c){var d=Vr();Pt.flags|=r,d.memoizedState=Oo(1|s,{destroy:void 0},a,c===void 0?null:c)}function Hu(r,s,a,c){var d=er();c=c===void 0?null:c;var p=d.memoizedState.inst;En!==null&&c!==null&&jh(c,En.memoizedState.deps)?d.memoizedState=Oo(s,p,a,c):(Pt.flags|=r,d.memoizedState=Oo(1|s,p,a,c))}function vy(r,s){Pu(8390656,8,r,s)}function Wh(r,s){Hu(2048,8,r,s)}function WS(r){Pt.flags|=4;var s=Pt.updateQueue;if(s===null)s=ju(),Pt.updateQueue=s,s.events=[r];else{var a=s.events;a===null?s.events=[r]:a.push(r)}}function xy(r){var s=er().memoizedState;return WS({ref:s,nextImpl:r}),function(){if((pn&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function Ey(r,s){return Hu(4,2,r,s)}function Sy(r,s){return Hu(4,4,r,s)}function Ay(r,s){if(typeof s=="function"){r=r();var a=s(r);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function _y(r,s,a){a=a!=null?a.concat([r]):null,Hu(4,4,Ay.bind(null,s,r),a)}function Gh(){}function Iy(r,s){var a=er();s=s===void 0?null:s;var c=a.memoizedState;return s!==null&&jh(s,c[1])?c[0]:(a.memoizedState=[r,s],r)}function Ty(r,s){var a=er();s=s===void 0?null:s;var c=a.memoizedState;if(s!==null&&jh(s,c[1]))return c[0];if(c=r(),La){dt(!0);try{r()}finally{dt(!1)}}return a.memoizedState=[c,s],c}function Yh(r,s,a){return a===void 0||(ls&1073741824)!==0&&(nn&261930)===0?r.memoizedState=s:(r.memoizedState=a,r=Rw(),Pt.lanes|=r,$s|=r,a)}function Ry(r,s,a,c){return si(a,s)?a:Mo.current!==null?(r=Yh(r,a,c),si(r,s)||(ar=!0),r):(ls&42)===0||(ls&1073741824)!==0&&(nn&261930)===0?(ar=!0,r.memoizedState=a):(r=Rw(),Pt.lanes|=r,$s|=r,s)}function Cy(r,s,a,c,d){var p=B.p;B.p=p!==0&&8>p?p:8;var R=E.T,q={};E.T=q,Xh(r,!1,s,a);try{var oe=d(),Ee=E.S;if(Ee!==null&&Ee(q,oe),oe!==null&&typeof oe=="object"&&typeof oe.then=="function"){var Oe=VS(oe,c);Yl(r,s,Oe,fi(r))}else Yl(r,s,c,fi(r))}catch(je){Yl(r,s,{then:function(){},status:"rejected",reason:je},fi())}finally{B.p=p,R!==null&&q.types!==null&&(R.types=q.types),E.T=R}}function GS(){}function Zh(r,s,a,c){if(r.tag!==5)throw Error(i(476));var d=My(r).queue;Cy(r,d,s,z,a===null?GS:function(){return By(r),a(c)})}function My(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:z},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:cs,lastRenderedState:a},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function By(r){var s=My(r);s.next===null&&(s=r.alternate.memoizedState),Yl(r,s.next.queue,{},fi())}function Jh(){return br(dc)}function Dy(){return er().memoizedState}function Oy(){return er().memoizedState}function YS(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var a=fi();r=Ps(a);var c=Hs(s,r,a);c!==null&&(Qr(c,s,a),Kl(c,s,a)),s={cache:Ih()},r.payload=s;return}s=s.return}}function ZS(r,s,a){var c=fi();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Vu(r)?ky(s,a):(a=gh(r,s,a,c),a!==null&&(Qr(a,r,c),Uy(a,s,c)))}function Ny(r,s,a){var c=fi();
vendor: 4,274 bytes, line 9
9Yl(r,s,a,c)}function Yl(r,s,a,c){var d={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(Vu(r))ky(s,d);else{var p=r.alternate;if(r.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var R=s.lastRenderedState,q=p(R,a);if(d.hasEagerState=!0,d.eagerState=q,si(q,R))return Eu(r,s,d,0),Rn===null&&xu(),!1}catch{}if(a=gh(r,s,d,c),a!==null)return Qr(a,r,c),Uy(a,s,c),!0}return!1}function Xh(r,s,a,c){if(c={lane:2,revertLane:M0(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Vu(r)){if(s)throw Error(i(479))}else s=gh(r,a,c,2),s!==null&&Qr(s,r,2)}function Vu(r){var s=r.alternate;return r===Pt||s!==null&&s===Pt}function ky(r,s){Bo=ku=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function Uy(r,s,a){if((a&4194048)!==0){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,Os(r,a)}}var Zl={readContext:br,use:Lu,useCallback:Wn,useContext:Wn,useEffect:Wn,useImperativeHandle:Wn,useLayoutEffect:Wn,useInsertionEffect:Wn,useMemo:Wn,useReducer:Wn,useRef:Wn,useState:Wn,useDebugValue:Wn,useDeferredValue:Wn,useTransition:Wn,useSyncExternalStore:Wn,useId:Wn,useHostTransitionStatus:Wn,useFormState:Wn,useActionState:Wn,useOptimistic:Wn,useMemoCache:Wn,useCacheRefresh:Wn};Zl.useEffectEvent=Wn;var jy={readContext:br,use:Lu,useCallback:function(r,s){return Vr().memoizedState=[r,s===void 0?null:s],r},useContext:br,useEffect:vy,useImperativeHandle:function(r,s,a){a=a!=null?a.concat([r]):null,Pu(4194308,4,Ay.bind(null,s,r),a)},useLayoutEffect:function(r,s){return Pu(4194308,4,r,s)},useInsertionEffect:function(r,s){Pu(4,2,r,s)},useMemo:function(r,s){var a=Vr();s=s===void 0?null:s;var c=r();if(La){dt(!0);try{r()}finally{dt(!1)}}return a.memoizedState=[c,s],c},useReducer:function(r,s,a){var c=Vr();if(a!==void 0){var d=a(s);if(La){dt(!0);try{a(s)}finally{dt(!1)}}}else d=s;return c.memoizedState=c.baseState=d,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:d},c.queue=r,r=r.dispatch=ZS.bind(null,Pt,r),[c.memoizedState,r]},useRef:function(r){var s=Vr();return r={current:r},s.memoizedState=r},useState:function(r){r=qh(r);var s=r.queue,a=Ny.bind(null,Pt,s);return s.dispatch=a,[r.memoizedState,a]},useDebugValue:Gh,useDeferredValue:function(r,s){var a=Vr();return Yh(a,r,s)},useTransition:function(){var r=qh(!1);return r=Cy.bind(null,Pt,r.queue,!0,!1),Vr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,a){var c=Pt,d=Vr();if(ln){if(a===void 0)throw Error(i(407));a=a()}else{if(a=s(),Rn===null)throw Error(i(349));(nn&127)!==0||iy(c,s,a)}d.memoizedState=a;var p={value:a,getSnapshot:s};return d.queue=p,vy(ay.bind(null,c,p,r),[r]),c.flags|=2048,Oo(9,{destroy:void 0},sy.bind(null,c,p,a,s),null),a},useId:function(){var r=Vr(),s=Rn.identifierPrefix;if(ln){var a=qi,c=Ki;a=(c&~(1<<32-rt(c)-1)).toString(32)+a,s="_"+s+"R_"+a,a=Uu++,0<a&&(s+="H"+a.toString(32)),s+="_"}else a=FS++,s="_"+s+"r_"+a.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:Jh,useFormState:gy,useActionState:gy,useOptimistic:function(r){var s=Vr();s.memoizedState=s.baseState=r;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=Xh.bind(null,Pt,!0,a),a.dispatch=s,[r,s]},useMemoCache:Vh,useCacheRefresh:function(){return Vr().memoizedState=YS.bind(null,Pt)},useEffectEvent:function(r){var s=Vr(),a={impl:r};return s.memoizedState=a,function(){if((pn&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Qh={readContext:br,use:Lu,useCallback:Iy,useContext:br,useEffect:Wh,useImperativeHandle:_y,useInsertionEffect:Ey,useLayoutEffect:Sy,useMemo:Ty,useReducer:zu,useRef:by,useState:function(){return zu(cs)},useDebugValue:Gh,useDeferredValue:function(r,s){var a=er();return Ry(a,En.memoizedState,r,s)},useTransition:function(){var r=zu(cs)[0],s=er().memoizedState;return[typeof r=="boolean"?r:Gl(r),s]},useSyncExternalStore:ry,useId:Dy,useHostTransitionStatus:Jh,useFormState:my,useActionState:my,useOptimistic:function(r,s){var a=er();return cy(a,En,r,s)},useMemoCache:Vh,useCacheRefresh:Oy};Qh.useEffectEvent=xy;var Ly={readContext:br,use:Lu,useCallback:Iy,useContext:br,useEffect:Wh,useImperativeHandle:_y,useInsertionEffect:Ey,useLayoutEffect:Sy,useMemo:Ty,useReducer:Kh,useRef
vendor: 4,509 bytes, line 9
9:by,useState:function(){return Kh(cs)},useDebugValue:Gh,useDeferredValue:function(r,s){var a=er();return En===null?Yh(a,r,s):Ry(a,En.memoizedState,r,s)},useTransition:function(){var r=Kh(cs)[0],s=er().memoizedState;return[typeof r=="boolean"?r:Gl(r),s]},useSyncExternalStore:ry,useId:Dy,useHostTransitionStatus:Jh,useFormState:wy,useActionState:wy,useOptimistic:function(r,s){var a=er();return En!==null?cy(a,En,r,s):(a.baseState=r,[r,a.queue.dispatch])},useMemoCache:Vh,useCacheRefresh:Oy};Ly.useEffectEvent=xy;function e0(r,s,a,c){s=r.memoizedState,a=a(c,s),a=a==null?s:A({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var t0={enqueueSetState:function(r,s,a){r=r._reactInternals;var c=fi(),d=Ps(c);d.payload=s,a!=null&&(d.callback=a),s=Hs(r,d,c),s!==null&&(Qr(s,r,c),Kl(s,r,c))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var c=fi(),d=Ps(c);d.tag=1,d.payload=s,a!=null&&(d.callback=a),s=Hs(r,d,c),s!==null&&(Qr(s,r,c),Kl(s,r,c))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=fi(),c=Ps(a);c.tag=2,s!=null&&(c.callback=s),s=Hs(r,c,a),s!==null&&(Qr(s,r,a),Kl(s,r,a))}};function zy(r,s,a,c,d,p,R){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,p,R):s.prototype&&s.prototype.isPureReactComponent?!Ul(a,c)||!Ul(d,p):!0}function Py(r,s,a,c){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,c),s.state!==r&&t0.enqueueReplaceState(s,s.state,null)}function za(r,s){var a=s;if("ref"in s){a={};for(var c in s)c!=="ref"&&(a[c]=s[c])}if(r=r.defaultProps){a===s&&(a=A({},a));for(var d in r)a[d]===void 0&&(a[d]=r[d])}return a}function Hy(r){vu(r)}function Vy(r){console.error(r)}function Fy(r){vu(r)}function Fu(r,s){try{var a=r.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function Ky(r,s,a){try{var c=r.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function n0(r,s,a){return a=Ps(a),a.tag=3,a.payload={element:null},a.callback=function(){Fu(r,s)},a}function qy(r){return r=Ps(r),r.tag=3,r}function $y(r,s,a,c){var d=a.type.getDerivedStateFromError;if(typeof d=="function"){var p=c.value;r.payload=function(){return d(p)},r.callback=function(){Ky(s,a,c)}}var R=a.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(r.callback=function(){Ky(s,a,c),typeof d!="function"&&(Ws===null?Ws=new Set([this]):Ws.add(this));var q=c.stack;this.componentDidCatch(c.value,{componentStack:q!==null?q:""})})}function JS(r,s,a,c,d){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=a.alternate,s!==null&&_o(s,a,d,!0),a=oi.current,a!==null){switch(a.tag){case 31:case 13:return Si===null?tf():a.alternate===null&&Gn===0&&(Gn=3),a.flags&=-257,a.flags|=65536,a.lanes=d,c===Mu?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([c]):s.add(c),T0(r,c,d)),!1;case 22:return a.flags|=65536,c===Mu?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([c]):a.add(c)),T0(r,c,d)),!1}throw Error(i(435,a.tag))}return T0(r,c,d),tf(),!1}if(ln)return s=oi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=d,c!==xh&&(r=Error(i(422),{cause:c}),zl(bi(r,a)))):(c!==xh&&(s=Error(i(423),{cause:c}),zl(bi(s,a))),r=r.current.alternate,r.flags|=65536,d&=-d,r.lanes|=d,c=bi(c,a),d=n0(r.stateNode,c,d),Dh(r,d),Gn!==4&&(Gn=2)),!1;var p=Error(i(520),{cause:c});if(p=bi(p,a),ic===null?ic=[p]:ic.push(p),Gn!==4&&(Gn=2),s===null)return!0;c=bi(c,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,r=d&-d,a.lanes|=r,r=n0(a.stateNode,c,r),Dh(a,r),!1;case 1:if(s=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Ws===null||!Ws.has(p))))return a.flags|=65536,d&=-d,a.lanes|=d,d=qy(d),$y(d,r,a,c),Dh(a,d),!1}a=a.return}while(a!==null);return!1}var r0=Error(i(461)),ar=!1;function vr(r,s,a,c){s.child=r===null?Zm(s,null,a,c):ja(s,r.child,a,c)}function Wy(r,s,a,c,d){a=a.render;var p=s.ref;if("ref"in c){var R={};for(var q in c)q!=="ref"&&(R[q]=c[q])}else R=c;return Oa(s),c=Lh(r,s,a,R,p,d),q=zh(),r!==null&&!ar?(Ph(r,s,d),us(r,s,d)):(ln&&q&&bh(s),s.flags|=1,vr(r,s,c,d),s.child)}function Gy(r,s,a,c,d){if(r===null){var p=a.type;
vendor: 10,744 bytes, line 9
9return typeof p=="function"&&!mh(p)&&p.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=p,Yy(r,s,p,c,d)):(r=Au(a.type,null,c,s,s.mode,d),r.ref=s.ref,r.return=s,s.child=r)}if(p=r.child,!f0(r,d)){var R=p.memoizedProps;if(a=a.compare,a=a!==null?a:Ul,a(R,c)&&r.ref===s.ref)return us(r,s,d)}return s.flags|=1,r=is(p,c),r.ref=s.ref,r.return=s,s.child=r}function Yy(r,s,a,c,d){if(r!==null){var p=r.memoizedProps;if(Ul(p,c)&&r.ref===s.ref)if(ar=!1,s.pendingProps=c=p,f0(r,d))(r.flags&131072)!==0&&(ar=!0);else return s.lanes=r.lanes,us(r,s,d)}return i0(r,s,a,c,d)}function Zy(r,s,a,c){var d=c.children,p=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,r!==null){for(c=s.child=r.child,d=0;c!==null;)d=d|c.lanes|c.childLanes,c=c.sibling;c=d&~p}else c=0,s.child=null;return Jy(r,s,p,a,c)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&Ru(s,p!==null?p.cachePool:null),p!==null?Qm(s,p):Nh(),ey(s);else return c=s.lanes=536870912,Jy(r,s,p!==null?p.baseLanes|a:a,a,c)}else p!==null?(Ru(s,p.cachePool),Qm(s,p),Fs(),s.memoizedState=null):(r!==null&&Ru(s,null),Nh(),Fs());return vr(r,s,d,a),s.child}function Jl(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Jy(r,s,a,c,d){var p=Rh();return p=p===null?null:{parent:ir._currentValue,pool:p},s.memoizedState={baseLanes:a,cachePool:p},r!==null&&Ru(s,null),Nh(),ey(s),r!==null&&_o(r,s,c,!0),s.childLanes=d,null}function Ku(r,s){return s=$u({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function Xy(r,s,a){return ja(s,r.child,null,a),r=Ku(s,s.pendingProps),r.flags|=2,li(s),s.memoizedState=null,r}function XS(r,s,a){var c=s.pendingProps,d=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(ln){if(c.mode==="hidden")return r=Ku(s,c),s.lanes=536870912,Jl(null,r);if(Uh(s),(r=Nn)?(r=ub(r,Ei),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ks!==null?{id:Ki,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},a=km(r),a.return=s,s.child=a,wr=s,Nn=null)):r=null,r===null)throw js(s);return s.lanes=536870912,null}return Ku(s,c)}var p=r.memoizedState;if(p!==null){var R=p.dehydrated;if(Uh(s),d)if(s.flags&256)s.flags&=-257,s=Xy(r,s,a);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if(ar||_o(r,s,a,!1),d=(a&r.childLanes)!==0,ar||d){if(c=Rn,c!==null&&(R=C(c,a),R!==0&&R!==p.retryLane))throw p.retryLane=R,Ca(r,R),Qr(c,r,R),r0;tf(),s=Xy(r,s,a)}else r=p.treeContext,Nn=Ai(R.nextSibling),wr=s,ln=!0,Us=null,Ei=!1,r!==null&&Lm(s,r),s=Ku(s,c),s.flags|=4096;return s}return r=is(r.child,{mode:c.mode,children:c.children}),r.ref=s.ref,s.child=r,r.return=s,r}function qu(r,s){var a=s.ref;if(a===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(r===null||r.ref!==a)&&(s.flags|=4194816)}}function i0(r,s,a,c,d){return Oa(s),a=Lh(r,s,a,c,void 0,d),c=zh(),r!==null&&!ar?(Ph(r,s,d),us(r,s,d)):(ln&&c&&bh(s),s.flags|=1,vr(r,s,a,d),s.child)}function Qy(r,s,a,c,d,p){return Oa(s),s.updateQueue=null,a=ny(s,c,a,d),ty(r),c=zh(),r!==null&&!ar?(Ph(r,s,p),us(r,s,p)):(ln&&c&&bh(s),s.flags|=1,vr(r,s,a,p),s.child)}function ew(r,s,a,c,d){if(Oa(s),s.stateNode===null){var p=xo,R=a.contextType;typeof R=="object"&&R!==null&&(p=br(R)),p=new a(c,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=t0,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=c,p.state=s.memoizedState,p.refs={},Mh(s),R=a.contextType,p.context=typeof R=="object"&&R!==null?br(R):xo,p.state=s.memoizedState,R=a.getDerivedStateFromProps,typeof R=="function"&&(e0(s,a,R,c),p.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(R=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),R!==p.state&&t0.enqueueReplaceState(p,p.state,null),$l(s,c,p,d),ql(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(r===null){p=s.stateNode;var q=s.memoizedProps,oe=za(a,q);p.props=oe;var Ee=p.context,Oe=a.contextType;R=xo,typeof Oe=="object"&&Oe!==null&&(R=br(Oe));var je=a.getDerivedStateFromProps;Oe=typeof je=="function"||typeof p.getSnapshotBeforeUpdate=="function",q=s.pendingProps!==q,Oe||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(q||Ee!==R)&&Py(s,p,c,R),zs=!1;var Se=s.memoizedState;p.state=Se,$l(s,c,p,d),ql(),Ee=s.memoizedState,q||Se!==Ee||zs?(typeof je=="function"&&(e0(s,a,je,c),Ee=s.memoizedState),(oe=zs||zy(s,a,oe,c,Se,Ee,R))?(Oe||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=Ee),p.props=c,p.state=Ee,p.context=R,c=oe):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{p=s.stateNode,Bh(r,s),R=s.memoizedProps,Oe=za(a,R),p.props=Oe,je=s.pendingProps,Se=p.context,Ee=a.contextType,oe=xo,typeof Ee=="object"&&Ee!==null&&(oe=br(Ee)),q=a.getDerivedStateFromProps,(Ee=typeof q=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(R!==je||Se!==oe)&&Py(s,p,c,oe),zs=!1,Se=s.memoizedState,p.state=Se,$l(s,c,p,d),ql();var De=s.memoizedState;R!==je||Se!==De||zs||r!==null&&r.dependencies!==null&&Iu(r.dependencies)?(typeof q=="function"&&(e0(s,a,q,c),De=s.memoizedState),(Oe=zs||zy(s,a,Oe,c,Se,De,oe)||r!==null&&r.dependencies!==null&&Iu(r.dependencies))?(Ee||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,De,oe),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,De,oe)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||R===r.memoizedProps&&Se===r.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&Se===r.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=De),p.props=c,p.state=De,p.context=oe,c=Oe):(typeof p.componentDidUpdate!="function"||R===r.memoizedProps&&Se===r.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||R===r.memoizedProps&&Se===r.memoizedState||(s.flags|=1024),c=!1)}return p=c,qu(r,s),c=(s.flags&128)!==0,p||c?(p=s.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,r!==null&&c?(s.child=ja(s,r.child,null,d),s.child=ja(s,null,a,d)):vr(r,s,a,d),s.memoizedState=p.state,r=s.child):r=us(r,s,d),r}function tw(r,s,a,c){return Ba(),s.flags|=256,vr(r,s,a,c),s.child}var s0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function a0(r){return{baseLanes:r,cachePool:Km()}}function o0(r,s,a){return r=r!==null?r.childLanes&~a:0,s&&(r|=ui),r}function nw(r,s,a){var c=s.pendingProps,d=!1,p=(s.flags&128)!==0,R;if((R=p)||(R=r!==null&&r.memoizedState===null?!1:(Qn.current&2)!==0),R&&(d=!0,s.flags&=-129),R=(s.flags&32)!==0,s.flags&=-33,r===null){if(ln){if(d?Vs(s):Fs(),(r=Nn)?(r=ub(r,Ei),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:ks!==null?{id:Ki,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},a=km(r),a.return=s,s.child=a,wr=s,Nn=null)):r=null,r===null)throw js(s);return F0(r)?s.lanes=32:s.lanes=536870912,null}var q=c.children;return c=c.fallback,d?(Fs(),d=s.mode,q=$u({mode:"hidden",children:q},d),c=Ma(c,d,a,null),q.return=s,c.return=s,q.sibling=c,s.child=q,c=s.child,c.memoizedState=a0(a),c.childLanes=o0(r,R,a),s.memoizedState=s0,Jl(null,c)):(Vs(s),l0(s,q))}var oe=r.memoizedState;if(oe!==null&&(q=oe.dehydrated,q!==null)){if(p)s.flags&256?(Vs(s),s.flags&=-257,s=c0(r,s,a)):s.memoizedState!==null?(Fs(),s.child=r.child,s.flags|=128,s=null):(Fs(),q=c.fallback,d=s.mode,c=$u({mode:"visible",children:c.children},d),q=Ma(q,d,a,null),q.flags|=2,c.return=s,q.return=s,c.sibling=q,s.child=c,ja(s,r.child,null,a),c=s.child,c.memoizedState=a0(a),c.childLanes=o0(r,R,a),s.memoizedState=s0,s=Jl(null,c));else if(Vs(s),F0(q)){if(R=q.nextSibling&&q.nextSibling.dataset,R)var Ee=R.dgst;R=Ee,c=Error(i(419)),c.stack="",c.digest=R,zl({value:c,source:null,stack:null}),s=c0(r,s,a)}else if(ar||_o(r,s,a,!1),R=(a&r.childLanes)!==0,ar||R){if(R=Rn,R!==null&&(c=C(R,a),c!==0&&c!==oe.retryLane))throw oe.retryLane=c,Ca(r,c),Qr(R,r,c),r0;V0(q)||tf(),s=c0(r,s,a)}else V0(q)?(s.flags|=192,s.child=r.child,s=null):(r=oe.treeContext,Nn=Ai(q.nextSibling),wr=s,ln=!0,Us=null,Ei=!1,r!==null&&Lm(s,r),s=l0(s,c.children),s.flags|=4096);return s}return d?(Fs(),q=c.fallback,d=s.mode,oe=r.child,Ee=oe.sibling,c=is(oe,{mode:"hidden",children:c.children}),c.subtreeFlags=oe.subtreeFlags&65011712,Ee!==null?q=is(Ee,q):(q=Ma(q,d,a,null),q.flags|=2),q.return=s,c.return=s,c.sibling=q,s.child=c,Jl(null,c),c=s.child,q=r.child.memoizedState,q===null?q=a0(a):(d=q.cachePool,d!==null?(oe=ir._currentValue,d=d.parent!==oe?{parent:oe,pool:oe}:d):d=Km(),q={baseLanes:q.baseLanes|a,cachePool:d}),c.memoizedState=q,c.childLanes=o0(r,R,a),s.memoizedState=s0,Jl(r.child,c)):(Vs(s),a=r.child,r=a.sibling,a=is(a,{mode:"visible",children:c.children}),a.return=s,a.sibling=null,r!==null&&(R=s.deletions,R===null?(s.deletions=[r],s.flags|=16):R.push(r)),s.child=a,s.memoizedState=null,a)}function l0(r,s){return s=$u({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function $u(r,s){return r=ai(22,r,null,s),r.lanes=0,r}function c0(r,s,a){return ja(s,r.child,null,a),r=l0(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function rw(r,s,a){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s),Ah(r.return,s,a)}function u0(r,s,a,c,d,p){var R=r.memoizedState;R===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:d,treeForkCount:p}:(R.isBackwards=s,R.rendering=null,R.renderingStartTime=0,R.last=c,R.tail=a,R.tailMode=d,R.treeForkCount=p)}function iw(r,s,a){var c=s.pendingProps,d=c.revealOrder,p=c.tail;c=c.children;var R=Qn.current,q=(R&2)!==0;
vendor: 2,620 bytes, line 9
9if(q?(R=R&1|2,s.flags|=128):R&=1,b(Qn,R),vr(r,s,c,a),c=ln?Ll:0,!q&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&rw(r,a,s);else if(r.tag===19)rw(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(d){case"forwards":for(a=s.child,d=null;a!==null;)r=a.alternate,r!==null&&Nu(r)===null&&(d=a),a=a.sibling;a=d,a===null?(d=s.child,s.child=null):(d=a.sibling,a.sibling=null),u0(s,!1,d,a,p,c);break;case"backwards":case"unstable_legacy-backwards":for(a=null,d=s.child,s.child=null;d!==null;){if(r=d.alternate,r!==null&&Nu(r)===null){s.child=d;break}r=d.sibling,d.sibling=a,a=d,d=r}u0(s,!0,a,null,p,c);break;case"together":u0(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function us(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),$s|=s.lanes,(a&s.childLanes)===0)if(r!==null){if(_o(r,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,a=is(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=is(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function f0(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Iu(r)))}function QS(r,s,a){switch(s.tag){case 3:Te(s,s.stateNode.containerInfo),Ls(s,ir,r.memoizedState.cache),Ba();break;case 27:case 5:Xe(s);break;case 4:Te(s,s.stateNode.containerInfo);break;case 10:Ls(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Uh(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(Vs(s),s.flags|=128,null):(a&s.child.childLanes)!==0?nw(r,s,a):(Vs(s),r=us(r,s,a),r!==null?r.sibling:null);Vs(s);break;case 19:var d=(r.flags&128)!==0;if(c=(a&s.childLanes)!==0,c||(_o(r,s,a,!1),c=(a&s.childLanes)!==0),d){if(c)return iw(r,s,a);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),b(Qn,Qn.current),c)break;return null;case 22:return s.lanes=0,Zy(r,s,a,s.pendingProps);case 24:Ls(s,ir,r.memoizedState.cache)}return us(r,s,a)}function sw(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps)ar=!0;else{if(!f0(r,a)&&(s.flags&128)===0)return ar=!1,QS(r,s,a);ar=(r.flags&131072)!==0}else ar=!1,ln&&(s.flags&1048576)!==0&&jm(s,Ll,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(r=ka(s.elementType),s.type=r,typeof r=="function")mh(r)?(c=za(r,c),s.tag=1,s=ew(null,s,r,c,a)):(s.tag=0,s=i0(null,
vendor: 4,211 bytes, line 9
9s,r,c,a));else{if(r!=null){var d=r.$$typeof;if(d===se){s.tag=11,s=Wy(null,s,r,c,a);break e}else if(d===pe){s.tag=14,s=Gy(null,s,r,c,a);break e}}throw s=g(r)||r,Error(i(306,s,""))}}return s;case 0:return i0(r,s,s.type,s.pendingProps,a);case 1:return c=s.type,d=za(c,s.pendingProps),ew(r,s,c,d,a);case 3:e:{if(Te(s,s.stateNode.containerInfo),r===null)throw Error(i(387));c=s.pendingProps;var p=s.memoizedState;d=p.element,Bh(r,s),$l(s,c,null,a);var R=s.memoizedState;if(c=R.cache,Ls(s,ir,c),c!==p.cache&&_h(s,[ir],a,!0),ql(),c=R.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:R.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=tw(r,s,c,a);break e}else if(c!==d){d=bi(Error(i(424)),s),zl(d),s=tw(r,s,c,a);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Nn=Ai(r.firstChild),wr=s,ln=!0,Us=null,Ei=!0,a=Zm(s,null,c,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ba(),c===d){s=us(r,s,a);break e}vr(r,s,c,a)}s=s.child}return s;case 26:return qu(r,s),r===null?(a=mb(s.type,null,s.pendingProps,null))?s.memoizedState=a:ln||(a=s.type,r=s.pendingProps,c=cf(ne.current).createElement(a),c[he]=s,c[Ie]=r,xr(c,a,r),st(c),s.stateNode=c):s.memoizedState=mb(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Xe(s),r===null&&ln&&(c=s.stateNode=hb(s.type,s.pendingProps,ne.current),wr=s,Ei=!0,d=Nn,Js(s.type)?(K0=d,Nn=Ai(c.firstChild)):Nn=d),vr(r,s,s.pendingProps.children,a),qu(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&ln&&((d=c=Nn)&&(c=C4(c,s.type,s.pendingProps,Ei),c!==null?(s.stateNode=c,wr=s,Nn=Ai(c.firstChild),Ei=!1,d=!0):d=!1),d||js(s)),Xe(s),d=s.type,p=s.pendingProps,R=r!==null?r.memoizedProps:null,c=p.children,z0(d,p)?c=null:R!==null&&z0(d,R)&&(s.flags|=32),s.memoizedState!==null&&(d=Lh(r,s,KS,null,null,a),dc._currentValue=d),qu(r,s),vr(r,s,c,a),s.child;case 6:return r===null&&ln&&((r=a=Nn)&&(a=M4(a,s.pendingProps,Ei),a!==null?(s.stateNode=a,wr=s,Nn=null,r=!0):r=!1),r||js(s)),null;case 13:return nw(r,s,a);case 4:return Te(s,s.stateNode.containerInfo),c=s.pendingProps,r===null?s.child=ja(s,null,c,a):vr(r,s,c,a),s.child;case 11:return Wy(r,s,s.type,s.pendingProps,a);case 7:return vr(r,s,s.pendingProps,a),s.child;case 8:return vr(r,s,s.pendingProps.children,a),s.child;case 12:return vr(r,s,s.pendingProps.children,a),s.child;case 10:return c=s.pendingProps,Ls(s,s.type,c.value),vr(r,s,c.children,a),s.child;case 9:return d=s.type._context,c=s.pendingProps.children,Oa(s),d=br(d),c=c(d),s.flags|=1,vr(r,s,c,a),s.child;case 14:return Gy(r,s,s.type,s.pendingProps,a);case 15:return Yy(r,s,s.type,s.pendingProps,a);case 19:return iw(r,s,a);case 31:return XS(r,s,a);case 22:return Zy(r,s,a,s.pendingProps);case 24:return Oa(s),c=br(ir),r===null?(d=Rh(),d===null&&(d=Rn,p=Ih(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=a),d=p),s.memoizedState={parent:c,cache:d},Mh(s),Ls(s,ir,d)):((r.lanes&a)!==0&&(Bh(r,s),$l(s,null,null,a),ql()),d=r.memoizedState,p=s.memoizedState,d.parent!==c?(d={parent:c,cache:c},s.memoizedState=d,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=d),Ls(s,ir,c)):(c=p.cache,Ls(s,ir,c),c!==d.cache&&_h(s,[ir],a,!0))),vr(r,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function fs(r){r.flags|=4}function d0(r,s,a,c,d){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(d&335544128)===d)if(r.stateNode.complete)r.flags|=8192;else if(Dw())r.flags|=8192;else throw Ua=Mu,Ch}else r.flags&=-16777217}function aw(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!xb(s))if(Dw())r.flags|=8192;else throw Ua=Mu,Ch}function Wu(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?Tn():536870912,r.lanes|=s,jo|=s)}function Xl(r,s){if(!ln)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function kn(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,
vendor: 5,989 bytes, line 9
9c=0;if(s)for(var d=r.child;d!==null;)a|=d.lanes|d.childLanes,c|=d.subtreeFlags&65011712,c|=d.flags&65011712,d.return=r,d=d.sibling;else for(d=r.child;d!==null;)a|=d.lanes|d.childLanes,c|=d.subtreeFlags,c|=d.flags,d.return=r,d=d.sibling;return r.subtreeFlags|=c,r.childLanes=a,s}function e4(r,s,a){var c=s.pendingProps;switch(vh(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return kn(s),null;case 1:return kn(s),null;case 3:return a=s.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),os(ir),ve(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(r===null||r.child===null)&&(Ao(s)?fs(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Eh())),kn(s),null;case 26:var d=s.type,p=s.memoizedState;return r===null?(fs(s),p!==null?(kn(s),aw(s,p)):(kn(s),d0(s,d,null,c,a))):p?p!==r.memoizedState?(fs(s),kn(s),aw(s,p)):(kn(s),s.flags&=-16777217):(r=r.memoizedProps,r!==c&&fs(s),kn(s),d0(s,d,r,c,a)),null;case 27:if(mt(s),a=ne.current,d=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&fs(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return kn(s),null}r=O.current,Ao(s)?zm(s):(r=hb(d,c,a),s.stateNode=r,fs(s))}return kn(s),null;case 5:if(mt(s),d=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&fs(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return kn(s),null}if(p=O.current,Ao(s))zm(s);else{var R=cf(ne.current);switch(p){case 1:p=R.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=R.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=R.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=R.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=R.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof c.is=="string"?R.createElement("select",{is:c.is}):R.createElement("select"),c.multiple?p.multiple=!0:c.size&&(p.size=c.size);break;default:p=typeof c.is=="string"?R.createElement(d,{is:c.is}):R.createElement(d)}}p[he]=s,p[Ie]=c;e:for(R=s.child;R!==null;){if(R.tag===5||R.tag===6)p.appendChild(R.stateNode);else if(R.tag!==4&&R.tag!==27&&R.child!==null){R.child.return=R,R=R.child;continue}if(R===s)break e;for(;R.sibling===null;){if(R.return===null||R.return===s)break e;R=R.return}R.sibling.return=R.return,R=R.sibling}s.stateNode=p;e:switch(xr(p,d,c),d){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&fs(s)}}return kn(s),d0(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,a),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==c&&fs(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(i(166));if(r=ne.current,Ao(s)){if(r=s.stateNode,a=s.memoizedProps,c=null,d=wr,d!==null)switch(d.tag){case 27:case 5:c=d.memoizedProps}r[he]=s,r=!!(r.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||nb(r.nodeValue,a)),r||js(s,!0)}else r=cf(r).createTextNode(c),r[he]=s,s.stateNode=r}return kn(s),null;case 31:if(a=s.memoizedState,r===null||r.memoizedState!==null){if(c=Ao(s),a!==null){if(r===null){if(!c)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[he]=s}else Ba(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),r=!1}else a=Eh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=a),r=!0;if(!r)return s.flags&256?(li(s),s):(li(s),null);if((s.flags&128)!==0)throw Error(i(558))}return kn(s),null;case 13:if(c=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(d=Ao(s),c!==null&&c.dehydrated!==null){if(r===null){if(!d)throw Error(i(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(i(317));d[he]=s}else Ba(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kn(s),d=!1}else d=Eh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(li(s),s):(li(s),null)}return li(s),(s.flags&128)!==0?(s.lanes=a,s):(a=c!==null,r=r!==null&&r.memoizedState!==null,a&&(c=s.child,d=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(d=c.alternate.memoizedState.cachePool.pool),p=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==d&&(c.flags|=2048)),a!==r&&a&&(s.child.flags|=8192),Wu(s,s.updateQueue),kn(s),null);case 4:return ve(),r===null&&N0(s.stateNode.containerInfo),kn(s),null;case 10:return os(s.type),kn(s),null;case 19:if(m(Qn),c=s.memoizedState,c===null)return kn(s),null;if(d=(s.flags&128)!==0,p=c.rendering,p===null)if(d)Xl(c,!1);else{if(Gn!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(p=Nu(r),p!==null){for(s.flags|=128,Xl(c,!1),r=p.updateQueue,s.updateQueue=r,Wu(s,r),s.subtreeFlags=0,r=a,a=s.child;a!==null;)Nm(a,r),a=a.sibling;return b(Qn,Qn.current&1|2),ln&&ss(s,c.treeForkCount),s.child}r=r.sibling}c.tail!==null&&qe()>Xu&&(s.flags|=128,d=!0,Xl(c,!1),s.lanes=4194304)}else{if(!d)if(r=Nu(p),r!==null){if(s.flags|=128,d=!0,r=r.updateQueue,s.updateQueue=r,Wu(s,r),Xl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!ln)return kn(s),null}else 2*qe()-c.renderingStartTime>Xu&&a!==536870912&&(s.flags|=128,d=!0,Xl(c,!1),s.lanes=4194304);c.isBackwards?(p.sibling=s.child,s.child=p):(r=c.last,r!==null?r.sibling=p:s.child=p,c.last=p)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=qe(),r.sibling=null,a=Qn.current,b(Qn,d?a&1|2:a&1),ln&&ss(s,c.treeForkCount),r):(kn(s),null);case 22:case 23:return li(s),kh(),c=s.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(a&536870912)!==0&&(s.flags&128)===0&&(kn(s),s.subtreeFlags&6&&(s.flags|=8192)):kn(s),a=s.updateQueue,a!==null&&Wu(s,a.retryQueue),a=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),c=null,
vendor: 20,756 bytes, line 9
9s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==a&&(s.flags|=2048),r!==null&&m(Na),null;case 24:return a=null,r!==null&&(a=r.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),os(ir),kn(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function t4(r,s){switch(vh(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return os(ir),ve(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return mt(s),null;case 31:if(s.memoizedState!==null){if(li(s),s.alternate===null)throw Error(i(340));Ba()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(li(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));Ba()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return m(Qn),null;case 4:return ve(),null;case 10:return os(s.type),null;case 22:case 23:return li(s),kh(),r!==null&&m(Na),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return os(ir),null;case 25:return null;default:return null}}function ow(r,s){switch(vh(s),s.tag){case 3:os(ir),ve();break;case 26:case 27:case 5:mt(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&li(s);break;case 13:li(s);break;case 19:m(Qn);break;case 10:os(s.type);break;case 22:case 23:li(s),kh(),r!==null&&m(Na);break;case 24:os(ir)}}function Ql(r,s){try{var a=s.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var d=c.next;a=d;do{if((a.tag&r)===r){c=void 0;var p=a.create,R=a.inst;c=p(),R.destroy=c}a=a.next}while(a!==d)}}catch(q){wn(s,s.return,q)}}function Ks(r,s,a){try{var c=s.updateQueue,d=c!==null?c.lastEffect:null;if(d!==null){var p=d.next;c=p;do{if((c.tag&r)===r){var R=c.inst,q=R.destroy;if(q!==void 0){R.destroy=void 0,d=s;var oe=a,Ee=q;try{Ee()}catch(Oe){wn(d,oe,Oe)}}}c=c.next}while(c!==p)}}catch(Oe){wn(s,s.return,Oe)}}function lw(r){var s=r.updateQueue;if(s!==null){var a=r.stateNode;try{Xm(s,a)}catch(c){wn(r,r.return,c)}}}function cw(r,s,a){a.props=za(r.type,r.memoizedProps),a.state=r.memoizedState;try{a.componentWillUnmount()}catch(c){wn(r,s,c)}}function ec(r,s){try{var a=r.ref;if(a!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof a=="function"?r.refCleanup=a(c):a.current=c}}catch(d){wn(r,s,d)}}function $i(r,s){var a=r.ref,c=r.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(d){wn(r,s,d)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(d){wn(r,s,d)}else a.current=null}function uw(r){var s=r.type,a=r.memoizedProps,c=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(d){wn(r,r.return,d)}}function h0(r,s,a){try{var c=r.stateNode;S4(c,r.type,a,s),c[Ie]=s}catch(d){wn(r,r.return,d)}}function fw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Js(r.type)||r.tag===4}function p0(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||fw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Js(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function g0(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(r,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(r),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=ns));else if(c!==4&&(c===27&&Js(r.type)&&(a=r.stateNode,s=null),r=r.child,r!==null))for(g0(r,s,a),r=r.sibling;r!==null;)g0(r,s,a),r=r.sibling}function Gu(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(c!==4&&(c===27&&Js(r.type)&&(a=r.stateNode),r=r.child,r!==null))for(Gu(r,s,a),r=r.sibling;r!==null;)Gu(r,s,a),r=r.sibling}function dw(r){var s=r.stateNode,a=r.memoizedProps;try{for(var c=r.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);xr(s,c,a),s[he]=r,s[Ie]=a}catch(p){wn(r,r.return,p)}}var ds=!1,or=!1,m0=!1,hw=typeof WeakSet=="function"?WeakSet:Set,hr=null;function n4(r,s){if(r=r.containerInfo,j0=mf,r=_m(r),ch(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var d=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var R=0,q=-1,oe=-1,Ee=0,Oe=0,je=r,Se=null;t:for(;;){for(var De;je!==a||d!==0&&je.nodeType!==3||(q=R+d),je!==p||c!==0&&je.nodeType!==3||(oe=R+c),je.nodeType===3&&(R+=je.nodeValue.length),(De=je.firstChild)!==null;)Se=je,je=De;for(;;){if(je===r)break t;if(Se===a&&++Ee===d&&(q=R),Se===p&&++Oe===c&&(oe=R),(De=je.nextSibling)!==null)break;je=Se,Se=je.parentNode}je=De}a=q===-1||oe===-1?null:{start:q,end:oe}}else a=null}a=a||{start:0,end:0}}else a=null;for(L0={focusedElem:r,selectionRange:a},mf=!1,hr=s;hr!==null;)if(s=hr,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,hr=r;else for(;hr!==null;){switch(s=hr,p=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(a=0;a<r.length;a++)d=r[a],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&p!==null){r=void 0,a=s,d=p.memoizedProps,p=p.memoizedState,c=a.stateNode;try{var ct=za(a.type,d);r=c.getSnapshotBeforeUpdate(ct,p),c.__reactInternalSnapshotBeforeUpdate=r}catch(It){wn(a,a.return,It)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,a=r.nodeType,a===9)H0(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":H0(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,hr=r;break}hr=s.return}}function pw(r,s,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:ps(r,a),c&4&&Ql(5,a);break;case 1:if(ps(r,a),c&4)if(r=a.stateNode,s===null)try{r.componentDidMount()}catch(R){wn(a,a.return,R)}else{var d=za(a.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(d,s,r.__reactInternalSnapshotBeforeUpdate)}catch(R){wn(a,a.return,R)}}c&64&&lw(a),c&512&&ec(a,a.return);break;case 3:if(ps(r,a),c&64&&(r=a.updateQueue,r!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{Xm(r,s)}catch(R){wn(a,a.return,R)}}break;case 27:s===null&&c&4&&dw(a);case 26:case 5:ps(r,a),s===null&&c&4&&uw(a),c&512&&ec(a,a.return);break;case 12:ps(r,a);break;case 31:ps(r,a),c&4&&yw(r,a);break;case 13:ps(r,a),c&4&&ww(r,a),c&64&&(r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(a=f4.bind(null,a),B4(r,a))));break;case 22:if(c=a.memoizedState!==null||ds,!c){s=s!==null&&s.memoizedState!==null||or,d=ds;var p=or;ds=c,(or=s)&&!p?gs(r,a,(a.subtreeFlags&8772)!==0):ps(r,a),ds=d,or=p}break;case 30:break;default:ps(r,a)}}function gw(r){var s=r.alternate;s!==null&&(r.alternate=null,gw(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&xt(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Hn=null,Yr=!1;function hs(r,s,a){for(a=a.child;a!==null;)mw(r,s,a),a=a.sibling}function mw(r,s,a){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Re,a)}catch{}switch(a.tag){case 26:or||$i(a,s),hs(r,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:or||$i(a,s);var c=Hn,d=Yr;Js(a.type)&&(Hn=a.stateNode,Yr=!1),hs(r,s,a),cc(a.stateNode),Hn=c,Yr=d;break;case 5:or||$i(a,s);case 6:if(c=Hn,d=Yr,Hn=null,hs(r,s,a),Hn=c,Yr=d,Hn!==null)if(Yr)try{(Hn.nodeType===9?Hn.body:Hn.nodeName==="HTML"?Hn.ownerDocument.body:Hn).removeChild(a.stateNode)}catch(p){wn(a,s,p)}else try{Hn.removeChild(a.stateNode)}catch(p){wn(a,s,p)}break;case 18:Hn!==null&&(Yr?(r=Hn,lb(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,a.stateNode),qo(r)):lb(Hn,a.stateNode));break;case 4:c=Hn,d=Yr,Hn=a.stateNode.containerInfo,Yr=!0,hs(r,s,a),Hn=c,Yr=d;break;case 0:case 11:case 14:case 15:Ks(2,a,s),or||Ks(4,a,s),hs(r,s,a);break;case 1:or||($i(a,s),c=a.stateNode,typeof c.componentWillUnmount=="function"&&cw(a,s,c)),hs(r,s,a);break;case 21:hs(r,s,a);break;case 22:or=(c=or)||a.memoizedState!==null,hs(r,s,a),or=c;break;default:hs(r,s,a)}}function yw(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{qo(r)}catch(a){wn(s,s.return,a)}}}function ww(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{qo(r)}catch(a){wn(s,s.return,a)}}function r4(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new hw),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new hw),s;default:throw Error(i(435,r.tag))}}function Yu(r,s){var a=r4(r);s.forEach(function(c){if(!a.has(c)){a.add(c);var d=d4.bind(null,r,c);c.then(d,d)}})}function Zr(r,s){var a=s.deletions;if(a!==null)for(var c=0;c<a.length;c++){var d=a[c],p=r,R=s,q=R;e:for(;q!==null;){switch(q.tag){case 27:if(Js(q.type)){Hn=q.stateNode,Yr=!1;break e}break;case 5:Hn=q.stateNode,Yr=!1;break e;case 3:case 4:Hn=q.stateNode.containerInfo,Yr=!0;break e}q=q.return}if(Hn===null)throw Error(i(160));mw(p,R,d),Hn=null,Yr=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)bw(s,r),s=s.sibling}var Ui=null;function bw(r,s){var a=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Zr(s,r),Jr(r),c&4&&(Ks(3,r,r.return),Ql(3,r),Ks(5,r,r.return));break;case 1:Zr(s,r),Jr(r),c&512&&(or||a===null||$i(a,a.return)),c&64&&ds&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(a=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=a===null?c:a.concat(c))));break;case 26:var d=Ui;if(Zr(s,r),Jr(r),c&512&&(or||a===null||$i(a,a.return)),c&4){var p=a!==null?a.memoizedState:null;if(c=r.memoizedState,a===null)if(c===null)if(r.stateNode===null){e:{c=r.type,a=r.memoizedProps,d=d.ownerDocument||d;t:switch(c){case"title":p=d.getElementsByTagName("title")[0],(!p||p[gt]||p[he]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(c),d.head.insertBefore(p,d.querySelector("head > title"))),xr(p,c,a),p[he]=r,st(p),c=p;break e;case"link":var R=bb("link","href",d).get(c+(a.href||""));if(R){for(var q=0;q<R.length;q++)if(p=R[q],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){R.splice(q,1);break t}}p=d.createElement(c),xr(p,c,a),d.head.appendChild(p);break;case"meta":if(R=bb("meta","content",d).get(c+(a.content||""))){for(q=0;q<R.length;q++)if(p=R[q],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){R.splice(q,1);break t}}p=d.createElement(c),xr(p,c,a),d.head.appendChild(p);break;default:throw Error(i(468,c))}p[he]=r,st(p),c=p}r.stateNode=c}else vb(d,r.type,r.stateNode);else r.stateNode=wb(d,c,r.memoizedProps);else p!==c?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,c===null?vb(d,r.type,r.stateNode):wb(d,c,r.memoizedProps)):c===null&&r.stateNode!==null&&h0(r,r.memoizedProps,a.memoizedProps)}break;case 27:Zr(s,r),Jr(r),c&512&&(or||a===null||$i(a,a.return)),a!==null&&c&4&&h0(r,r.memoizedProps,a.memoizedProps);break;case 5:if(Zr(s,r),Jr(r),c&512&&(or||a===null||$i(a,a.return)),r.flags&32){d=r.stateNode;try{mn(d,"")}catch(ct){wn(r,r.return,ct)}}c&4&&r.stateNode!=null&&(d=r.memoizedProps,h0(r,d,a!==null?a.memoizedProps:d)),c&1024&&(m0=!0);break;case 6:if(Zr(s,r),Jr(r),c&4){if(r.stateNode===null)throw Error(i(162));c=r.memoizedProps,a=r.stateNode;try{a.nodeValue=c}catch(ct){wn(r,r.return,ct)}}break;case 3:if(df=null,d=Ui,Ui=uf(s.containerInfo),Zr(s,r),Ui=d,Jr(r),c&4&&a!==null&&a.memoizedState.isDehydrated)try{qo(s.containerInfo)}catch(ct){wn(r,r.return,ct)}m0&&(m0=!1,vw(r));break;case 4:c=Ui,Ui=uf(r.stateNode.containerInfo),Zr(s,r),Jr(r),Ui=c;break;case 12:Zr(s,r),Jr(r);break;case 31:Zr(s,r),Jr(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Yu(r,c)));break;case 13:Zr(s,r),Jr(r),r.child.flags&8192&&r.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ju=qe()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Yu(r,c)));break;case 22:d=r.memoizedState!==null;var oe=a!==null&&a.memoizedState!==null,Ee=ds,Oe=or;if(ds=Ee||d,or=Oe||oe,Zr(s,r),or=Oe,ds=Ee,Jr(r),c&8192)e:for(s=r.stateNode,s._visibility=d?s._visibility&-2:s._visibility|1,d&&(a===null||oe||ds||or||Pa(r)),a=null,s=r;;){if(s.tag===5||s.tag===26){if(a===null){oe=a=s;try{if(p=oe.stateNode,d)R=p.style,typeof R.setProperty=="function"?R.setProperty("display","none","important"):R.display="none";else{q=oe.stateNode;var je=oe.memoizedProps.style,Se=je!=null&&je.hasOwnProperty("display")?je.display:null;q.style.display=Se==null||typeof Se=="boolean"?"":(""+Se).trim()}}catch(ct){wn(oe,oe.return,ct)}}}else if(s.tag===6){if(a===null){oe=s;try{oe.stateNode.nodeValue=d?"":oe.memoizedProps}catch(ct){wn(oe,oe.return,ct)}}}else if(s.tag===18){if(a===null){oe=s;try{var De=oe.stateNode;d?cb(De,!0):cb(oe.stateNode,!1)}catch(ct){wn(oe,oe.return,ct)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=r.updateQueue,c!==null&&(a=c.retryQueue,a!==null&&(c.retryQueue=null,Yu(r,a))));break;case 19:Zr(s,r),Jr(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,Yu(r,c)));break;case 30:break;case 21:break;default:Zr(s,r),Jr(r)}}function Jr(r){var s=r.flags;if(s&2){try{for(var a,c=r.return;c!==null;){if(fw(c)){a=c;break}c=c.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var d=a.stateNode,p=p0(r);Gu(r,p,d);break;case 5:var R=a.stateNode;a.flags&32&&(mn(R,""),a.flags&=-33);var q=p0(r);Gu(r,q,R);break;case 3:case 4:var oe=a.stateNode.containerInfo,Ee=p0(r);g0(r,Ee,oe);break;default:throw Error(i(161))}}catch(Oe){wn(r,r.return,Oe)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function vw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;vw(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function ps(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)pw(r,s.alternate,s),s=s.sibling}function Pa(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:Ks(4,s,s.return),Pa(s);break;case 1:$i(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&cw(s,s.return,a),Pa(s);break;case 27:cc(s.stateNode);case 26:case 5:$i(s,s.return),Pa(s);break;case 22:s.memoizedState===null&&Pa(s);break;case 30:Pa(s);break;default:Pa(s)}r=r.sibling}}function gs(r,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,d=r,p=s,R=p.flags;switch(p.tag){case 0:case 11:case 15:gs(d,p,a),Ql(4,p);break;case 1:if(gs(d,p,a),c=p,d=c.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(Ee){wn(c,c.return,Ee)}if(c=p,d=c.updateQueue,d!==null){var q=c.stateNode;try{var oe=d.shared.hiddenCallbacks;if(oe!==null)for(d.shared.hiddenCallbacks=null,d=0;d<oe.length;d++)Jm(oe[d],q)}catch(Ee){wn(c,c.return,Ee)}}a&&R&64&&lw(p),ec(p,p.return);break;case 27:dw(p);case 26:case 5:gs(d,p,a),a&&c===null&&R&4&&uw(p),ec(p,p.return);break;case 12:gs(d,p,a);break;case 31:gs(d,p,a),a&&R&4&&yw(d,p);break;case 13:gs(d,p,a),a&&R&4&&ww(d,p);break;case 22:p.memoizedState===null&&gs(d,p,a),ec(p,p.return);break;case 30:break;default:gs(d,p,a)}s=s.sibling}}function y0(r,s){var a=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==a&&(r!=null&&r.refCount++,a!=null&&Pl(a))}function w0(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Pl(r))}function ji(r,s,a,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)xw(r,s,a,c),s=s.sibling}function xw(r,s,a,c){var d=s.flags;switch(s.tag){case 0:case 11:case 15:ji(r,s,a,c),d&2048&&Ql(9,s);break;case 1:ji(r,s,a,c);break;case 3:ji(r,s,a,c),d&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Pl(r)));break;case 12:if(d&2048){ji(r,s,a,c),r=s.stateNode;try{var p=s.memoizedProps,R=p.id,q=p.onPostCommit;typeof q=="function"&&q(R,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(oe){wn(s,s.return,oe)}}else ji(r,s,a,c);break;case 31:ji(r,s,a,c);break;case 13:ji(r,s,a,c);break;case 23:break;case 22:p=s.stateNode,R=s.alternate,s.memoizedState!==null?p._visibility&2?ji(r,s,a,c):tc(r,s):p._visibility&2?ji(r,s,a,c):(p._visibility|=2,No(r,s,a,c,(s.subtreeFlags&10256)!==0||!1)),d&2048&&y0(R,s);break;case 24:ji(r,s,a,c),d&2048&&w0(s.alternate,s);break;default:ji(r,s,a,c)}}function No(r,s,a,c,d){for(d=d&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=r,R=s,q=a,oe=c,Ee=R.flags;switch(R.tag){case 0:case 11:case 15:No(p,R,q,oe,d),Ql(8,R);break;case 23:break;case 22:var Oe=R.stateNode;R.memoizedState!==null?Oe._visibility&2?No(p,R,q,oe,d):tc(p,R):(Oe._visibility|=2,No(p,R,q,oe,d)),d&&Ee&2048&&y0(R.alternate,R);break;case 24:No(p,R,q,oe,d),d&&Ee&2048&&w0(R.alternate,R);break;default:No(p,R,q,oe,d)}s=s.sibling}}function tc(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=r,c=s,d=c.flags;switch(c.tag){case 22:tc(a,c),d&2048&&y0(c.alternate,c);break;case 24:tc(a,c),d&2048&&w0(c.alternate,c);break;default:tc(a,c)}s=s.sibling}}var nc=8192;function ko(r,s,a){if(r.subtreeFlags&nc)for(r=r.child;r!==null;)Ew(r,s,a),r=r.sibling}function Ew(r,s,a){switch(r.tag){case 26:ko(r,s,a),r.flags&nc&&r.memoizedState!==null&&F4(a,Ui,r.memoizedState,r.memoizedProps);break;case 5:ko(r,s,a);break;case 3:case 4:var c=Ui;Ui=uf(r.stateNode.containerInfo),ko(r,s,a),Ui=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=nc,nc=16777216,ko(r,s,a),nc=c):ko(r,s,a));break;default:ko(r,s,a)}}function Sw(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function rc(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var c=s[a];hr=c,_w(c,r)}Sw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Aw(r),r=r.sibling}function Aw(r){switch(r.tag){case 0:case 11:case 15:rc(r),r.flags&2048&&Ks(9,r,r.return);break;case 3:rc(r);break;case 12:rc(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,Zu(r)):rc(r);break;default:rc(r)}}function Zu(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var c=s[a];hr=c,_w(c,r)}Sw(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:Ks(8,s,s.return),Zu(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,Zu(s));break;default:Zu(s)}r=r.sibling}}function _w(r,s){for(;hr!==null;){var a=hr;switch(a.tag){case 0:case 11:case 15:Ks(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Pl(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,hr=c;else e:for(a=r;hr!==null;){c=hr;var d=c.sibling,p=c.return;if(gw(c),c===a){hr=null;break e}if(d!==null){d.return=p,hr=d;break e}hr=p}}}var i4={getCacheForType:function(r){var s=br(ir),a=s.data.get(r);return a===void 0&&(a=r(),s.data.set(r,a)),a},cacheSignal:function(){return br(ir).controller.signal}},s4=typeof WeakMap=="function"?WeakMap:Map,pn=0,Rn=null,en=null,nn=0,yn=0,ci=null,qs=!1,Uo=!1,b0=!1,ms=0,Gn=0,$s=0,Ha=0,v0=0,ui=0,jo=0,ic=null,Xr=null,x0=!1,Ju=0,Iw=0,Xu=1/0,Qu=null,Ws=null,ur=0,Gs=null,Lo=null,ys=0,E0=0,S0=null,Tw=null,sc=0,A0=null;function fi(){return(pn&2)!==0&&nn!==0?nn&-nn:E.T!==null?M0():x()}function Rw(){if(ui===0)if((nn&536870912)===0||ln){var r=vn;
vendor: 4,383 bytes, line 9
9vn<<=1,(vn&3932160)===0&&(vn=262144),ui=r}else ui=536870912;return r=oi.current,r!==null&&(r.flags|=32),ui}function Qr(r,s,a){(r===Rn&&(yn===2||yn===9)||r.cancelPendingCommit!==null)&&(zo(r,0),Ys(r,nn,ui,!1)),Ni(r,a),((pn&2)===0||r!==Rn)&&(r===Rn&&((pn&2)===0&&(Ha|=a),Gn===4&&Ys(r,nn,ui,!1)),Wi(r))}function Cw(r,s,a){if((pn&6)!==0)throw Error(i(327));var c=!a&&(s&127)===0&&(s&r.expiredLanes)===0||un(r,s),d=c?l4(r,s):I0(r,s,!0),p=c;do{if(d===0){Uo&&!c&&Ys(r,s,0,!1);break}else{if(a=r.current.alternate,p&&!a4(a)){d=I0(r,s,!1),p=!1;continue}if(d===2){if(p=s,r.errorRecoveryDisabledLanes&p)var R=0;else R=r.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){s=R;e:{var q=r;d=ic;var oe=q.current.memoizedState.isDehydrated;if(oe&&(zo(q,R).flags|=256),R=I0(q,R,!1),R!==2){if(b0&&!oe){q.errorRecoveryDisabledLanes|=p,Ha|=p,d=4;break e}p=Xr,Xr=d,p!==null&&(Xr===null?Xr=p:Xr.push.apply(Xr,p))}d=R}if(p=!1,d!==2)continue}}if(d===1){zo(r,0),Ys(r,s,0,!0);break}e:{switch(c=r,p=d,p){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:Ys(c,s,ui,!qs);break e;case 2:Xr=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(d=Ju+300-qe(),10<d)){if(Ys(c,s,ui,!qs),on(c,0,!0)!==0)break e;ys=s,c.timeoutHandle=ab(Mw.bind(null,c,a,Xr,Qu,x0,s,ui,Ha,jo,qs,p,"Throttled",-0,0),d);break e}Mw(c,a,Xr,Qu,x0,s,ui,Ha,jo,qs,p,null,-0,0)}}break}while(!0);Wi(r)}function Mw(r,s,a,c,d,p,R,q,oe,Ee,Oe,je,Se,De){if(r.timeoutHandle=-1,je=s.subtreeFlags,je&8192||(je&16785408)===16785408){je={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ns},Ew(s,p,je);var ct=(p&62914560)===p?Ju-qe():(p&4194048)===p?Iw-qe():0;if(ct=K4(je,ct),ct!==null){ys=p,r.cancelPendingCommit=ct(Lw.bind(null,r,s,p,a,c,d,R,q,oe,Oe,je,null,Se,De)),Ys(r,p,R,!Ee);return}}Lw(r,s,p,a,c,d,R,q,oe)}function a4(r){for(var s=r;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var d=a[c],p=d.getSnapshot;d=d.value;try{if(!si(p(),d))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ys(r,s,a,c){s&=~v0,s&=~Ha,r.suspendedLanes|=s,r.pingedLanes&=~s,c&&(r.warmLanes|=s),c=r.expirationTimes;for(var d=s;0<d;){var p=31-rt(d),R=1<<p;c[p]=-1,d&=~R}a!==0&&Xt(r,a,s)}function ef(){return(pn&6)===0?(ac(0),!1):!0}function _0(){if(en!==null){if(yn===0)var r=en.return;else r=en,as=Da=null,Hh(r),Co=null,Vl=0,r=en;for(;r!==null;)ow(r.alternate,r),r=r.return;en=null}}function zo(r,s){var a=r.timeoutHandle;a!==-1&&(r.timeoutHandle=-1,I4(a)),a=r.cancelPendingCommit,a!==null&&(r.cancelPendingCommit=null,a()),ys=0,_0(),Rn=r,en=a=is(r.current,null),nn=s,yn=0,ci=null,qs=!1,Uo=un(r,s),b0=!1,jo=ui=v0=Ha=$s=Gn=0,Xr=ic=null,x0=!1,(s&8)!==0&&(s|=s&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=s;0<c;){var d=31-rt(c),p=1<<d;s|=r[d],c&=~p}return ms=s,xu(),a}function Bw(r,s){Pt=null,E.H=Zl,s===Ro||s===Cu?(s=Wm(),yn=3):s===Ch?(s=Wm(),yn=4):yn=s===r0?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ci=s,en===null&&(Gn=1,Fu(r,bi(s,r.current)))}function Dw(){var r=oi.current;return r===null?!0:(nn&4194048)===nn?Si===null:(nn&62914560)===nn||(nn&536870912)!==0?r===Si:!1}function Ow(){var r=E.H;return E.H=Zl,r===null?Zl:r}function Nw(){var r=E.A;return E.A=i4,r}function tf(){Gn=4,qs||(nn&4194048)!==nn&&oi.current!==null||(Uo=!0),($s&134217727)===0&&(Ha&134217727)===0||Rn===null||Ys(Rn,nn,ui,!1)}function I0(r,s,a){var c=pn;pn|=2;var d=Ow(),p=Nw();(Rn!==r||nn!==s)&&(Qu=null,zo(r,s)),s=!1;var R=Gn;e:do try{if(yn!==0&&en!==null){var q=en,oe=ci;switch(yn){case 8:_0(),R=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(s=!0);var Ee=yn;if(yn=0,ci=null,Po(r,q,oe,Ee),a&&Uo){R=0;break e}break;default:Ee=yn,yn=0,ci=null,Po(r,q,oe,Ee)}}o4(),R=Gn;break}catch(Oe){Bw(r,Oe)}while(!0);return s&&r.shellSuspendCounter++,as=Da=null,pn=c,E.H=d,E.A=p,en===null&&(Rn=null,nn=0,xu()),R}function o4(){for(;en!==null;)kw(en)}function l4(r,s){var a=pn;pn|=2;var c=Ow(),d=Nw();Rn!==r||nn!==s?(Qu=null,Xu=qe()+500,zo(r,s)):Uo=un(r,s);e:do try{if(yn!==0&&en!==null){s=en;var p=ci;t:switch(yn){case 1:yn=0,ci=null,Po(r,s,p,1);break;
vendor: 4,555 bytes, line 9
9case 2:case 9:if(qm(p)){yn=0,ci=null,Uw(s);break}s=function(){yn!==2&&yn!==9||Rn!==r||(yn=7),Wi(r)},p.then(s,s);break e;case 3:yn=7;break e;case 4:yn=5;break e;case 7:qm(p)?(yn=0,ci=null,Uw(s)):(yn=0,ci=null,Po(r,s,p,7));break;case 5:var R=null;switch(en.tag){case 26:R=en.memoizedState;case 5:case 27:var q=en;if(R?xb(R):q.stateNode.complete){yn=0,ci=null;var oe=q.sibling;if(oe!==null)en=oe;else{var Ee=q.return;Ee!==null?(en=Ee,nf(Ee)):en=null}break t}}yn=0,ci=null,Po(r,s,p,5);break;case 6:yn=0,ci=null,Po(r,s,p,6);break;case 8:_0(),Gn=6;break e;default:throw Error(i(462))}}c4();break}catch(Oe){Bw(r,Oe)}while(!0);return as=Da=null,E.H=c,E.A=d,pn=a,en!==null?0:(Rn=null,nn=0,xu(),Gn)}function c4(){for(;en!==null&&!jn();)kw(en)}function kw(r){var s=sw(r.alternate,r,ms);r.memoizedProps=r.pendingProps,s===null?nf(r):en=s}function Uw(r){var s=r,a=s.alternate;switch(s.tag){case 15:case 0:s=Qy(a,s,s.pendingProps,s.type,void 0,nn);break;case 11:s=Qy(a,s,s.pendingProps,s.type.render,s.ref,nn);break;case 5:Hh(s);default:ow(a,s),s=en=Nm(s,ms),s=sw(a,s,ms)}r.memoizedProps=r.pendingProps,s===null?nf(r):en=s}function Po(r,s,a,c){as=Da=null,Hh(s),Co=null,Vl=0;var d=s.return;try{if(JS(r,d,s,a,nn)){Gn=1,Fu(r,bi(a,r.current)),en=null;return}}catch(p){if(d!==null)throw en=d,p;Gn=1,Fu(r,bi(a,r.current)),en=null;return}s.flags&32768?(ln||c===1?r=!0:Uo||(nn&536870912)!==0?r=!1:(qs=r=!0,(c===2||c===9||c===3||c===6)&&(c=oi.current,c!==null&&c.tag===13&&(c.flags|=16384))),jw(s,r)):nf(s)}function nf(r){var s=r;do{if((s.flags&32768)!==0){jw(s,qs);return}r=s.return;var a=e4(s.alternate,s,ms);if(a!==null){en=a;return}if(s=s.sibling,s!==null){en=s;return}en=s=r}while(s!==null);Gn===0&&(Gn=5)}function jw(r,s){do{var a=t4(r.alternate,r);if(a!==null){a.flags&=32767,en=a;return}if(a=r.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(r=r.sibling,r!==null)){en=r;return}en=r=a}while(r!==null);Gn=6,en=null}function Lw(r,s,a,c,d,p,R,q,oe){r.cancelPendingCommit=null;do rf();while(ur!==0);if((pn&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(p=s.lanes|s.childLanes,p|=ph,Ln(r,a,p,R,q,oe),r===Rn&&(en=Rn=null,nn=0),Lo=s,Gs=r,ys=a,E0=p,S0=d,Tw=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,h4(S,function(){return Fw(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=E.T,E.T=null,d=B.p,B.p=2,R=pn,pn|=4;try{n4(r,s,a)}finally{pn=R,B.p=d,E.T=c}}ur=1,zw(),Pw(),Hw()}}function zw(){if(ur===1){ur=0;var r=Gs,s=Lo,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=E.T,E.T=null;var c=B.p;B.p=2;var d=pn;pn|=4;try{bw(s,r);var p=L0,R=_m(r.containerInfo),q=p.focusedElem,oe=p.selectionRange;if(R!==q&&q&&q.ownerDocument&&Am(q.ownerDocument.documentElement,q)){if(oe!==null&&ch(q)){var Ee=oe.start,Oe=oe.end;if(Oe===void 0&&(Oe=Ee),"selectionStart"in q)q.selectionStart=Ee,q.selectionEnd=Math.min(Oe,q.value.length);else{var je=q.ownerDocument||document,Se=je&&je.defaultView||window;if(Se.getSelection){var De=Se.getSelection(),ct=q.textContent.length,It=Math.min(oe.start,ct),An=oe.end===void 0?It:Math.min(oe.end,ct);!De.extend&&It>An&&(R=An,An=It,It=R);var ye=Sm(q,It),fe=Sm(q,An);if(ye&&fe&&(De.rangeCount!==1||De.anchorNode!==ye.node||De.anchorOffset!==ye.offset||De.focusNode!==fe.node||De.focusOffset!==fe.offset)){var xe=je.createRange();xe.setStart(ye.node,ye.offset),De.removeAllRanges(),It>An?(De.addRange(xe),De.extend(fe.node,fe.offset)):(xe.setEnd(fe.node,fe.offset),De.addRange(xe))}}}}for(je=[],De=q;De=De.parentNode;)De.nodeType===1&&je.push({element:De,left:De.scrollLeft,top:De.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<je.length;q++){var Ue=je[q];Ue.element.scrollLeft=Ue.left,Ue.element.scrollTop=Ue.top}}mf=!!j0,L0=j0=null}finally{pn=d,B.p=c,E.T=a}}r.current=s,ur=2}}function Pw(){if(ur===2){ur=0;var r=Gs,s=Lo,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=E.T,E.T=null;var c=B.p;B.p=2;var d=pn;pn|=4;try{pw(r,s.alternate,s)}finally{pn=d,B.p=c,E.T=a}}ur=3}}function Hw(){if(ur===4||ur===3){ur=0,Fe();var r=Gs,s=Lo,a=ys,c=Tw;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?ur=5:(ur=0,Lo=Gs=null,Vw(r,r.pendingLanes));var d=r.pendingLanes;if(d===0&&(Ws=null),F(a),s=s.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Re,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=E.T,d=B.p,B.p=2,E.T=null;try{for(var p=r.onRecoverableError,R=0;R<c.length;R++){var q=c[R];p(q.value,{componentStack:q.stack})}}finally{E.T=s,B.p=d}}
vendor: 9,993 bytes, line 9
9(ys&3)!==0&&rf(),Wi(r),d=r.pendingLanes,(a&261930)!==0&&(d&42)!==0?r===A0?sc++:(sc=0,A0=r):sc=0,ac(0)}}function Vw(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,Pl(s)))}function rf(){return zw(),Pw(),Hw(),Fw()}function Fw(){if(ur!==5)return!1;var r=Gs,s=E0;E0=0;var a=F(ys),c=E.T,d=B.p;try{B.p=32>a?32:a,E.T=null,a=S0,S0=null;var p=Gs,R=ys;if(ur=0,Lo=Gs=null,ys=0,(pn&6)!==0)throw Error(i(331));var q=pn;if(pn|=4,Aw(p.current),xw(p,p.current,R,a),pn=q,ac(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Re,p)}catch{}return!0}finally{B.p=d,E.T=c,Vw(r,s)}}function Kw(r,s,a){s=bi(a,s),s=n0(r.stateNode,s,2),r=Hs(r,s,2),r!==null&&(Ni(r,2),Wi(r))}function wn(r,s,a){if(r.tag===3)Kw(r,r,a);else for(;s!==null;){if(s.tag===3){Kw(s,r,a);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Ws===null||!Ws.has(c))){r=bi(a,r),a=qy(2),c=Hs(s,a,2),c!==null&&($y(a,c,s,r),Ni(c,2),Wi(c));break}}s=s.return}}function T0(r,s,a){var c=r.pingCache;if(c===null){c=r.pingCache=new s4;var d=new Set;c.set(s,d)}else d=c.get(s),d===void 0&&(d=new Set,c.set(s,d));d.has(a)||(b0=!0,d.add(a),r=u4.bind(null,r,s,a),s.then(r,r))}function u4(r,s,a){var c=r.pingCache;c!==null&&c.delete(s),r.pingedLanes|=r.suspendedLanes&a,r.warmLanes&=~a,Rn===r&&(nn&a)===a&&(Gn===4||Gn===3&&(nn&62914560)===nn&&300>qe()-Ju?(pn&2)===0&&zo(r,0):v0|=a,jo===nn&&(jo=0)),Wi(r)}function qw(r,s){s===0&&(s=Tn()),r=Ca(r,s),r!==null&&(Ni(r,s),Wi(r))}function f4(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),qw(r,a)}function d4(r,s){var a=0;switch(r.tag){case 31:case 13:var c=r.stateNode,d=r.memoizedState;d!==null&&(a=d.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(s),qw(r,a)}function h4(r,s){return jt(r,s)}var sf=null,Ho=null,R0=!1,af=!1,C0=!1,Zs=0;function Wi(r){r!==Ho&&r.next===null&&(Ho===null?sf=Ho=r:Ho=Ho.next=r),af=!0,R0||(R0=!0,g4())}function ac(r,s){if(!C0&&af){C0=!0;do for(var a=!1,c=sf;c!==null;){if(r!==0){var d=c.pendingLanes;if(d===0)var p=0;else{var R=c.suspendedLanes,q=c.pingedLanes;p=(1<<31-rt(42|r)+1)-1,p&=d&~(R&~q),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,Yw(c,p))}else p=nn,p=on(c,c===Rn?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||un(c,p)||(a=!0,Yw(c,p));c=c.next}while(a);C0=!1}}function p4(){$w()}function $w(){af=R0=!1;var r=0;Zs!==0&&_4()&&(r=Zs);for(var s=qe(),a=null,c=sf;c!==null;){var d=c.next,p=Ww(c,s);p===0?(c.next=null,a===null?sf=d:a.next=d,d===null&&(Ho=a)):(a=c,(r!==0||(p&3)!==0)&&(af=!0)),c=d}ur!==0&&ur!==5||ac(r),Zs!==0&&(Zs=0)}function Ww(r,s){for(var a=r.suspendedLanes,c=r.pingedLanes,d=r.expirationTimes,p=r.pendingLanes&-62914561;0<p;){var R=31-rt(p),q=1<<R,oe=d[R];oe===-1?((q&a)===0||(q&c)!==0)&&(d[R]=Oi(q,s)):oe<=s&&(r.expiredLanes|=q),p&=~q}if(s=Rn,a=nn,a=on(r,r===s?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,a===0||r===s&&(yn===2||yn===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Lt(c),r.callbackNode=null,r.callbackPriority=0;if((a&3)===0||un(r,a)){if(s=a&-a,s===r.callbackPriority)return s;switch(c!==null&&Lt(c),F(a)){case 2:case 8:a=H;break;case 32:a=S;break;case 268435456:a=Y;break;default:a=S}return c=Gw.bind(null,r),a=jt(a,c),r.callbackPriority=s,r.callbackNode=a,s}return c!==null&&c!==null&&Lt(c),r.callbackPriority=2,r.callbackNode=null,2}function Gw(r,s){if(ur!==0&&ur!==5)return r.callbackNode=null,r.callbackPriority=0,null;var a=r.callbackNode;if(rf()&&r.callbackNode!==a)return null;var c=nn;return c=on(r,r===Rn?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(Cw(r,c,s),Ww(r,qe()),r.callbackNode!=null&&r.callbackNode===a?Gw.bind(null,r):null)}function Yw(r,s){if(rf())return null;Cw(r,s,!0)}function g4(){T4(function(){(pn&6)!==0?jt(Wt,p4):$w()})}function M0(){if(Zs===0){var r=Io;r===0&&(r=Di,Di<<=1,(Di&261888)===0&&(Di=256)),Zs=r}return Zs}function Zw(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:hu(""+r)}function Jw(r,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,r.id&&a.setAttribute("form",r.id),s.parentNode.insertBefore(a,s),r=new FormData(r),a.parentNode.removeChild(a),r}function m4(r,s,a,c,d){if(s==="submit"&&a&&a.stateNode===d){var p=Zw((d[Ie]||null).action),R=c.submitter;R&&(s=(s=R[Ie]||null)?Zw(s.formAction):R.getAttribute("formAction"),s!==null&&(p=s,R=null));var q=new yu("action","action",null,c,d);r.push({event:q,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Zs!==0){var oe=R?Jw(d,R):new FormData(d);Zh(a,{pending:!0,data:oe,method:d.method,action:p},null,oe)}}else typeof p=="function"&&(q.preventDefault(),oe=R?Jw(d,R):new FormData(d),Zh(a,{pending:!0,data:oe,method:d.method,action:p},p,oe))},currentTarget:d}]})}}for(var B0=0;B0<hh.length;B0++){var D0=hh[B0],y4=D0.toLowerCase(),w4=D0[0].toUpperCase()+D0.slice(1);ki(y4,"on"+w4)}ki(Rm,"onAnimationEnd"),ki(Cm,"onAnimationIteration"),ki(Mm,"onAnimationStart"),ki("dblclick","onDoubleClick"),ki("focusin","onFocus"),ki("focusout","onBlur"),ki(NS,"onTransitionRun"),ki(kS,"onTransitionStart"),ki(US,"onTransitionCancel"),ki(Bm,"onTransitionEnd"),Qe("onMouseEnter",["mouseout","mouseover"]),Qe("onMouseLeave",["mouseout","mouseover"]),Qe("onPointerEnter",["pointerout","pointerover"]),Qe("onPointerLeave",["pointerout","pointerover"]),Ge("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ge("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ge("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ge("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ge("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),b4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oc));function Xw(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var c=r[a],d=c.event;c=c.listeners;e:{var p=void 0;if(s)for(var R=c.length-1;0<=R;R--){var q=c[R],oe=q.instance,Ee=q.currentTarget;if(q=q.listener,oe!==p&&d.isPropagationStopped())break e;p=q,d.currentTarget=Ee;try{p(d)}catch(Oe){vu(Oe)}d.currentTarget=null,p=oe}else for(R=0;R<c.length;R++){if(q=c[R],oe=q.instance,Ee=q.currentTarget,q=q.listener,oe!==p&&d.isPropagationStopped())break e;p=q,d.currentTarget=Ee;try{p(d)}catch(Oe){vu(Oe)}d.currentTarget=null,p=oe}}}}function tn(r,s){var a=s[$e];a===void 0&&(a=s[$e]=new Set);var c=r+"__bubble";a.has(c)||(Qw(s,r,2,!1),a.add(c))}function O0(r,s,a){var c=0;s&&(c|=4),Qw(a,r,c,s)}var of="_reactListening"+Math.random().toString(36).slice(2);function N0(r){if(!r[of]){r[of]=!0,nt.forEach(function(a){a!=="selectionchange"&&(b4.has(a)||O0(a,!1,r),O0(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[of]||(s[of]=!0,O0("selectionchange",!1,s))}}function Qw(r,s,a,c){switch(Rb(s)){case 2:var d=W4;break;case 8:d=G4;break;default:d=Y0}a=d.bind(null,s,a,r),d=void 0,!eh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),c?d!==void 0?r.addEventListener(s,a,{capture:!0,passive:d}):r.addEventListener(s,a,!0):d!==void 0?r.addEventListener(s,a,{passive:d}):r.addEventListener(s,a,!1)}function k0(r,s,a,c,d){var p=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var R=c.tag;if(R===3||R===4){var q=c.stateNode.containerInfo;if(q===d)break;if(R===4)for(R=c.return;R!==null;){var oe=R.tag;if((oe===3||oe===4)&&R.stateNode.containerInfo===d)return;R=R.return}for(;q!==null;){if(R=_t(q),R===null)return;if(oe=R.tag,oe===5||oe===6||oe===26||oe===27){c=p=R;continue e}q=q.parentNode}}c=c.return}im(function(){var Ee=p,Oe=Xd(a),je=[];e:{var Se=Dm.get(r);if(Se!==void 0){var De=yu,ct=r;switch(r){case"keypress":if(gu(a)===0)break e;case"keydown":case"keyup":De=dS;break;case"focusin":ct="focus",De=ih;break;case"focusout":ct="blur",De=ih;break;case"beforeblur":case"afterblur":De=ih;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":De=om;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":De=eS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":De=gS;break;case Rm:case Cm:case Mm:De=rS;break;case Bm:De=yS;break;case"scroll":case"scrollend":De=X6;break;case"wheel":De=bS;break;case"copy":case"cut":case"paste":De=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":De=cm;break;case"toggle":case"beforetoggle":De=xS}var It=(s&4)!==0,An=!It&&(r==="scroll"||r==="scrollend"),ye=It?Se!==null?Se+"Capture":null:Se;It=[];for(var fe=Ee,xe;fe!==null;){var Ue=fe;if(xe=Ue.stateNode,Ue=Ue.tag,Ue!==5&&Ue!==26&&Ue!==27||xe===null||ye===null||(Ue=Cl(fe,ye),Ue!=null&&It.push(lc(fe,Ue,xe))),An)break;fe=fe.return}0<It.length&&(Se=new De(Se,ct,null,a,Oe),je.push({event:Se,listeners:It}))}}if((s&7)===0){e:{if(Se=r==="mouseover"||r==="pointerover",De=r==="mouseout"||r==="pointerout",Se&&a!==Jd&&(ct=a.relatedTarget||a.fromElement)&&(_t(ct)||ct[Ve]))break e;if((De||Se)&&(Se=Oe.window===Oe?Oe:(Se=Oe.ownerDocument)?Se.defaultView||Se.parentWindow:window,De?(ct=a.relatedTarget||a.toElement,De=Ee,ct=ct?_t(ct):null,ct!==null&&(An=l(ct),It=ct.tag,ct!==An||It!==5&&It!==27&&It!==6)&&(ct=null)):(De=null,ct=Ee),De!==ct)){if(It=om,Ue="onMouseLeave",ye="onMouseEnter",fe="mou
9se",(r==="pointerout"||r==="pointerover")&&(It=cm,Ue="onPointerLeave",ye="onPointerEnter",fe="pointer"),An=De==null?Se:yt(De),xe=ct==null?Se:yt(ct),Se=new It(Ue,fe+"leave",De,a,Oe),Se.target=An,Se.relatedTarget=xe,Ue=null,_t(Oe)===Ee&&(It=new It(ye,fe+"enter",ct,a,Oe),It.target=xe,It.relatedTarget=An,Ue=It),An=Ue,De&&ct)t:{for(It=v4,ye=De,fe=ct,xe=0,Ue=ye;Ue;Ue=It(Ue))xe++;Ue=0;for(var vt=fe;vt;vt=It(vt))Ue++;for(;0<xe-Ue;)ye=It(ye),xe--;for(;0<Ue-xe;)fe=It(fe),Ue--;for(;xe--;){if(ye===fe||fe!==null&&ye===fe.alternate){It=ye;break t}ye=It(ye),fe=It(fe)}It=null}else It=null;De!==null&&eb(je,Se,De,It,!1),ct!==null&&An!==null&&eb(je,An,ct,It,!0)}}e:{if(Se=Ee?yt(Ee):window,De=Se.nodeName&&Se.nodeName.toLowerCase(),De==="select"||De==="input"&&Se.type==="file")var dn=ym;else if(gm(Se))if(wm)dn=BS;else{dn=CS;var ht=RS}else De=Se.nodeName,!De||De.toLowerCase()!=="input"||Se.type!=="checkbox"&&Se.type!=="radio"?Ee&&rr(Ee.elementType)&&(dn=ym):dn=MS;if(dn&&(dn=dn(r,Ee))){mm(je,dn,a,Oe);break e}ht&&ht(r,Se,Ee),r==="focusout"&&Ee&&Se.type==="number"&&Ee.memoizedProps.value!=null&&Jt(Se,"number",Se.value)}switch(ht=Ee?yt(Ee):window,r){case"focusin":(gm(ht)||ht.contentEditable==="true")&&(wo=ht,uh=Ee,jl=null);break;case"focusout":jl=uh=wo=null;break;case"mousedown":fh=!0;break;case"contextmenu":case"mouseup":case"dragend":fh=!1,Im(je,a,Oe);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":Im(je,a,Oe)}var Ft;if(ah)e:{switch(r){case"compositionstart":var rn="onCompositionStart";break e;case"compositionend":rn="onCompositionEnd";break e;case"compositionupdate":rn="onCompositionUpdate";break e}rn=void 0}else yo?hm(r,a)&&(rn="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(rn="onCompositionStart");rn&&(um&&a.locale!=="ko"&&(yo||rn!=="onCompositionStart"?rn==="onCompositionEnd"&&yo&&(Ft=sm()):(Ns=Oe,th="value"in Ns?Ns.value:Ns.textContent,yo=!0)),ht=lf(Ee,rn),0<ht.length&&(rn=new lm(rn,r,null,a,Oe),je.push({event:rn,listeners:ht}),Ft?rn.data=Ft:(Ft=pm(a),Ft!==null&&(rn.data=Ft)))),(Ft=SS?AS(r,a):_S(r,a))&&(rn=lf(Ee,"onBeforeInput"),0<rn.length&&(ht=new lm("onBeforeInput","beforeinput",null,a,Oe),je.push({event:ht,listeners:rn}),ht.data=Ft)),m4(je,r,Ee,a,Oe)}Xw(je,s)})}function lc(r,s,a){return{instance:r,listener:s,currentTarget:a}}function lf(r,s){for(var a=s+"Capture",c=[];r!==null;){var d=r,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=Cl(r,a),d!=null&&c.unshift(lc(r,d,p)),d=Cl(r,s),d!=null&&c.push(lc(r,d,p))),r.tag===3)return c;r=r.return}return[]}function v4(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function eb(r,s,a,c,d){for(var p=s._reactName,R=[];a!==null&&a!==c;){var q=a,oe=q.alternate,Ee=q.stateNode;if(q=q.tag,oe!==null&&oe===c)break;q!==5&&q!==26&&q!==27||Ee===null||(oe=Ee,d?(Ee=Cl(a,p),Ee!=null&&R.unshift(lc(a,Ee,oe))):d||(Ee=Cl(a,p),Ee!=null&&R.push(lc(a,Ee,oe)))),a=a.return}R.length!==0&&r.push({event:s,listeners:R})}var x4=/\r\n?/g,E4=/\u0000|\uFFFD/g;function tb(r){return(typeof r=="string"?r:""+r).replace(x4,` 10`).replace(E4,"")}function nb(r,s){return s=tb(s),tb(r)===s}function Sn(r,s,a,c,d,p){switch(a){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||mn(r,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&mn(r,""+c);break;case"className":Ne(r,"class",c);break;case"tabIndex":Ne(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Ne(r,a,c);break;case"style":$n(r,c,p);break;case"data":if(s!=="object"){Ne(r,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||a!=="href")){r.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(a);break}c=hu(""+c),r.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(a==="formAction"?(s!=="input"&&Sn(r,s,"name",d.name,d,null),Sn(r,s,"formEncType",d.formEncType,d,null),Sn(r,s,"formMethod",d.formMethod,d,null),Sn(r,s,"formTarget",d.formTarget,d,null)):(Sn(r,s,"encType",d.encType,d,null),Sn(r,s,"method",d.method,d,null),Sn(r,s,"target",d.target,d,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(a);break}c=hu(""+c),r.setAttribute(a,c);break;case"onClick":c!=null&&(r.onclick=ns);break;case"onScroll":c!=null&&tn("scroll",r);break;case"onScrollEnd":c!=null&&tn("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(d.children!=null)throw Error(i(60));r.innerHTML=a}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}a=hu(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,""+c):r.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
10ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,""):r.removeAttribute(a);break;case"capture":case"download":c===!0?r.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,c):r.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(a,c):r.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(a):r.setAttribute(a,c);break;case"popover":tn("beforetoggle",r),tn("toggle",r),Le(r,"popover",c);break;case"xlinkActuate":ke(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":ke(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":ke(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":ke(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":ke(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":ke(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":ke(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":ke(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":ke(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Le(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=fr.get(a)||a,Le(r,a,c))}}function U0(r,s,a,c,d,p){switch(a){case"style":$n(r,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(d.children!=null)throw Error(i(60));r.innerHTML=a}}break;case"children":typeof c=="string"?mn(r,c):(typeof c=="number"||typeof c=="bigint")&&mn(r,""+c);break;case"onScroll":c!=null&&tn("scroll",r);break;case"onScrollEnd":c!=null&&tn("scrollend",r);break;case"onClick":c!=null&&(r.onclick=ns);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ut.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(d=a.endsWith("Capture"),s=a.slice(2,d?a.length-7:void 0),p=r[Ie]||null,p=p!=null?p[a]:null,typeof p=="function"&&r.removeEventListener(s,p,d),typeof c=="function")){typeof p!="function"&&p!==null&&(a in r?r[a]=null:r.hasAttribute(a)&&r.removeAttribute(a)),r.addEventListener(s,c,d);break e}a in r?r[a]=c:c===!0?r.setAttribute(a,""):Le(r,a,c)}}}function xr(r,s,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tn("error",r),tn("load",r);var c=!1,d=!1,p;for(p in a)if(a.hasOwnProperty(p)){var R=a[p];if(R!=null)switch(p){case"src":c=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Sn(r,s,p,R,a,null)}}d&&Sn(r,s,"srcSet",a.srcSet,a,null),c&&Sn(r,s,"src",a.src,a,null);return;case"input":tn("invalid",r);var q=p=R=d=null,oe=null,Ee=null;for(c in a)if(a.hasOwnProperty(c)){var Oe=a[c];if(Oe!=null)switch(c){case"name":d=Oe;break;case"type":R=Oe;break;case"checked":oe=Oe;break;case"defaultChecked":Ee=Oe;break;case"value":p=Oe;break;case"defaultValue":q=Oe;break;case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(i(137,s));break;default:Sn(r,s,c,Oe,a,null)}}zt(r,p,q,oe,Ee,R,d,!1);return;case"select":tn("invalid",r),c=R=p=null;for(d in a)if(a.hasOwnProperty(d)&&(q=a[d],q!=null))switch(d){case"value":p=q;break;case"defaultValue":R=q;break;case"multiple":c=q;default:Sn(r,s,d,q,a,null)}s=p,a=R,r.multiple=!!c,s!=null?Vt(r,!!c,s,!1):a!=null&&Vt(r,!!c,a,!0);return;case"textarea":tn("invalid",r),p=d=c=null;for(R in a)if(a.hasOwnProperty(R)&&(q=a[R],q!=null))switch(R){case"value":c=q;break;case"defaultValue":d=q;break;case"children":p=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(i(91));break;default:Sn(r,s,R,q,a,null)}fn(r,c,d,p);return;case"option":for(oe in a)a.hasOwnProperty(oe)&&(c=a[oe],c!=null)&&(oe==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":Sn(r,s,oe,c,a,null));return;case"dialog":tn("beforetoggle",r),tn("toggle",r),tn("cancel",r),tn("close",r);break;case"iframe":case"object":tn("load",r);break;case"video":case"audio":for(c=0;c<oc.length;c++)tn(oc[c],r);break;case"image":tn("error",r),tn("load",r);break;case"details":tn("toggle",r);break;case"embed":case"source":case"link":tn("error",r),tn("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ee in a)if(a.hasOwnProperty(Ee)&&(c=a[Ee],c!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:Sn(r,s,Ee,c,a,null)}return;default:if(rr(s)){for(Oe in a)a.hasOwnProperty(Oe)&&(c=a[Oe],c!==void 0&&U0(r,s,Oe,c,a,void 0));return}}for(q in a)a.hasOwnProperty(q)&&(c=a[q],c!=null&&Sn(r,s,q,c,a,null))}
vendor: 5,985 bytes, line 10
10function S4(r,s,a,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,R=null,q=null,oe=null,Ee=null,Oe=null;for(De in a){var je=a[De];if(a.hasOwnProperty(De)&&je!=null)switch(De){case"checked":break;case"value":break;case"defaultValue":oe=je;default:c.hasOwnProperty(De)||Sn(r,s,De,null,c,je)}}for(var Se in c){var De=c[Se];if(je=a[Se],c.hasOwnProperty(Se)&&(De!=null||je!=null))switch(Se){case"type":p=De;break;case"name":d=De;break;case"checked":Ee=De;break;case"defaultChecked":Oe=De;break;case"value":R=De;break;case"defaultValue":q=De;break;case"children":case"dangerouslySetInnerHTML":if(De!=null)throw Error(i(137,s));break;default:De!==je&&Sn(r,s,Se,De,c,je)}}Qt(r,R,q,oe,Ee,Oe,p,d);return;case"select":De=R=q=Se=null;for(p in a)if(oe=a[p],a.hasOwnProperty(p)&&oe!=null)switch(p){case"value":break;case"multiple":De=oe;default:c.hasOwnProperty(p)||Sn(r,s,p,null,c,oe)}for(d in c)if(p=c[d],oe=a[d],c.hasOwnProperty(d)&&(p!=null||oe!=null))switch(d){case"value":Se=p;break;case"defaultValue":q=p;break;case"multiple":R=p;default:p!==oe&&Sn(r,s,d,p,c,oe)}s=q,a=R,c=De,Se!=null?Vt(r,!!a,Se,!1):!!c!=!!a&&(s!=null?Vt(r,!!a,s,!0):Vt(r,!!a,a?[]:"",!1));return;case"textarea":De=Se=null;for(q in a)if(d=a[q],a.hasOwnProperty(q)&&d!=null&&!c.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:Sn(r,s,q,null,c,d)}for(R in c)if(d=c[R],p=a[R],c.hasOwnProperty(R)&&(d!=null||p!=null))switch(R){case"value":Se=d;break;case"defaultValue":De=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(i(91));break;default:d!==p&&Sn(r,s,R,d,c,p)}zn(r,Se,De);return;case"option":for(var ct in a)Se=a[ct],a.hasOwnProperty(ct)&&Se!=null&&!c.hasOwnProperty(ct)&&(ct==="selected"?r.selected=!1:Sn(r,s,ct,null,c,Se));for(oe in c)Se=c[oe],De=a[oe],c.hasOwnProperty(oe)&&Se!==De&&(Se!=null||De!=null)&&(oe==="selected"?r.selected=Se&&typeof Se!="function"&&typeof Se!="symbol":Sn(r,s,oe,Se,c,De));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var It in a)Se=a[It],a.hasOwnProperty(It)&&Se!=null&&!c.hasOwnProperty(It)&&Sn(r,s,It,null,c,Se);for(Ee in c)if(Se=c[Ee],De=a[Ee],c.hasOwnProperty(Ee)&&Se!==De&&(Se!=null||De!=null))switch(Ee){case"children":case"dangerouslySetInnerHTML":if(Se!=null)throw Error(i(137,s));break;default:Sn(r,s,Ee,Se,c,De)}return;default:if(rr(s)){for(var An in a)Se=a[An],a.hasOwnProperty(An)&&Se!==void 0&&!c.hasOwnProperty(An)&&U0(r,s,An,void 0,c,Se);for(Oe in c)Se=c[Oe],De=a[Oe],!c.hasOwnProperty(Oe)||Se===De||Se===void 0&&De===void 0||U0(r,s,Oe,Se,c,De);return}}for(var ye in a)Se=a[ye],a.hasOwnProperty(ye)&&Se!=null&&!c.hasOwnProperty(ye)&&Sn(r,s,ye,null,c,Se);for(je in c)Se=c[je],De=a[je],!c.hasOwnProperty(je)||Se===De||Se==null&&De==null||Sn(r,s,je,Se,c,De)}function rb(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function A4(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var d=a[c],p=d.transferSize,R=d.initiatorType,q=d.duration;if(p&&q&&rb(R)){for(R=0,q=d.responseEnd,c+=1;c<a.length;c++){var oe=a[c],Ee=oe.startTime;if(Ee>q)break;var Oe=oe.transferSize,je=oe.initiatorType;Oe&&rb(je)&&(oe=oe.responseEnd,R+=Oe*(oe<q?1:(q-Ee)/(oe-Ee)))}if(--c,s+=8*(p+R)/(d.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var j0=null,L0=null;function cf(r){return r.nodeType===9?r:r.ownerDocument}function ib(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sb(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function z0(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var P0=null;function _4(){var r=window.event;return r&&r.type==="popstate"?r===P0?!1:(P0=r,!0):(P0=null,!1)}var ab=typeof setTimeout=="function"?setTimeout:void 0,I4=typeof clearTimeout=="function"?clearTimeout:void 0,ob=typeof Promise=="function"?Promise:void 0,T4=typeof queueMicrotask=="function"?queueMicrotask:typeof ob<"u"?function(r){return ob.resolve(null).then(r).catch(R4)}:ab;function R4(r){setTimeout(function(){throw r})}function Js(r){return r==="head"}function lb(r,s){var a=s,c=0;do{var d=a.nextSibling;if(r.removeChild(a),d&&d.nodeType===8)if(a=d.data,a==="/$"||a==="/&"){if(c===0){r.removeChild(d),qo(s);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")cc(r.ownerDocument.documentElement);else if(a==="head"){a=r.ownerDocument.head,cc(a);for(var p=a.firstChild;p;){var R=p.nextSibling,q=p.nodeName;p[gt]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=R}}else a==="body"&&cc(r.ownerDocument.body);a=d}while(a);qo(s)}function cb(r,s){var a=r;r=0;do{var c=a.nextSibling;if(a.nodeType===1?s?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(s?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(r===0)break;r--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||r++;a=c}while(a)}function H0(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":H0(a),xt(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}r.removeChild(a)}}
vendor: 9,267 bytes, line 10
10function C4(r,s,a,c){for(;r.nodeType===1;){var d=a;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[gt])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(p=r.getAttribute("rel"),p==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(p!==d.rel||r.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||r.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||r.getAttribute("title")!==(d.title==null?null:d.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(p=r.getAttribute("src"),(p!==(d.src==null?null:d.src)||r.getAttribute("type")!==(d.type==null?null:d.type)||r.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&r.getAttribute("name")===p)return r}else return r;if(r=Ai(r.nextSibling),r===null)break}return null}function M4(r,s,a){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=Ai(r.nextSibling),r===null))return null;return r}function ub(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=Ai(r.nextSibling),r===null))return null;return r}function V0(r){return r.data==="$?"||r.data==="$~"}function F0(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function B4(r,s){var a=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||a.readyState!=="loading")s();else{var c=function(){s(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function Ai(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var K0=null;function fb(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"||a==="/&"){if(s===0)return Ai(r.nextSibling);s--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||s++}r=r.nextSibling}return null}function db(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(s===0)return r;s--}else a!=="/$"&&a!=="/&"||s++}r=r.previousSibling}return null}function hb(r,s,a){switch(s=cf(a),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function cc(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);xt(r)}var _i=new Map,pb=new Set;function uf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ws=B.d;B.d={f:D4,r:O4,D:N4,C:k4,L:U4,m:j4,X:z4,S:L4,M:P4};function D4(){var r=ws.f(),s=ef();return r||s}function O4(r){var s=Et(r);s!==null&&s.tag===5&&s.type==="form"?By(s):ws.r(r)}var Vo=typeof document>"u"?null:document;function gb(r,s,a){var c=Vo;if(c&&typeof s=="string"&&s){var d=Mt(s);d='link[rel="'+r+'"][href="'+d+'"]',typeof a=="string"&&(d+='[crossorigin="'+a+'"]'),pb.has(d)||(pb.add(d),r={rel:r,crossOrigin:a,href:s},c.querySelector(d)===null&&(s=c.createElement("link"),xr(s,"link",r),st(s),c.head.appendChild(s)))}}function N4(r){ws.D(r),gb("dns-prefetch",r,null)}function k4(r,s){ws.C(r,s),gb("preconnect",r,s)}function U4(r,s,a){ws.L(r,s,a);var c=Vo;if(c&&r&&s){var d='link[rel="preload"][as="'+Mt(s)+'"]';s==="image"&&a&&a.imageSrcSet?(d+='[imagesrcset="'+Mt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(d+='[imagesizes="'+Mt(a.imageSizes)+'"]')):d+='[href="'+Mt(r)+'"]';var p=d;switch(s){case"style":p=Fo(r);break;case"script":p=Ko(r)}_i.has(p)||(r=A({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:r,as:s},a),_i.set(p,r),c.querySelector(d)!==null||s==="style"&&c.querySelector(uc(p))||s==="script"&&c.querySelector(fc(p))||(s=c.createElement("link"),xr(s,"link",r),st(s),c.head.appendChild(s)))}}function j4(r,s){ws.m(r,s);var a=Vo;if(a&&r){var c=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+Mt(c)+'"][href="'+Mt(r)+'"]',p=d;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Ko(r)}if(!_i.has(p)&&(r=A({rel:"modulepreload",href:r},s),_i.set(p,r),a.querySelector(d)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fc(p)))return}c=a.createElement("link"),xr(c,"link",r),st(c),a.head.appendChild(c)}}}function L4(r,s,a){ws.S(r,s,a);var c=Vo;if(c&&r){var d=wt(c).hoistableStyles,p=Fo(r);s=s||"default";var R=d.get(p);if(!R){var q={loading:0,preload:null};if(R=c.querySelector(uc(p)))q.loading=5;else{r=A({rel:"stylesheet",href:r,"data-precedence":s},a),(a=_i.get(p))&&q0(r,a);var oe=R=c.createElement("link");st(oe),xr(oe,"link",r),oe._p=new Promise(function(Ee,Oe){oe.onload=Ee,oe.onerror=Oe}),oe.addEventListener("load",function(){q.loading|=1}),oe.addEventListener("error",function(){q.loading|=2}),q.loading|=4,ff(R,s,c)}R={type:"stylesheet",instance:R,count:1,state:q},d.set(p,R)}}}function z4(r,s){ws.X(r,s);var a=Vo;if(a&&r){var c=wt(a).hoistableScripts,d=Ko(r),p=c.get(d);p||(p=a.querySelector(fc(d)),p||(r=A({src:r,async:!0},s),(s=_i.get(d))&&$0(r,s),p=a.createElement("script"),st(p),xr(p,"link",r),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(d,p))}}function P4(r,s){ws.M(r,s);var a=Vo;if(a&&r){var c=wt(a).hoistableScripts,d=Ko(r),p=c.get(d);p||(p=a.querySelector(fc(d)),p||(r=A({src:r,async:!0,type:"module"},s),(s=_i.get(d))&&$0(r,s),p=a.createElement("script"),st(p),xr(p,"link",r),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(d,p))}}function mb(r,s,a,c){var d=(d=ne.current)?uf(d):null;if(!d)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=Fo(a.href),a=wt(d).hoistableStyles,c=a.get(s),c||(c={type:"style",instance:null,count:0,state:null},a.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){r=Fo(a.href);var p=wt(d).hoistableStyles,R=p.get(r);if(R||(d=d.ownerDocument||d,R={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(r,R),(p=d.querySelector(uc(r)))&&!p._p&&(R.instance=p,R.state.loading=5),_i.has(r)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},_i.set(r,a),p||H4(d,r,a,R.state))),s&&c===null)throw Error(i(528,""));return R}if(s&&c!==null)throw Error(i(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Ko(a),a=wt(d).hoistableScripts,c=a.get(s),c||(c={type:"script",instance:null,count:0,state:null},a.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Fo(r){return'href="'+Mt(r)+'"'}function uc(r){return'link[rel="stylesheet"]['+r+"]"}function yb(r){return A({},r,{"data-precedence":r.precedence,precedence:null})}function H4(r,s,a,c){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=r.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),xr(s,"link",a),st(s),r.head.appendChild(s))}function Ko(r){return'[src="'+Mt(r)+'"]'}function fc(r){return"script[async]"+r}function wb(r,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var c=r.querySelector('style[data-href~="'+Mt(a.href)+'"]');if(c)return s.instance=c,st(c),c;var d=A({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),st(c),xr(c,"style",d),ff(c,a.precedence,r),s.instance=c;case"stylesheet":d=Fo(a.href);var p=r.querySelector(uc(d));if(p)return s.state.loading|=4,s.instance=p,st(p),p;c=yb(a),(d=_i.get(d))&&q0(c,d),p=(r.ownerDocument||r).createElement("link"),st(p);var R=p;return R._p=new Promise(function(q,oe){R.onload=q,R.onerror=oe}),xr(p,"link",c),s.state.loading|=4,ff(p,a.precedence,r),s.instance=p;case"script":return p=Ko(a.src),(d=r.querySelector(fc(p)))?(s.instance=d,st(d),d):(c=a,(d=_i.get(p))&&(c=A({},a),$0(c,d)),r=r.ownerDocument||r,d=r.createElement("script"),st(d),xr(d,"link",c),r.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,ff(c,a.precedence,r));return s.instance}function ff(r,s,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=c.length?c[c.length-1]:null,p=d,R=0;R<c.length;R++){var q=c[R];if(q.dataset.precedence===s)p=q;else if(p!==d)break}p?p.parentNode.insertBefore(r,p.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(r,
vendor: 3,080 bytes, line 10
10s.firstChild))}function q0(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function $0(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var df=null;function bb(r,s,a){if(df===null){var c=new Map,d=df=new Map;d.set(a,c)}else d=df,c=d.get(a),c||(c=new Map,d.set(a,c));if(c.has(r))return c;for(c.set(r,null),a=a.getElementsByTagName(r),d=0;d<a.length;d++){var p=a[d];if(!(p[gt]||p[he]||r==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var R=p.getAttribute(s)||"";R=r+R;var q=c.get(R);q?q.push(p):c.set(R,[p])}}return c}function vb(r,s,a){r=r.ownerDocument||r,r.head.insertBefore(a,s==="title"?r.querySelector("head > title"):null)}function V4(r,s,a){if(a===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function xb(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function F4(r,s,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var d=Fo(c.href),p=s.querySelector(uc(d));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=hf.bind(r),s.then(r,r)),a.state.loading|=4,a.instance=p,st(p);return}p=s.ownerDocument||s,c=yb(c),(d=_i.get(d))&&q0(c,d),p=p.createElement("link"),st(p);var R=p;R._p=new Promise(function(q,oe){R.onload=q,R.onerror=oe}),xr(p,"link",c),a.instance=p}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(r.count++,a=hf.bind(r),s.addEventListener("load",a),s.addEventListener("error",a))}}var W0=0;function K4(r,s){return r.stylesheets&&r.count===0&&gf(r,r.stylesheets),0<r.count||0<r.imgCount?function(a){var c=setTimeout(function(){if(r.stylesheets&&gf(r,r.stylesheets),r.unsuspend){var p=r.unsuspend;r.unsuspend=null,p()}},6e4+s);0<r.imgBytes&&W0===0&&(W0=62500*A4());var d=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&gf(r,r.stylesheets),r.unsuspend)){var p=r.unsuspend;r.unsuspend=null,p()}},(r.imgBytes>W0?50:800)+s);return r.unsuspend=a,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(d)}}:null}function hf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var pf=null;function gf(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,pf=new Map,s.forEac
vendor: 9,861 bytes, line 10
10h(q4,r),pf=null,hf.call(r))}function q4(r,s){if(!(s.state.loading&4)){var a=pf.get(r);if(a)var c=a.get(null);else{a=new Map,pf.set(r,a);for(var d=r.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var R=d[p];(R.nodeName==="LINK"||R.getAttribute("media")!=="not all")&&(a.set(R.dataset.precedence,R),c=R)}c&&a.set(null,c)}d=s.instance,R=d.getAttribute("data-precedence"),p=a.get(R)||c,p===c&&a.set(null,d),a.set(R,d),this.count++,c=hf.bind(this),d.addEventListener("load",c),d.addEventListener("error",c),p?p.parentNode.insertBefore(d,p.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(d,r.firstChild)),s.state.loading|=4}}var dc={$$typeof:K,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function $4(r,s,a,c,d,p,R,q,oe){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xn(0),this.hiddenUpdates=xn(null),this.identifierPrefix=c,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=oe,this.incompleteTransitions=new Map}function Eb(r,s,a,c,d,p,R,q,oe,Ee,Oe,je){return r=new $4(r,s,a,R,oe,Ee,Oe,je,q),s=1,p===!0&&(s|=24),p=ai(3,null,null,s),r.current=p,p.stateNode=r,s=Ih(),s.refCount++,r.pooledCache=s,s.refCount++,p.memoizedState={element:c,isDehydrated:a,cache:s},Mh(p),r}function Sb(r){return r?(r=xo,r):xo}function Ab(r,s,a,c,d,p){d=Sb(d),c.context===null?c.context=d:c.pendingContext=d,c=Ps(s),c.payload={element:a},p=p===void 0?null:p,p!==null&&(c.callback=p),a=Hs(r,c,s),a!==null&&(Qr(a,r,s),Kl(a,r,s))}function _b(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function G0(r,s){_b(r,s),(r=r.alternate)&&_b(r,s)}function Ib(r){if(r.tag===13||r.tag===31){var s=Ca(r,67108864);s!==null&&Qr(s,r,67108864),G0(r,67108864)}}function Tb(r){if(r.tag===13||r.tag===31){var s=fi();s=V(s);var a=Ca(r,s);a!==null&&Qr(a,r,s),G0(r,s)}}var mf=!0;function W4(r,s,a,c){var d=E.T;E.T=null;var p=B.p;try{B.p=2,Y0(r,s,a,c)}finally{B.p=p,E.T=d}}function G4(r,s,a,c){var d=E.T;E.T=null;var p=B.p;try{B.p=8,Y0(r,s,a,c)}finally{B.p=p,E.T=d}}function Y0(r,s,a,c){if(mf){var d=Z0(c);if(d===null)k0(r,s,c,yf,a),Cb(r,c);else if(Z4(d,r,s,a,c))c.stopPropagation();else if(Cb(r,c),s&4&&-1<Y4.indexOf(r)){for(;d!==null;){var p=Et(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var R=yi(p.pendingLanes);if(R!==0){var q=p;for(q.pendingLanes|=2,q.entangledLanes|=2;R;){var oe=1<<31-rt(R);q.entanglements[1]|=oe,R&=~oe}Wi(p),(pn&6)===0&&(Xu=qe()+500,ac(0))}}break;case 31:case 13:q=Ca(p,2),q!==null&&Qr(q,p,2),ef(),G0(p,2)}if(p=Z0(c),p===null&&k0(r,s,c,yf,a),p===d)break;d=p}d!==null&&c.stopPropagation()}else k0(r,s,c,null,a)}}function Z0(r){return r=Xd(r),J0(r)}var yf=null;function J0(r){if(yf=null,r=_t(r),r!==null){var s=l(r);if(s===null)r=null;else{var a=s.tag;if(a===13){if(r=u(s),r!==null)return r;r=null}else if(a===31){if(r=f(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return yf=r,null}function Rb(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Yt()){case Wt:return 2;case H:return 8;case S:case I:return 32;case Y:return 268435456;default:return 32}default:return 32}}var X0=!1,Xs=null,Qs=null,ea=null,hc=new Map,pc=new Map,ta=[],Y4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Cb(r,s){switch(r){case"focusin":case"focusout":Xs=null;break;case"dragenter":case"dragleave":Qs=null;break;case"mouseover":case"mouseout":ea=null;break;case"pointerover":case"pointerout":hc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":pc.delete(s.pointerId)}}function gc(r,s,a,c,d,p){return r===null||r.nativeEvent!==p?(r={blockedOn:s,domEventName:a,eventSystemFlags:c,nativeEvent:p,targetContainers:[d]},s!==null&&(s=Et(s),s!==null&&Ib(s)),r):(r.eventSystemFlags|=c,s=r.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),r)}function Z4(r,s,a,c,d){switch(s){case"focusin":return Xs=gc(Xs,r,s,a,c,d),!0;case"dragenter":return Qs=gc(Qs,r,s,a,c,d),!0;case"mouseover":return ea=gc(ea,r,s,a,c,d),!0;case"pointerover":var p=d.pointerId;return hc.set(p,gc(hc.get(p)||null,r,s,a,c,d)),!0;case"gotpointercapture":return p=d.pointerId,pc.set(p,gc(pc.get(p)||null,r,s,a,c,d)),!0}return!1}function Mb(r){var s=_t(r.target);if(s!==null){var a=l(s);if(a!==null){if(s=a.tag,s===13){if(s=u(a),s!==null){r.blockedOn=s,$(r.priority,function(){Tb(a)});return}}else if(s===31){if(s=f(a),s!==null){r.blockedOn=s,$(r.priority,function(){Tb(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function wf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=Z0(r.nativeEvent);if(a===null){a=r.nativeEvent;var c=new a.constructor(a.type,a);Jd=c,a.target.dispatchEvent(c),Jd=null}else return s=Et(a),s!==null&&Ib(s),r.blockedOn=a,!1;s.shift()}return!0}function Bb(r,s,a){wf(r)&&a.delete(s)}function J4(){X0=!1,Xs!==null&&wf(Xs)&&(Xs=null),Qs!==null&&wf(Qs)&&(Qs=null),ea!==null&&wf(ea)&&(ea=null),hc.forEach(Bb),pc.forEach(Bb)}function bf(r,s){r.blockedOn===s&&(r.blockedOn=null,X0||(X0=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,J4)))}var vf=null;function Db(r){vf!==r&&(vf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){vf===r&&(vf=null);for(var s=0;s<r.length;s+=3){var a=r[s],c=r[s+1],d=r[s+2];if(typeof c!="function"){if(J0(c||a)===null)continue;break}var p=Et(a);p!==null&&(r.splice(s,3),s-=3,Zh(p,{pending:!0,data:d,method:a.method,action:c},c,d))}}))}function qo(r){function s(oe){return bf(oe,r)}Xs!==null&&bf(Xs,r),Qs!==null&&bf(Qs,r),ea!==null&&bf(ea,r),hc.forEach(s),pc.forEach(s);for(var a=0;a<ta.length;a++){var c=ta[a];c.blockedOn===r&&(c.blockedOn=null)}for(;0<ta.length&&(a=ta[0],a.blockedOn===null);)Mb(a),a.blockedOn===null&&ta.shift();if(a=(r.ownerDocument||r).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var d=a[c],p=a[c+1],R=d[Ie]||null;if(typeof p=="function")R||Db(a);else if(R){var q=null;if(p&&p.hasAttribute("formAction")){if(d=p,R=p[Ie]||null)q=R.formAction;else if(J0(d)!==null)continue}else q=R.action;typeof q=="function"?a[c+1]=q:(a.splice(c,3),c-=3),Db(a)}}}function Ob(){function r(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(R){return d=R})},focusReset:"manual",scroll:"manual"})}function s(){d!==null&&(d(),d=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,d=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),d!==null&&(d(),d=null)}}}function Q0(r){this._internalRoot=r}xf.prototype.render=Q0.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var a=s.current,c=fi();Ab(a,c,r,s,null,null)},xf.prototype.unmount=Q0.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;Ab(r.current,2,null,r,null,null),ef(),s[Ve]=null}};function xf(r){this._internalRoot=r}xf.prototype.unstable_scheduleHydration=function(r){if(r){var s=x();r={blockedOn:null,target:r,priority:s};for(var a=0;a<ta.length&&s!==0&&s<ta[a].priority;a++);ta.splice(a,0,r),a===0&&Mb(r)}};var Nb=t.version;if(Nb!=="19.2.4")throw Error(i(527,Nb,"19.2.4"));B.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=y(s),r=r!==null?_(r):null,r=r===null?null:r.stateNode,r};var X4={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:E,reconcilerVersion:"19.2.4"};
10if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ef=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ef.isDisabled&&Ef.supportsFiber)try{Re=Ef.inject(X4),ft=Ef}catch{}}return wc.createRoot=function(r,s){if(!o(r))throw Error(i(299));var a=!1,c="",d=Hy,p=Vy,R=Fy;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(R=s.onRecoverableError)),s=Eb(r,1,!1,null,null,a,c,null,d,p,R,Ob),r[Ve]=s.current,N0(r),new Q0(s)},wc.hydrateRoot=function(r,s,a){if(!o(r))throw Error(i(299));var c=!1,d="",p=Hy,R=Vy,q=Fy,oe=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(d=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(R=a.onCaughtError),a.onRecoverableError!==void 0&&(q=a.onRecoverableError),a.formState!==void 0&&(oe=a.formState)),s=Eb(r,1,!0,s,a??null,c,d,oe,p,R,q,Ob),s.context=Sb(null),a=s.current,c=fi(),c=V(c),d=Ps(c),d.callback=null,Hs(a,d,c),a=c,s.current.lanes=a,Ni(s,a),Wi(s),r[Ve]=s.current,N0(r),new xf(s)},wc.version="19.2.4",wc}var Wb;function c5(){if(Wb)return rp.exports;Wb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),rp.exports=l5(),rp.exports}var u5=c5();const f5=Xc(u5);function aE(e,t){return function(){return e.apply(t,arguments)}}const{toString:d5}=Object.prototype,{getPrototypeOf:Ea}=Object,{iterator:Qc,toStringTag:oE}=Symbol,Lc=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),lE=e=>typeof e=="string"&&(e==="__proto__"||e==="constructor"||e==="prototype"),cE=(e,t,n)=>e===Object.prototype||!n&&t===null,h5=e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(n=>{if(lE(n))return!1;const i=Object.getOwnPropertyDescriptor(e,n);return!!i&&i.configurable&&i.writable===!0})},zc=(e,t)=>{let n=e;const i=[];for(;n!=null;){if(i.indexOf(n)!==-1)return!1;i.push(n);const o=Ea(n);if(cE(n,o,n===e))return!1;if(Lc(n,t))return!0;n=o}return!1},p5=(e,t)=>e!=null&&zc(e,t)?e[t]:void 0,g5=e=>{if(e==null||typeof e!="object"&&typeof e!="function")return e;const t=Ea(e);if(t===null&&h5(e))return e;const n=Object.create(null),i=Object.create(null),o=[];let l=e;for(;l!=null&&o.indexOf(l)===-1;){o.push(l);const u=l===e?t:Ea(l);if(cE(l,u,l===e))break;const f=Object.getOwnPropertyNames(l);Object.getOwnPropertySymbols&&f.push(...Object.getOwnPropertySymbols(l));for(const h of f)lE(h)||Lc(i,h)||(n[h]=e[h],i[h]=!0);l=u}return n},n1=(e=>t=>{const n=d5.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Mi=e=>(e=e.toLowerCase(),t=>n1(t)===e),Ad=e=>t=>typeof t===e,{isArray:eo}=Array,to=Ad("undefined");function bl(e){return e!==null&&!to(e)&&e.constructor!==null&&!to(e.constructor)&&ii(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uE=Mi("ArrayBuffer");function m5(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uE(e.buffer),t}const y5=Ad("string"),ii=Ad("function"),fE=Ad("number"),vl=e=>e!==null&&typeof e=="object",w5=e=>e===!0||e===!1,Vf=e=>{if(!vl(e))return!1;const t=Ea(e);return(t===null||t===Object.prototype||Ea(t)===null)&&!zc(e,oE)&&!zc(e,Qc)},b5=e=>{if(!vl(e)||bl(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},v5=Mi("Date"),x5=Mi("File"),E5=e=>!!(e&&typeof e.uri<"u"),S5=e=>e&&typeof e.getParts<"u",A5=Mi("Blob"),_5=Mi("FileList"),I5=Mi("Set"),T5=e=>vl(e)&&ii(e.pipe);function R5(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Gb=R5(),Yb=typeof Gb.FormData<"u"?Gb.FormData:void 0,C5=e=>{if(!e)return!1;if(Yb&&e instanceof Yb)return!0;const t=Ea(e);if(!t||t===Object.prototype||!ii(e.append))return!1;const n=n1(e);return n==="formdata"||n==="object"&&ii(e.toString)&&e.toString()==="[object FormData]"},M5=Mi("URLSearchParams"),[B5,D5,O5,N5]=["ReadableStream","Request","Response","Headers"].map(Mi),k5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function eu(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let i,o;if(typeof e!="object"&&(e=[e]),eo(e))for(i=0,o=e.length;i<o;i++)t.call(null,e[i],i,e);else{if(bl(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),u=l.length;let f;for(i=0;i<u;i++)f=l[i],t.call(null,e[f],f,e)}
vendor: 3,022 bytes, line 10
10}function dE(e,t){if(bl(e))return null;t=t.toLowerCase();const n=Object.keys(e);let i=n.length,o;for(;i-- >0;)if(o=n[i],t===o.toLowerCase())return o;return null}const $a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:globalThis,hE=e=>!to(e)&&e!==$a;function dg(...e){const{caseless:t,skipUndefined:n}=hE(this)&&this||{},i={},o=(l,u)=>{if(u==="__proto__"||u==="constructor"||u==="prototype")return;const f=t&&typeof u=="string"&&dE(i,u)||u,h=Lc(i,f)?i[f]:void 0;Vf(h)&&Vf(l)?i[f]=dg(h,l):Vf(l)?i[f]=dg({},l):eo(l)?i[f]=l.slice():(!n||!to(l))&&(i[f]=l)};for(let l=0,u=e.length;l<u;l++){const f=e[l];if(!f||bl(f)||(eu(f,o),typeof f!="object"||eo(f)))continue;const h=Object.getOwnPropertySymbols(f);for(let y=0;y<h.length;y++){const _=h[y];W5.call(f,_)&&o(f[_],_)}}return i}const U5=(e,t,n,{allOwnKeys:i}={})=>(eu(t,(o,l)=>{n&&ii(o)?Object.defineProperty(e,l,{__proto__:null,value:aE(o,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,l,{__proto__:null,value:o,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),j5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),L5=(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},z5=(e,t,n,i)=>{let o,l,u;const f={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),l=o.length;l-- >0;)u=o[l],(!i||i(u,e,t))&&!f[u]&&(t[u]=e[u],f[u]=!0);e=n!==!1&&Ea(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},P5=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return i!==-1&&i===n},H5=e=>{if(!e)return null;if(eo(e))return e;let t=e.length;if(!fE(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},V5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ea(Uint8Array)),F5=(e,t)=>{const i=(e&&e[Qc]).call(e);let o;for(;(o=i.next())&&!o.done;){const l=o.value;t.call(e,l[0],l[1])}},K5=(e,t)=>{let n;const i=[];for(;(n=e.exec(t))!==null;)i.push(n);return i},q5=Mi("HTMLFormElement"),$5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),{propertyIsEnumerable:W5}=Object.prototype,G5=Mi("RegExp"),pE=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};eu(n,(o,l)=>{let u;(u=t(o,l,e))!==!1&&(i[l]=u||o)}),Object.defineProperties(e,i)},Y5=e=>{pE(e,(t,n)=>{if(ii(e)&&["arguments","caller","callee"].includes(n))return!1;const i=e[n];if(ii(i)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Z5=(e,t)=>{const n={},i=o=>{o.forEach(l=>{n[l]=!0})};return eo(e)?i(e):i(String(e).split(t)),n},J5=()=>{},X5=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Q5(e){return!!(e&&ii(e.append)&&e[oE]==="FormData"&&e[Qc])}const e8=e=>{const t=new WeakSet,n=i=>{if(vl(i)){if(t.has(i))return;if(bl(i))return i;
10if(!("toJSON"in i)){t.add(i);let o;if(I5(i)){o=[];for(const l of i){const u=n(l);!to(u)&&o.push(u)}}else o=eo(i)?[]:{},eu(i,(l,u)=>{const f=n(l);!to(f)&&(o[u]=f)});return t.delete(i),o}}return i};return n(e)},t8=Mi("AsyncFunction"),n8=e=>e&&(vl(e)||ii(e))&&ii(e.then)&&ii(e.catch),gE=((e,t)=>e?setImmediate:t?((n,i)=>($a.addEventListener("message",({source:o,data:l})=>{o===$a&&l===n&&i.length&&i.shift()()},!1),o=>{i.push(o),$a.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ii($a.postMessage)),r8=typeof queueMicrotask<"u"?queueMicrotask.bind($a):typeof process<"u"&&process.nextTick||gE,mE=e=>e!=null&&ii(e[Qc]),i8=e=>e!=null&&zc(e,Qc)&&mE(e),de={isArray:eo,isArrayBuffer:uE,isBuffer:bl,isFormData:C5,isArrayBufferView:m5,isString:y5,isNumber:fE,isBoolean:w5,isObject:vl,isPlainObject:Vf,isEmptyObject:b5,isReadableStream:B5,isRequest:D5,isResponse:O5,isHeaders:N5,isUndefined:to,isDate:v5,isFile:x5,isReactNativeBlob:E5,isReactNative:S5,isBlob:A5,isRegExp:G5,isFunction:ii,isStream:T5,isURLSearchParams:M5,isTypedArray:V5,isFileList:_5,forEach:eu,merge:dg,extend:U5,trim:k5,stripBOM:j5,inherits:L5,toFlatObject:z5,kindOf:n1,kindOfTest:Mi,endsWith:P5,toArray:H5,forEachEntry:F5,matchAll:K5,isHTMLForm:q5,hasOwnProperty:Lc,hasOwnProp:Lc,hasOwnInPrototypeChain:zc,getSafeProp:p5,toSafeFlatObject:g5,reduceDescriptors:pE,freezeMethods:Y5,toObjectSet:Z5,toCamelCase:$5,noop:J5,toFiniteNumber:X5,findKey:dE,global:$a,isContextDefined:hE,isSpecCompliantForm:Q5,toJSONObject:e8,isAsyncFn:t8,isThenable:n8,setImmediate:gE,asap:r8,isIterable:mE,isSafeIterable:i8},s8=de.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),a8=e=>{const t={};let n,i,o;return e&&e.split(` 11`).forEach(function(u){o=u.indexOf(":"),n=u.substring(0,o).trim().toLowerCase(),i=u.substring(o+1).trim();const f=de.hasOwnProp(t,n);!n||f&&de.hasOwnProp(s8,n)||(n==="set-cookie"?f?t[n].push(i):t[n]=[i]:t[n]=f?t[n]+", "+i:i)}),t};function o8(e){let t=0,n=e.length;for(;t<n;){const i=e.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;n>t;){const i=e.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const l8=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),c8=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function r1(e,t){return de.isArray(e)?e.map(n=>r1(n,t)):o8(String(e).replace(t,""))}const u8=e=>r1(e,l8),f8=e=>r1(e,c8);function yE(e){const t=Object.create(null);return de.forEach(e.toJSON(),(n,i)=>{t[i]=f8(n)}),t}const Zb=Symbol("internals");function bc(e){return e&&String(e).trim().toLowerCase()}function Ff(e){return e===!1||e==null?e:de.isArray(e)?e.map(Ff):u8(String(e))}function d8(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}const h8=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function op(e){let t=0,n=e.length;for(;t<n;){const i=e.charCodeAt(t);if(i!==9&&i!==32)break;t+=1}for(;n>t;){const i=e.charCodeAt(n-1);if(i!==9&&i!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}function p8(e){const t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n="";for(let i=1;i<t;i++){const o=e.charCodeAt(i);if(o===34||o===92&&(i+=1,i>=t))return e;n+=e[i]}return n}function g8(e){const t=Object.create(null),n=String(e);let i=0,o=!1,l=!1;function u(f){const h=op(n.slice(i,f)),y=h.indexOf("=");if(y<1)return;const _=op(h.slice(0,y));if(!h8.test(_))return;const A=_.toLowerCase();if(A==="__proto__"||A==="constructor"||A==="prototype")return;const D=op(h.slice(y+1));t[A]=p8(D)}for(let f=0;f<n.length;f++){const h=n.charCodeAt(f);o?l?l=!1:h===92?l=!0:h===34&&(o=!1):h===34?o=!0:(h===44||h===59)&&(u(f),i=f+1)}return u(n.length),t}const m8=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function lp(e,t,n,i,o){if(de.isFunction(i))return i.call(this,t,n);if(o&&(t=n),!!de.isString(t)){if(de.isString(i))return t.indexOf(i)!==-1;if(de.isRegExp(i))return i.test(t)}}function y8(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i)}function w8(e,t){const n=de.toCamelCase(" "+t);["get","set","has"].forEach(i=>
vendor: 3,686 bytes, lines 11-12
11{Object.defineProperty(e,i+n,{__proto__:null,value:function(o,l,u){return this[i].call(this,t,o,l,u)},configurable:!0})})}let Hr=class{constructor(t){t&&this.set(t)}set(t,n,i){const o=this;function l(f,h,y){const _=bc(h);if(!_)return;const A=de.findKey(o,_);(!A||o[A]===void 0||y===!0||y===void 0&&o[A]!==!1)&&(o[A||h]=Ff(f))}const u=(f,h)=>de.forEach(f,(y,_)=>l(y,_,h));if(de.isPlainObject(t)||t instanceof this.constructor)u(t,n);else if(de.isString(t)&&(t=t.trim())&&!m8(t))u(a8(t),n);else if(de.isObject(t)&&de.isSafeIterable(t)){let f=Object.create(null),h,y;for(const _ of t){if(!de.isArray(_))throw new TypeError("Object iterator must return a key-value pair");y=_[0],de.hasOwnProp(f,y)?(h=f[y],f[y]=de.isArray(h)?[...h,_[1]]:[h,_[1]]):f[y]=_[1]}u(f,n)}else t!=null&&l(n,t,i);return this}get(t,n){if(t=bc(t),t){const i=de.findKey(this,t);if(i){const o=this[i];if(!n)return o;if(n===!0)return d8(o);if(de.isFunction(n))return n.call(this,o,i);if(de.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=bc(t),t){const i=de.findKey(this,t);return!!(i&&this[i]!==void 0&&(!n||lp(this,this[i],i,n)))}return!1}delete(t,n){const i=this;let o=!1;function l(u){if(u=bc(u),u){const f=de.findKey(i,u);f&&(!n||lp(i,i[f],f,n))&&(delete i[f],o=!0)}}return de.isArray(t)?t.forEach(l):l(t),o}clear(t){const n=Object.keys(this);let i=n.length,o=!1;for(;i--;){const l=n[i];(!t||lp(this,this[l],l,t,!0))&&(delete this[l],o=!0)}return o}normalize(t){const n=this,i={};return de.forEach(this,(o,l)=>{const u=de.findKey(i,l);if(u){n[u]=Ff(o),delete n[l];return}const f=t?y8(l):String(l).trim();f!==l&&delete n[l],n[f]=Ff(o),i[f]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return de.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=t&&de.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` 12`)}getSetCookie(){const t=this.get("set-cookie");return de.isArray(t)?t:t==null||t===!1?[]:[t]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static parseParameters(t){return g8(t)}static concat(t,...n){const i=new this(t);return n.forEach(o=>i.set(o)),i}static accessor(t){const i=(this[Zb]=this[Zb]={accessors:{}}).accessors,o=this.prototype;function l(u){const f=bc(u);i[f]||(w8(o,u),i[f]=!0)}return de.isArray(t)?t.forEach(l):l(t),this}};Hr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);de.reduceDescriptors(Hr.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(i){this[n]=i}}});de.freezeMethods(Hr);const ed="[REDACTED ****]";function b8(e){if(de.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(de.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function v8(e,t){const n=new Set(t.map(l=>String(l).toLowerCase())),i=[],o=l=>{if(l===null||typeof l!="object"||de.isBuffer(l))return l;if(i.indexOf(l)!==-1)return;l instanceof Hr&&(l=l.toJSON()),i.push(l);let u;if(de.isArray(l))u=[],l.forEach((f,h)=>{const y=o(f);de.isUndefined(y)||(u[h]=y)});else{if(!de.isPlainObject(l)&&b8(l))return i.pop(),l;u=Object.create(null);for(const[f,h]of Object.entries(l)){const y=n.has(f.toLowerCase())?ed:o(h);de.isUndefined(y)||(u[f]=y)}}return i.pop(),u};return o(e)}function Jb(e){try{return String(e)}catch{return""}}function x8(e){return e.errors.map(n=>{try{return n&&n.message?Jb(n.message):Jb(n)}catch{return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}
12let Je=class wE extends Error{static from(t,n,i,o,l,u){let f=t.message;!f&&de.isArray(t.errors)&&t.errors.length&&(f=x8(t));const h=new wE(f,n||t.code,i,o,l);return Object.defineProperty(h,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),h.name=t.name,t.status!=null&&h.status==null&&(h.status=t.status),u&&Object.assign(h,u),h}constructor(t,n,i,o,l){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),o&&(this.request=o),l&&(this.response=l,this.status=l.status)}toJSON(){const t=this.config,n=t&&de.hasOwnProp(t,"redact")?t.redact:void 0,i=de.isArray(n)&&n.length>0?v8(t,n):de.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:i,code:this.code,status:this.status}}};Je.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Je.ERR_BAD_OPTION="ERR_BAD_OPTION";Je.ECONNABORTED="ECONNABORTED";Je.ETIMEDOUT="ETIMEDOUT";Je.ECONNREFUSED="ECONNREFUSED";Je.ERR_NETWORK="ERR_NETWORK";Je.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Je.ERR_DEPRECATED="ERR_DEPRECATED";Je.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Je.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Je.ERR_CANCELED="ERR_CANCELED";Je.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Je.ERR_INVALID_URL="ERR_INVALID_URL";Je.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const E8=null,bE=100;function hg(e){return de.isPlainObject(e)||de.isArray(e)}function vE(e){return de.endsWith(e,"[]")?e.slice(0,-2):e}function cp(e,t,n){return e?e.concat(t).map(function(o,l){return o=vE(o),!n&&l?"["+o+"]":o}).join(n?".":""):t}function S8(e){return de.isArray(e)&&!e.some(hg)}const A8=de.toFlatObject(de,{},null,function(t){return/^is[A-Z]/.test(t)});function _d(e,t,n){if(!de.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(W,K)=>{const se=de.getSafeProp(n,W);return de.isUndefined(se)?K:se},o=i("metaTokens",!0),l=i("visitor")||k,u=i("dots",!1),f=i("indexes",!1),h=i("Blob")||typeof Blob<"u"&&Blob,y=i("maxDepth",bE),_=h&&de.isSpecCompliantForm(t),A=[];if(!de.isFunction(l))throw new TypeError("visitor must be a function");function D(W){if(W===null)return"";if(de.isDate(W))return W.toISOString();if(de.isBoolean(W))return W.toString();if(!_&&de.isBlob(W))throw new Je("Blob is not supported. Use a Buffer instead.");if(de.isArrayBuffer(W)||de.isTypedArray(W)){if(_&&typeof h=="function")return new h([W]);throw new Je("Blob is not supported. Use a Buffer instead.",Je.ERR_NOT_SUPPORT)}return W}function U(W){if(W>y)throw new Je("Object is too deeply nested ("+W+" levels). Max depth: "+y,Je.ERR_FORM_DATA_DEPTH_EXCEEDED)}function L(W,K){if(y===1/0)return JSON.stringify(W);const se=[];return JSON.stringify(W,function(te,pe){if(!de.isObject(pe))return pe;for(;se.length&&se[se.length-1]!==this;)se.pop();return se.push(pe),U(K+se.length-1),pe})}function k(W,K,se){let re=W;if(de.isReactNative(t)&&de.isReactNativeBlob(W))return t.append(cp(se,K,u),D(W)),!1;if(W&&!se&&typeof W=="object"){if(de.endsWith(K,"{}"))K=o?K:K.slice(0,-2),W=L(W,1);else if(de.isArray(W)&&S8(W)||(de.isFileList(W)||de.endsWith(K,"[]"))&&(re=de.toArray(W)))return K=vE(K),re.forEach(function(pe,we){!(de.isUndefined(pe)||pe===null)&&t.append(f===!0?cp([K],we,u):f===null?K:K+"[]",D(pe))}),!1}return hg(W)?!0:(t.append(cp(se,K,u),D(W)),!1)}const j=Object.assign(A8,{defaultVisitor:k,convertValue:D,isVisitable:hg});function M(W,K,se=0){if(!de.isUndefined(W)){if(U(se),A.indexOf(W)!==-1)throw new Error("Circular reference detected in "+K.join("."));A.push(W),de.forEach(W,function(te,pe){(!(de.isUndefined(te)||te===null)&&l.call(t,te,de.isString(pe)?pe.trim():pe,K,j))===!0&&M(te,K?K.concat(pe):[pe],se+1)}),A.pop()}}if(!de.isObject(e))throw new TypeError("data must be an object");return M(e),t}function Xb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(i){return t[i]})}function i1(e,t){this._pairs=[],e&&_d(e,this,t)}const xE=i1.prototype;xE.append=function(t,n){this._pairs.push([t,n])};xE.toString=function(t){const n=t?i=>t.call(this,i,Xb):Xb;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function _8(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function EE(e,t,n){if(!t)return e;e=e||"";const i=de.isFunction(n)?{serialize:n}:n,o=de.getSafeProp(i,"encode")||_8,l=de.getSafeProp(i,"serialize");let u;if(l?u=l(t,i):u=de.isURLSearchParams(t)?t.toString():new i1(t,i).toString(o),u){const f=e.indexOf("#");f!==-1&&(e=e.slice(0,f)),e+=(e.indexOf("?")===-1?"?":"&")+u}return e}const vc=Symbol("internals");function SE(e){return e?e.length:0}function Qb(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function xc(e,t){const n=e.handlers,i=SE(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):i!==t.handlersLength&&(i?t.handlerEntries.forEac
12h(function(l,u){n[l.index]!==l.handler&&t.handlerEntries.delete(u)}):t.handlerEntries.clear()),t.handlersLength=i}class ev{constructor(){this.handlers=[],this[vc]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(t,n,i){const o={fulfilled:t,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null},l=this[vc];this.handlers==null&&(this.handlers=[]),xc(this,l);const u=l.nextId++;return this.handlers.push(o),l.handlerEntries.set(u,{handler:o,index:this.handlers.length-1}),l.handlersLength=this.handlers.length,u}eject(t){const n=this[vc];xc(this,n);const i=n.handlerEntries.get(t);if(i){if(n.handlerEntries.delete(t),this.handlers[i.index]!==i.handler)return;this.handlers[i.index]=null,n.iterationDepth||(Qb(this.handlers),n.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],xc(this,this[vc]))}forEach(t){const n=this[vc];xc(this,n),n.iterationDepth++;try{de.forEach(this.handlers,function(o){o!==null&&t(o)})}finally{--n.iterationDepth||(xc(this,n),Qb(this.handlers),n.handlersLength=SE(this.handlers))}}}const s1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},I8=typeof URLSearchParams<"u"?URLSearchParams:i1,T8=typeof FormData<"u"?FormData:null,R8=typeof Blob<"u"?Blob:null,C8={isBrowser:!0,classes:{URLSearchParams:I8,FormData:T8,Blob:R8},protocols:["http","https","file","blob","url","data"]},a1=typeof window<"u"&&typeof document<"u",pg=typeof navigator=="object"&&navigator||void 0,M8=a1&&(!pg||["ReactNative","NativeScript","NS"].indexOf(pg.product)<0),B8=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",D8=a1&&window.location.href||"http://localhost",O8=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:a1,hasStandardBrowserEnv:M8,hasStandardBrowserWebWorkerEnv:B8,navigator:pg,origin:D8},Symbol.toStringTag,{value:"Module"})),mr={...O8,...C8};function N8(e,t){return _d(e,new mr.classes.URLSearchParams,{visitor:function(n,i,o,l){return mr.isNode&&de.isBuffer(n)?(this.append(i,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}const tv=bE;function AE(e){if(e>tv)throw new Je("FormData field is too deeply nested ("+e+" levels). Max depth: "+tv,Je.ERR_FORM_DATA_DEPTH_EXCEEDED)}function k8(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let i;for(;(i=n.exec(e))!==null;)AE(t.length),t.push(i[0]==="[]"?"":i[1]||i[0]);return t}function U8(e){const t={},n=Object.keys(e);let i;const o=n.length;let l;for(i=0;i<o;i++)l=n[i],t[l]=e[l];return t}function _E(e){function t(n,i,o,l){AE(l);let u=n[l++];if(u==="__proto__")return!0;const f=Number.isFinite(+u),h=l>=n.length;return u=!u&&de.isArray(o)?o.length:u,h?(de.hasOwnProp(o,u)?o[u]=de.isArray(o[u])?o[u].concat(i):[o[u],i]:o[u]=i,!f):((!de.hasOwnProp(o,u)||!de.isObject(o[u]))&&(o[u]=[]),t(n,i,o[u],l)&&de.isArray(o[u])&&(o[u]=U8(o[u])),!f)}if(de.isFormData(e)&&de.isFunction(e.entries)){const n={};return de.forEachEntry(e,(i,o)=>{t(k8(i),o,n,0)}),n}return null}const IE=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),$o=(e,t)=>e!=null&&de.hasOwnProp(e,t)?e[t]:void 0;function j8(e,t,n){if(de.isString(e))try{return(t||JSON.parse)(e),de.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(e)}const tu={transitional:s1,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,l=de.isObject(t);if(l&&de.isHTMLForm(t)&&(t=new FormData(t)),de.isFormData(t))return o?JSON.stringify(_E(t)):t;if(de.isArrayBuffer(t)||de.isBuffer(t)||de.isStream(t)||de.isFile(t)||de.isBlob(t)||de.isReadableStream(t))return t;if(de.isArrayBufferView(t))return t.buffer;if(de.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let f;
12if(l){const h=$o(this,"formSerializer");if(i.indexOf("application/x-www-form-urlencoded")>-1)return N8(t,h).toString();if((f=de.isFileList(t))||i.indexOf("multipart/form-data")>-1){const y=$o(this,"env"),_=y&&y.FormData;return _d(f?{"files[]":t}:t,_&&new _,h)}}return l||o?(n.setContentType("application/json",!1),j8(t)):t}],transformResponse:[function(t){const n=$o(this,"transitional")||tu.transitional,i=n&&n.forcedJSONParsing,o=$o(this,"responseType"),l=o==="json";if(de.isResponse(t)||de.isReadableStream(t))return t;if(t&&de.isString(t)&&(i&&!o||l)){const f=!(n&&n.silentJSONParsing)&&l;try{return JSON.parse(t,$o(this,"parseReviver"))}catch(h){if(f)throw h.name==="SyntaxError"?Je.from(h,Je.ERR_BAD_RESPONSE,this,null,$o(this,"response")):h}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:mr.classes.FormData,Blob:mr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};de.forEach(IE,e=>{tu.headers[e]={}});function up(e,t){const n=this||tu,i=t||n,o=Hr.from(i.headers);let l=i.data;return de.forEach(e,function(f){l=f.call(n,l,o.normalize(),t?t.status:void 0)}),o.normalize(),l}function TE(e){return!!(e&&e.__CANCEL__)}let nu=class extends Je{constructor(t,n,i){super(t??"canceled",Je.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function RE(e,t,n){const i=n.config.validateStatus;!n.status||!i||i(n.status)?e(n):t(new Je("Request failed with status code "+n.status,n.status>=400&&n.status<500?Je.ERR_BAD_REQUEST:Je.ERR_BAD_RESPONSE,n.config,n.request,n))}const L8=/[\t\n\r]/g;function CE(e){if(typeof e!="string")return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(L8,"")}function fp(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function z8(e,t){e=e||10;const n=new Array(e),i=new Array(e);let o=0,l=0,u;return t=t!==void 0?t:1e3,function(h){const y=Date.now(),_=i[l];u||(u=y),n[o]=h,i[o]=y;let A=l,D=0;for(;A!==o;)D+=n[A++],A=A%e;if(o=(o+1)%e,o===l&&(l=(l+1)%e),y-u<t)return;const U=_&&y-_;return U?Math.round(D*1e3/U):void 0}}function P8(e,t){let n=0,i=1e3/t,o,l;const u=(_,A=Date.now())=>{n=A,o=null,l&&(clearTimeout(l),l=null),e(..._)};return[(..._)=>{const A=Date.now(),D=A-n;D>=i?u(_,A):(o=_,l||(l=setTimeout(()=>{l=null,u(o)},i-D)))},()=>o&&u(o),(..._)=>u(_)]}const td=(e,t,n=3)=>{let i=0;const o=z8(50,250);return P8(l=>{if(!l||!de.isNumber(l.loaded))return;const u=l.loaded,f=l.lengthComputable?l.total:void 0,h=Math.max(0,f!=null?Math.min(u,f):u),y=Math.max(0,h-i),_=o(y);i=Math.max(i,h);const A={loaded:h,total:f,progress:f?h/f:void 0,bytes:y,rate:_||void 0,estimated:_&&f?(f-h)/_:void 0,event:l,lengthComputable:f!=null,[t?"download":"upload"]:!0};e(A)},n)},nv=(e,t)=>{const n=e!=null;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},rv=(e,t=de.asap)=>(...n)=>t(()=>e(...n)),H8=mr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,mr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(mr.origin),mr.navigator&&/(msie|trident)/i.test(mr.navigator.userAgent)):()=>!0,V8=mr.hasStandardBrowserEnv?{write(e,t,n,i,o,l,u){if(typeof document>"u")return;const f=[`${e}=${encodeURIComponent(t)}`];de.isNumber(n)&&f.push(`expires=${new Date(n).toUTCString()}`),de.isString(i)&&f.push(`path=${i}`),de.isString(o)&&f.push(`domain=${o}`),l===!0&&f.push("secure"),de.isString(u)&&f.push(`SameSite=${u}`),document.cookie=f.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;n<t.length;n++){const i=t[n].replace(/^\s+/,""),o=i.indexOf("=");if(o!==-1&&i.slice(0,o)===e)try{return decodeURIComponent(i.slice(o+1))}catch{return i.slice(o+1)}}return null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function F8(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function K8(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+"/"+t.replace(/^\/+/,"")}const q8=/^https?:(?!\/\/)/i;function $8(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(t,n,i="")=>`${n}${i}${ed}`)}function W8(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${ed}@`),n=t.indexOf("#"),o=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${ed}`);return n===-1?o:`${o}#${$8(t.slice(n+1))}`}function iv(e,t){if(typeof e=="string"){const n=CE(e);if(q8.test(n))throw new Je(`Invalid URL ${JSON.stringify(W8(n))}: missing "//" after protocol`,Je.ERR_INVALID_URL,t)}}function ME(e,t,n,i){iv(t,i);let o=!F8(t);return e&&(o||n===!1)?(iv(e,i),K8(e,t)):t}const sv=e=>e instanceof Hr?{...e}:e,G8=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function no(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function i(_,A,D,U){return de.isPlainObject(_)&&de.isPlainObject(A)?de.merge.call({caseless:U},_,A):de.isPlainObject(A)?de.merge({},A):de.isArray(A)?A.slice():A}function o(_,A,D,U){if(de.isUndefined(A)){if(!de.isUndefined(_))return i(void 0,_,D,U)}else return i(_,A,D,U)}function l(_,A){if(!de.isUndefined(A))return i(void 0,A)}function u(_,A){if(de.isUndefined(A)){if(!de.isUndefined(_))return i(void 0,_)}else return i(void 0,A)}function f(_){const A=de.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!de.isUndefined(A))if(de.isPlainObject(A)){if(de.hasOwnProp(A,_))return A[_]}else return;const D=de.hasOwnProp(e,"transitional")?e.transitional:void 0;if(de.isPlainObject(D)&&de.hasOwnProp(D,_))return D[_]}function h(_,A,D){if(de.hasOwnProp(t,D))return i(_,A);if(de.hasOwnProp(e,D))return i(void 0,_)}const y={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutErrorMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,allowedSocketPaths:u,responseEncoding:u,validateStatus:h,headers:(_,A,D)=>o(sv(_),sv(A),D,!0)};return de.forEach(G8({...e,...t}),function(A){if(A==="__proto__"||A==="constructor"||A==="prototype")return;const D=de.hasOwnProp(y,A)?y[A]:o,U=de.hasOwnProp(e,A)?e[A]:void 0,L=de.hasOwnProp(t,A)?t[A]:void 0,k=D(U,L,A);de.isUndefined(k)&&D!==h||(n[A]=k)}),de.hasOwnProp(t,"validateStatus")&&de.isUndefined(t.validateStatus)&&f("validateStatusUndefinedResolves")===!1&&(de.hasOwnProp(e,"validateStatus")?n.validateStatus=i(void 0,e.validateStatus):delete n.val
12idateStatus),n}const Y8=["content-type","content-length"];function Z8(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t||{}).forEach(([i,o])=>{Y8.includes(i.toLowerCase())&&e.set(i,o)})}const J8=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function BE(e){const t=no({},e),n=D=>de.hasOwnProp(t,D)?t[D]:void 0,i=n("data");let o=n("withXSRFToken");const l=n("xsrfHeaderName"),u=n("xsrfCookieName");let f=n("headers");const h=n("auth"),y=n("baseURL"),_=n("allowAbsoluteUrls"),A=n("url");if(t.headers=f=Hr.from(f),t.url=EE(ME(y,A,_,t),n("params"),n("paramsSerializer")),h){const D=de.getSafeProp(h,"username")||"",U=de.getSafeProp(h,"password")||"";try{f.set("Authorization","Basic "+btoa(D+":"+(U?J8(U):"")))}catch(L){throw Je.from(L,Je.ERR_BAD_OPTION_VALUE,e)}}if(de.isFormData(i)){const D=de.getSafeProp(i,"getHeaders");mr.hasStandardBrowserEnv||mr.hasStandardBrowserWebWorkerEnv||de.isReactNative(i)?f.setContentType(void 0):de.isFunction(D)&&Z8(f,D.call(i),n("formDataHeaderPolicy"))}if(mr.hasStandardBrowserEnv&&(de.isFunction(o)&&(o=o(t)),o===!0||o==null&&H8(t.url))){const U=l&&u&&V8.read(u);U&&f.set(l,U)}return t}const X8=typeof XMLHttpRequest<"u",Q8=X8&&function(e){return new Promise(function(n,i){const o=BE(e);let l=o.data;const u=Hr.from(o.headers).normalize();let{responseType:f,onUploadProgress:h,onDownloadProgress:y}=o,_,A,D,U,L,k;function j(){U&&U(),L&&L(),o.cancelToken&&o.cancelToken.unsubscribe(_),o.signal&&o.signal.removeEventListener("abort",_)}let M=new XMLHttpRequest;M.open(o.method.toUpperCase(),o.url,!0),M.timeout=o.timeout;function W(se){if(!M)return;if(M.status===0&&(fp(CE(o.url))||fp(mr.origin))!=="file"&&!(M.responseURL&&M.responseURL.startsWith("file:"))){i(new Je("Request aborted",Je.ECONNABORTED,e,M)),j(),M=null;return}try{se?k&&k(se):L&&L()}catch(we){setTimeout(()=>{throw we})}if(!M)return;const re=Hr.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),pe={data:!f||f==="text"||f==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:re,config:e,request:M};RE(function(X){n(X),j()},function(X){i(X),j()},pe),M=null}"onloadend"in M?M.onloadend=W:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.startsWith("file:"))||setTimeout(W)},M.onabort=function(){M&&(i(new Je("Request aborted",Je.ECONNABORTED,e,M)),j(),M=null)},M.onerror=function(re){const te=re&&re.message?re.message:"Network Error",pe=new Je(te,Je.ERR_NETWORK,e,M);pe.event=re||null,i(pe),j(),M=null},M.ontimeout=function(){let re=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const te=o.transitional||s1;o.timeoutErrorMessage&&(re=o.timeoutErrorMessage),i(new Je(re,te.clarifyTimeoutError?Je.ETIMEDOUT:Je.ECONNABORTED,e,M)),j(),M=null},l===void 0&&u.setContentType(null),"setRequestHeader"in M&&de.forEach(yE(u),function(re,te){M.setRequestHeader(te,re)}),de.isUndefined(o.withCredentials)||(M.withCredentials=!!o.withCredentials),f&&f!=="json"&&(M.responseType=o.responseType),y&&([D,L,k]=td(y,!0),M.addEventListener("progress",D)),h&&M.upload&&([A,U]=td(h),M.upload.addEventListener("progress",A),M.upload.addEventListener("loadend",U)),(o.cancelToken||o.signal)&&(_=se=>{M&&(i(!se||se.type?new nu(null,e,M):se),M.abort(),j(),M=null)},o.cancelToken&&o.cancelToken.subscribe(_),o.signal&&(o.signal.aborted?_():o.signal.addEventListener("abort",_)));const K=fp(o.url);if(K&&!mr.protocols.includes(K)){i(new Je("Unsupported protocol "+K+":",Je.ERR_BAD_REQUEST,e)),j();return}M.send(l||null)})},eA=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let i=!1;const o=function(h){if(!i){i=!0,u();const y=h instanceof Error?h:this.reason;n.abort(y instanceof Je?y:new nu(y instanceof Error?y.message:y))}};let l=t&&setTimeout(()=>{l=null,o(new Je(`timeout of ${t}ms exceeded`,Je.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),e=null)};e.forEach(h=>{if(!i){if(h.aborted){o.call(h);return}h.addEventListener("abort",o,{once:!0})}});const{signal:f}=n;return f.unsubscribe=()=>de.asap(u),f},tA=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let i=0,o;for(;i<n;)o=i+t,yield e.slice(i,o),i=o},nA=async function*(e,t){for await(const n of rA(e))yield*tA(n,t)},rA=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:i}=await t.read();if(n)break;yield i}}finally{await t.cancel()}},av=(e,t,n,i)=>{const o=nA(e,t);let l=0,u,f=h=>{u||(u=!0,i&&i(h))};return new ReadableStream({async pull(h){try{const{done:y,value:_}=await o.next();if(y){f(),h.close();return}let A=_.byteLength;if(n){let D=l+=A;n(D)}h.enqueue(new Uint8Array(_))}catch(y){throw f(y),y}},cancel(h){return f(h),o.return()}},{highWaterMark:2})},ov=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,DE=(e,t,n)=>t+2<n&&ov(e.charCodeAt(t+1))&&ov(e.charCodeAt(t+2)),lv=e=>e<=57?e-48:(e&223)-55,iA=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,sA=e=>e===9||e===10||e===12||e===13||e===32,aA=e=>{const t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},oA=e=>{const t=e.length;let n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},lA=e=>{const t=e.length;let n=0,i=0,o=!1;for(let l=0;l<t;l++){let u=e.charCodeAt(l);if(u===37&&DE(e,l,t)&&(u=lv(e.charCodeAt(l+1))*16+lv(e.charCodeAt(l+2)),l+=2),!sA(u)){if(u===61){i++;continue}if(!iA(u)||i>0){o=!0;continue}n++}}return o||i>2||i>0&&(n+i)%4!==0||n%4===1?oA(e):aA(n)},cA=(e,t)=>{if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const n=e.indexOf(",");if(n<0)return 0;const i=e.slice(5,n),o=e.slice(n+1);if(/;base64/i.test(i))return t(o);let u=0;for(let f=0,h=o.length;f<h;
vendor: 4,290 bytes, line 12
12f++){const y=o.charCodeAt(f);if(y===37&&DE(o,f,h))u+=1,f+=2;else if(y<128)u+=1;else if(y<2048)u+=2;else if(y>=55296&&y<=56319&&f+1<h){const _=o.charCodeAt(f+1);_>=56320&&_<=57343?(u+=4,f++):u+=3}else u+=3}return u};function uA(e){const t=typeof e=="string"?e.indexOf("#"):-1;return cA(t===-1?e:e.slice(0,t),lA)}const o1="1.20.0",cv=64*1024,fA={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Af}=de,dA=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),uv=e=>{if(!de.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},fv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},hA=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},pA=e=>{const t=de.global!==void 0&&de.global!==null?de.global:globalThis,{ReadableStream:n,TextEncoder:i}=t;e=de.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:o,Request:l,Response:u}=e,f=o?Af(o):typeof fetch=="function",h=Af(l),y=Af(u);if(!f)return!1;const _=f&&Af(n),A=f&&(typeof i=="function"?(M=>W=>M.encode(W))(new i):async M=>new Uint8Array(await new l(M).arrayBuffer())),D=h&&_&&fv(()=>{let M=!1;const W=new l(mr.origin,{body:new n,method:"POST",get duplex(){return M=!0,"half"}}),K=W.headers.has("Content-Type");return W.body!=null&&W.body.cancel(),M&&!K}),U=y&&_&&fv(()=>de.isReadableStream(new u("").body)),L={stream:U&&(M=>M.body)};f&&["text","arrayBuffer","blob","formData","stream"].forEach(M=>{!L[M]&&(L[M]=(W,K)=>{let se=W&&W[M];if(se)return se.call(W);throw new Je(`Response type '${M}' is not supported`,Je.ERR_NOT_SUPPORT,K)})});const k=async M=>{if(M==null)return 0;if(de.isBlob(M))return M.size;if(de.isSpecCompliantForm(M))return(await new l(mr.origin,{method:"POST",body:M}).arrayBuffer()).byteLength;if(de.isArrayBufferView(M)||de.isArrayBuffer(M))return M.byteLength;if(de.isURLSearchParams(M)&&(M=M+""),de.isString(M))return(await A(M)).byteLength},j=async(M,W)=>{const K=de.toFiniteNumber(M.getContentLength());return K??k(W)};return async M=>{let{url:W,method:K,data:se,signal:re,cancelToken:te,timeout:pe,onDownloadProgress:we,onUploadProgress:X,responseType:Z,headers:ae,withCredentials:ce="same-origin",fetchOptions:N,maxContentLength:g,maxBodyLength:v,maxRedirects:E}=BE(M);const B=de.isNumber(g)&&g>-1,z=de.isNumber(v)&&v>-1,G=ue=>de.hasOwnProp(M,ue)?M[ue]:void 0;let J=o||fetch;Z=Z?(Z+"").toLowerCase():"text";let T=eA([re,te&&te.toAbortSignal()],pe),m=null;const b=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let O,P=null;const ne=()=>new Je("Request body larger than maxBodyLength limit",Je.ERR_BAD_REQUEST,M,m);try{let ue;const Te=G("auth");if(Te){const Ze=de.getSafeProp(Te,"username")||"",an=de.getSafeProp(Te,"password")||"";ue={username:Ze,password:an}}if(hA(W)){const Ze=new URL(W,mr.origin);if(!ue&&(Ze.username||Ze.password)){const an=uv(Ze.username),jt=uv(Ze.password);ue={username:an,password:jt}}(Ze.username||Ze.password)&&(Ze.username="",Ze.password="",W=Ze.href)}if(ue&&(ae.delete("authorization"),ae.set("Authorization","Basic "+btoa(dA((ue.username||"")+":"+(ue.password||""))))),B&&typeof W=="string"&&W.startsWith("data:")&&uA(W)>g)throw new Je("maxContentLength size of "+g+" exceeded",Je.ERR_BAD_RESPONSE,M,m);if(z&&K!=="get"&&K!=="head"){const Ze=await k(se);if(typeof Ze=="number"&&isFinite(Ze)&&(O=Ze,Ze>v))throw ne()}const ve=z&&(de.isReadableStream(se)||de.isStream(se)),Xe=(Ze,an,jt)=>av(Ze,cv,Lt=>{if(z&&Lt>v)throw P=ne();an&&an(Lt)},jt);if(D&&K!=="get"&&K!=="head"&&(X||ve)){if(O=O??await j(ae,se),O!==0||ve){let Ze=new l(W,{method:"POST",body:se,duplex:"half"}),an;if(de.isFormData(se)&&(an=Ze.headers.get("content-type"))&&ae.setContentType(an),Ze.body){const[jt,Lt]=X&&nv(O,td(rv(X)))||[];se=Xe(Ze.body,jt,Lt)}}}else if(ve&&!h&&_&&K!=="get"&&K!=="head")se=Xe(se);else if(ve&&h&&!D&&K!=="get"&&K!=="head")throw new Je("Stream request bodies are not supported by the current fetch implementation",Je.ERR_NOT_SUPPORT,M,m);de.isString(ce)||(ce=ce?"include":"omit");const mt=h&&"credentials"in l.prototype;if(de.isFormData(se)){const Ze=ae.getContentType();Ze&&/^multipart\/form-data/i.test(Ze)&&!/boundary=/i.test(Ze)&&ae.delete("content-type")}
vendor: 6,369 bytes, lines 12-18
12ae.set("User-Agent","axios/"+o1,!1);const He=N==null?N:Object.assign(Object.create(null),N);He&&(delete He.body,delete He.headers,delete He.method,delete He.signal,delete He.duplex,delete He.credentials);const At=Object.assign(Object.create(null),He,{signal:T,method:K.toUpperCase(),headers:yE(ae.normalize()),body:se,duplex:"half",credentials:mt?ce:void 0});h&&(de.forEach(fA,(Ze,an)=>{At[an]===void 0&&(At[an]=Ze)}),At.signal===void 0&&(At.signal=null),At.body===void 0&&(At.body=null)),E===0&&(At.redirect="manual",He&&(He.redirect="manual")),m=h&&new l(W,At);let tt=await(h?J(m,He):J(W,At));const Rt=Hr.from(tt.headers);if(B){const Ze=de.toFiniteNumber(Rt.getContentLength());if(Ze!=null&&Ze>g)throw new Je("maxContentLength size of "+g+" exceeded",Je.ERR_BAD_RESPONSE,M,m)}const qn=U&&(Z==="stream"||Z==="response");if(U&&tt.body&&(we||B||qn&&b)){const Ze={};["status","statusText","headers"].forEach(qe=>{Ze[qe]=tt[qe]});const an=de.toFiniteNumber(Rt.getContentLength()),[jt,Lt]=we&&nv(an,td(rv(we),!0))||[];let jn=0;const Fe=qe=>{if(B&&(jn=qe,jn>g))throw new Je("maxContentLength size of "+g+" exceeded",Je.ERR_BAD_RESPONSE,M,m);jt&&jt(qe)};tt=new u(av(tt.body,cv,Fe,()=>{Lt&&Lt(),b&&b()}),Ze)}Z=Z||"text";let Bt=await L[de.findKey(L,Z)||"text"](tt,M);if(B&&!U&&!qn){let Ze;if(Bt!=null&&(typeof Bt.byteLength=="number"?Ze=Bt.byteLength:typeof Bt.size=="number"?Ze=Bt.size:typeof Bt=="string"&&(Ze=typeof i=="function"?new i().encode(Bt).byteLength:Bt.length)),typeof Ze=="number"&&Ze>g)throw new Je("maxContentLength size of "+g+" exceeded",Je.ERR_BAD_RESPONSE,M,m)}return!qn&&b&&b(),await new Promise((Ze,an)=>{RE(Ze,an,{data:Bt,headers:Hr.from(tt.headers),status:tt.status,statusText:tt.statusText,config:M,request:m})})}catch(ue){if(b&&b(),T&&T.aborted&&T.reason instanceof Je){const Te=T.reason;throw Te.config=M,m&&(Te.request=m),ue!==Te&&Object.defineProperty(Te,"cause",{__proto__:null,value:ue,writable:!0,enumerable:!1,configurable:!0}),Te}if(P)throw m&&!P.request&&(P.request=m),P;if(ue instanceof Je)throw m&&!ue.request&&(ue.request=m),ue;if(ue&&ue.name==="TypeError"&&/Load failed|fetch/i.test(ue.message)){const Te=new Je("Network Error",Je.ERR_NETWORK,M,m,ue&&ue.response);throw Object.defineProperty(Te,"cause",{__proto__:null,value:ue.cause||ue,writable:!0,enumerable:!1,configurable:!0}),Te}throw Je.from(ue,ue&&ue.code,M,m,ue&&ue.response)}}},gA=new Map,OE=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:o}=t,l=[i,o,n];let u=l.length,f=u,h,y,_=gA;for(;f--;)h=l[f],y=_.get(h),y===void 0&&_.set(h,y=f?new Map:pA(t)),_=y;return y};OE();const l1={http:E8,xhr:Q8,fetch:{get:OE}};de.forEach(l1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const dv=e=>`- ${e}`,mA=e=>de.isFunction(e)||e===null||e===!1;function yA(e,t){e=de.isArray(e)?e:[e];const{length:n}=e;let i,o;const l={};for(let u=0;u<n;u++){i=e[u];let f;if(o=i,!mA(i)&&(o=l1[(f=String(i)).toLowerCase()],o===void 0))throw new Je(`Unknown adapter '${f}'`);if(o&&(de.isFunction(o)||(o=o.get(t))))break;l[f||"#"+u]=o}if(!o){const u=Object.entries(l).map(([h,y])=>`adapter ${h} `+(y===!1?"is not supported by the environment":"is not available in the build"));let f=n?u.length>1?`since : 13`+u.map(dv).join(` 14`):" "+dv(u[0]):"as no adapter specified";throw new Je("There is no suitable adapter to dispatch the request "+f,Je.ERR_NOT_SUPPORT)}return o}const NE={getAdapter:yA,adapters:l1};function dp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nu(null,e)}function hp(e){const t=de.toSafeFlatObject(e);return dp(t),t.headers=Hr.from(de.getSafeProp(t,"headers")),t.data=up.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),NE.getAdapter(t.adapter||tu.adapter,t)(t).then(function(o){dp(t),t.response=o;try{o.data=up.call(t,t.transformResponse,o)}finally{delete t.response}return o.headers=Hr.from(o.headers),o},function(o){if(!TE(o)&&(dp(t),o&&o.response)){t.response=o.response;try{o.response.data=up.call(t,t.transformResponse,o.response)}finally{delete t.response}o.response.headers=Hr.from(o.response.headers)}return Promise.reject(o)})}const Id={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Id[e]=function(i){return typeof i===e||"a"+(t<1?"n ":" ")+e}});const hv={};Id.transitional=function(t,n,i){function o(l,u){return"[Axios v"+o1+"] Transitional option '"+l+"'"+u+(i?". "+i:"")}return(l,u,f)=>{if(t===!1)throw new Je(o(u," has been removed"+(n?" in "+n:"")),Je.ERR_DEPRECATED);return n&&!hv[u]&&(hv[u]=!0,console.warn(o(u," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,u,f):!0}};Id.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};function wA(e,t,n){if(typeof e!="object"||e===null)throw new Je("options must be an object",Je.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let o=i.length;for(;o-- >0;){const l=i[o],u=Object.prototype.hasOwnProperty.call(t,l)?t[l]:void 0;if(u){const f=e[l],h=f===void 0||u(f,l,e);if(h!==!0)throw new Je("option "+l+" must be "+h,Je.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Je("Unknown option "+l,Je.ERR_BAD_OPTION)}}const Kf={assertOptions:wA,validators:Id},Rr=Kf.validators;let Ja=class{constructor(t){this.defaults=t||{},this.interceptors={request:new ev,response:new ev}}async request(t,n){try{return await this._request(t,n)}catch(i){if(i instanceof Error)try{let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const l=o.stack;let u="";if(typeof l=="string"){const f=l.indexOf(` 15`);u=f===-1?"":l.slice(f+1)}if(!i.stack)i.stack=u;else if(u){const f=u.indexOf(` 16`),h=f===-1?-1:u.indexOf(` 17`,f+1),y=h===-1?"":u.slice(h+1);String(i.stack).endsWith(y)||(i.stack+=` 18`+u)}}catch{}throw i}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=no(this.defaults,n);const{transitional:i,paramsSerializer:o,headers:l}=n;i!==void 0&&Kf.assertOptions(i,{silentJSONParsing:Rr.transitional(Rr.boolean),forcedJSONParsing:Rr.transitional(Rr.boolean),clarifyTimeoutError:Rr.transitional(Rr.boolean),legacyInterceptorReqResOrdering:Rr.transitional(Rr.boolean),advertiseZstdAcceptEncoding:Rr.transitional(Rr.boolean),validateStatusUndefinedResolves:Rr.transitional(Rr.boolean)}
18,!1),o!=null&&(de.isFunction(o)?n.paramsSerializer={serialize:o}:Kf.assertOptions(o,{encode:Rr.function,serialize:Rr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Kf.assertOptions(n,{baseUrl:Rr.spelling("baseURL"),withXsrfToken:Rr.spelling("withXSRFToken")},!0),n.method=(de.getSafeProp(n,"method")||de.getSafeProp(this.defaults,"method")||"get").toLowerCase();let u=l&&de.merge(l.common,l[n.method]);l&&de.forEach(IE.concat("common"),L=>{delete l[L]}),n.headers=Hr.concat(u,l);const f=[];let h=!0;this.interceptors.request.forEach(function(k){if(typeof k.runWhen=="function"&&k.runWhen(n)===!1)return;h=h&&k.synchronous;const j=n.transitional||s1;j&&j.legacyInterceptorReqResOrdering?f.unshift(k.fulfilled,k.rejected):f.push(k.fulfilled,k.rejected)});const y=[];this.interceptors.response.forEach(function(k){y.push(k.fulfilled,k.rejected)});let _,A=0,D;if(!h){const L=[hp.bind(this),void 0];for(L.unshift(...f),L.push(...y),D=L.length,_=Promise.resolve(n);A<D;)_=_.then(L[A++],L[A++]);return _}D=f.length;let U=n;for(;A<D;){const L=f[A++],k=f[A++];try{U=L?L(U):U}catch(j){if(!k){_=Promise.reject(j);break}try{const M=k.call(this,j);de.isThenable(M)&&(_=Promise.resolve(M).then(()=>hp.call(this,U)))}catch(M){_=Promise.reject(M)}break}}if(!_)try{_=hp.call(this,U)}catch(L){_=Promise.reject(L)}for(A=0,D=y.length;A<D;)_=_.then(y[A++],y[A++]);return _}getUri(t){t=no(this.defaults,t);const n=ME(t.baseURL,t.url,t.allowAbsoluteUrls,t);return EE(n,t.params,t.paramsSerializer)}};de.forEach(["delete","get","head","options"],function(t){Ja.prototype[t]=function(n,i){return this.request(no(i||{},{method:t,url:n,data:i&&de.hasOwnProp(i,"data")?i.data:void 0}))}});de.forEach(["post","put","patch","query"],function(t){function n(i){return function(l,u,f){return this.request(no(f||{},{method:t,headers:i?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}Ja.prototype[t]=n(),t!=="query"&&(Ja.prototype[t+"Form"]=n(!0))});let bA=class kE{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const i=this;this.promise.then(o=>{if(!i._listeners)return;let l=i._listeners.length;for(;l-- >0;)i._listeners[l](o);i._listeners=null}),this.promise.then=o=>{let l;const u=new Promise(f=>{i.subscribe(f),l=f}).then(o);return u.cancel=function(){i.unsubscribe(l)},u},t(function(l,u,f){i.reason||(i.reason=new nu(l,u,f),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=i=>{t.abort(i)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new kE(function(o){t=o}),cancel:t}}};function vA(e){return function(n){return e.apply(null,n)}}function xA(e){return de.isObject(e)&&e.isAxiosError===!0}const qf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
18alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(qf).forEach(([e,t])=>{qf[t]===void 0&&(qf[t]=e)});function UE(e){const t=new Ja(e),n=aE(Ja.prototype.request,t);return de.extend(n,Ja.prototype,t,{allOwnKeys:!0}),de.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return UE(no(e,o))},n}const Vn=UE(tu);Vn.Axios=Ja;Vn.CanceledError=nu;Vn.CancelToken=bA;Vn.isCancel=TE;Vn.VERSION=o1;Vn.toFormData=_d;Vn.AxiosError=Je;Vn.Cancel=Vn.CanceledError;Vn.all=function(t){return Promise.all(t)};Vn.spread=vA;Vn.isAxiosError=xA;Vn.mergeConfig=no;Vn.AxiosHeaders=Hr;Vn.formToJSON=e=>_E(de.isHTMLForm(e)?new FormData(e):e);Vn.getAdapter=NE.getAdapter;Vn.HttpStatusCode=qf;Vn.default=Vn;const{Axios:j9,AxiosError:L9,CanceledError:z9,isCancel:P9,CancelToken:H9,VERSION:V9,all:F9,Cancel:K9,isAxiosError:c1,spread:q9,toFormData:$9,AxiosHeaders:W9,HttpStatusCode:G9,formToJSON:Y9,getAdapter:Z9,mergeConfig:J9,create:X9}=Vn,jE="http://localhost:8000".replace(/\/+$/,"");class EA{constructor(t,n=jE,i=Vn){var o;this.basePath=n,this.axios=i,t&&(this.configuration=t,this.basePath=(o=t.basePath)!==null&&o!==void 0?o:n)}}class SA extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const AA={},_A="https://example.com",IA=function(e,t,n){if(n==null)throw new SA(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function gg(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(i=>gg(e,i,n)):Object.keys(t).forEach(i=>gg(e,t[i],`${n}${n!==""?".":""}${i}`)):e.has(n)?e.append(n,t):e.set(n,t))}const TA=function(e,...t){const n=new URLSearchParams(e.search);gg(n,t),e.search=n.toString()},RA=function(e,t,n){const i=typeof e!="string";return(i&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):i)?JSON.stringify(e!==void 0?e:{}):e||""},CA=function(e){return e.pathname+e.search+e.hash},MA=function(e,t,n,i){return(o=t,l=n)=>{var u;const f=Object.assign(Object.assign({},e.options),{url:(o.defaults.baseURL?"":(u=i?.basePath)!==null&&u!==void 0?u:l)+e.url});return o.request(f)}};var LE=function(e,t,n,i){function o(l){return l instanceof n?l:new n(function(u){u(l)})}return new(n||(n=Promise))(function(l,u){function f(_){try{y(i.next(_))}catch(A){u(A)}}function h(_){try{y(i.throw(_))}catch(A){u(A)}}function y(_){_.done?l(_.value):o(_.value).then(f,h)}y((i=i.apply(e,t||[])).next())})};const BA=function(e){return{postKmsRpc:(t,...n)=>LE(this,[t,...n],void 0,function*(i,o={}){IA("postKmsRpc","kmsRpcRequest",i);const l="/kms/rpc",u=new URL(l,_A);let f;e&&(f=e.baseOptions);const h=Object.assign(Object.assign({method:"POST"},f),o),y={},_={};y["Content-Type"]="application/json",TA(u,_);let A=f&&f.headers?f.headers:{};return h.headers=Object.assign(Object.assign(Object.assign({},y),A),o.headers),h.data=RA(i,h,e),{url:CA(u),options:h}})}},DA=function(e){const t=BA(e);return{postKmsRpc(n,i){return LE(this,void 0,void 0,function*(){var o,l,u;const f=yield t.postKmsRpc(n,i),h=(o=e?.serverIndex)!==null&&o!==void 0?o:0,y=(u=(l=AA["KMSRPCApi.postKmsRpc"])===null||l===void 0?void 0:l[h])===null||u===void 0?void 0:u.url;return(_,A)=>MA(f,Vn,jE,e)(_,y||A)})}}};
18class zE extends EA{postKmsRpc(t,n){return DA(this.configuration).postKmsRpc(t,n).then(i=>i(this.axios,this.basePath))}}class PE{constructor(t={}){var n;this.apiKey=t.apiKey,this.username=t.username,this.password=t.password,this.accessToken=t.accessToken,this.basePath=t.basePath,this.serverIndex=t.serverIndex,this.baseOptions=Object.assign(Object.assign({},t.baseOptions),{headers:Object.assign({},(n=t.baseOptions)===null||n===void 0?void 0:n.headers)}),this.formDataCtor=t.formDataCtor}isJsonMime(t){const n=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return t!==null&&(n.test(t)||t.toLowerCase()==="application/json-patch+json")}}var mg;(function(e){e.addUserToOrganization="addUserToOrganization"})(mg||(mg={}));var ma;(function(e){e.ed25519="Ed25519",e.secp256r1="Secp256r1",e.secp256k1="Secp256k1",e.secp256k1Keccak256="Secp256k1Keccak256",e.secp256k1Schnorr="Secp256k1Schnorr"})(ma||(ma={}));var yg;(function(e){e.createAuthenticator="createAuthenticator"})(yg||(yg={}));var wg;(function(e){e.createOrganization="createOrganization"})(wg||(wg={}));var bg;(function(e){e.createWallet="createWallet"})(bg||(bg={}));var vg;(function(e){e.deleteAuthenticator="deleteAuthenticator"})(vg||(vg={}));var Ji;(function(e){e.ed25519="Ed25519",e.secp256k1="Secp256k1"})(Ji||(Ji={}));var Ct;(function(e){e.ethereum="Ethereum",e.solana="Solana",e.bitcoinSegwit="BitcoinSegwit",e.sui="Sui"})(Ct||(Ct={}));var nd;(function(e){e.getAccounts="getAccounts"})(nd||(nd={}));var xg;(function(e){e.getOrCreatePhantomOrganization="getOrCreatePhantomOrganization"})(xg||(xg={}));var Eg;(function(e){e.getOrCreateWalletWithTag="getOrCreateWalletWithTag"})(Eg||(Eg={}));var Sg;(function(e){e.grantOrganizationAccess="grantOrganizationAccess"})(Sg||(Sg={}));var Ag;(function(e){e.signTransaction="signTransaction"})(Ag||(Ag={}));var _g;(function(e){e.signUtf8Message="signUtf8Message"})(_g||(_g={}));var Ig;(function(e){e.root="ROOT"})(Ig||(Ig={}));ma.ed25519;var HE="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTA4IiBoZWlnaHQ9IjEwOCIgdmlld0JveD0iMCAwIDEwOCAxMDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDgiIGhlaWdodD0iMTA4IiByeD0iMjYiIGZpbGw9IiNBQjlGRjIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00Ni41MjY3IDY5LjkyMjlDNDIuMDA1NCA3Ni44NTA5IDM0LjQyOTIgODUuNjE4MiAyNC4zNDggODUuNjE4MkMxOS41ODI0IDg1LjYxODIgMTUgODMuNjU2MyAxNSA3NS4xMzQyQzE1IDUzLjQzMDUgNDQuNjMyNiAxOS44MzI3IDcyLjEyNjggMTkuODMyN0M4Ny43NjggMTkuODMyNyA5NCAzMC42ODQ2IDk0IDQzLjAwNzlDOTQgNTguODI1OCA4My43MzU1IDc2LjkxMjIgNzMuNTMyMSA3Ni45MTIyQzcwLjI5MzkgNzYuOTEyMiA2OC43MDUzIDc1LjEzNDIgNjguNzA1MyA3Mi4zMTRDNjguNzA1MyA3MS41NzgzIDY4LjgyNzUgNzAuNzgxMiA2OS4wNzE5IDY5LjkyMjlDNjUuNTg5MyA3NS44Njk5IDU4Ljg2ODUgODEuMzg3OCA1Mi41NzU0IDgxLjM4NzhDNDcuOTkzIDgxLjM4NzggNDUuNjcxMyA3OC41MDYzIDQ1LjY3MTMgNzQuNDU5OEM0NS42NzEzIDcyLjk4ODQgNDUuOTc2OCA3MS40NTU2IDQ2LjUyNjcgNjkuOTIyOVpNODMuNjc2MSA0Mi41Nzk0QzgzLjY3NjEgNDYuMTcwNCA4MS41NTc1IDQ3Ljk2NTggNzkuMTg3NSA0Ny45NjU4Qzc2Ljc4MTYgNDcuOTY1OCA3NC42OTg5IDQ2LjE3MDQgNzQuNjk4OSA0Mi41Nzk0Qzc0LjY5ODkgMzguOTg4NSA3Ni43ODE2IDM3LjE5MzEgNzkuMTg3NSAzNy4xOTMxQzgxLjU1NzUgMzcuMTkzMSA4My42NzYxIDM4Ljk4ODUgODMuNjc2MSA0Mi41Nzk0Wk03MC4yMTAzIDQyLjU3OTVDNzAuMjEwMyA0Ni4xNzA0IDY4LjA5MTYgNDcuOTY1OCA2NS43MjE2IDQ3Ljk2NThDNjMuMzE1NyA0Ny45NjU4IDYxLjIzMyA0Ni4xNzA0IDYxLjIzMyA0Mi41Nzk1QzYxLjIzMyAzOC45ODg1IDYzLjMxNTcgMzcuMTkzMSA2NS43MjE2IDM3LjE5MzFDNjguMDkxNiAzNy4xOTMxIDcwLjIxMDMgMzguOTg4NSA3MC4yMTAzIDQyLjU3OTVaIiBmaWxsPSIjRkZGREY4Ii8+Cjwvc3ZnPgo=",Yn=(e=>(e.SOLANA_MAINNET="solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",e.SOLANA_DEVNET="solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",e.SOLANA_TESTNET="solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",e.ETHEREUM_MAINNET="eip155:1",e.ETHEREUM_SEPOLIA="eip155:11155111",e.POLYGON_MAINNET="eip155:137",e.POLYGON_AMOY="eip155:80002",e.BASE_MAINNET="eip155:8453",e.BASE_SEPOLIA="eip155:84532",e.ARBITRUM_ONE="eip155:42161",e.ARBITRUM_SEPOLIA="eip155:421614",e.MONAD_MAINNET="eip155:143",e.MONAD_TESTNET="eip155:10143",e.BITCOIN_MAINNET="bip122:000000000019d6689c085ae165831e93",e.BITCOIN_TESTNET="bip122:000000000933ea01ad0ee984209779ba",e.SUI_MAINNET="sui:35834a8a",e.SUI_TESTNET="sui:4c78adac",e.SUI_DEVNET="sui:devnet",e))(Yn||{}),ro={"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp":{name:"Solana Mainnet",chain:"solana",network:"mainnet",internalCaip:"solana:101",slip44:"501",explorer:{name:"Solscan",transactionUrl:"https://solscan.io/tx/{hash}",addressUrl:"https://solscan.io/account/{address}"}},"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1":{name:"Solana Devnet",chain:"solana",network:"devnet",internalCaip:"solana:103",slip44:"501",explorer:{name:"Solscan",transactionUrl:"https://solscan.io/tx/{hash}
18?cluster=devnet",addressUrl:"https://solscan.io/account/{address}?cluster=devnet"}},"solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z":{name:"Solana Testnet",chain:"solana",network:"testnet",internalCaip:"solana:102",slip44:"501",explorer:{name:"Solscan",transactionUrl:"https://solscan.io/tx/{hash}?cluster=testnet",addressUrl:"https://solscan.io/account/{address}?cluster=testnet"}},"eip155:1":{name:"Ethereum Mainnet",chain:"ethereum",network:"mainnet",internalCaip:"eip155:1",chainId:1,slip44:"60",explorer:{name:"Etherscan",transactionUrl:"https://etherscan.io/tx/{hash}",addressUrl:"https://etherscan.io/address/{address}"}},"eip155:11155111":{name:"Ethereum Sepolia",chain:"ethereum",network:"sepolia",internalCaip:"eip155:11155111",chainId:11155111,slip44:"60",explorer:{name:"Etherscan",transactionUrl:"https://sepolia.etherscan.io/tx/{hash}",addressUrl:"https://sepolia.etherscan.io/address/{address}"}},"eip155:137":{name:"Polygon Mainnet",chain:"polygon",network:"mainnet",internalCaip:"eip155:137",chainId:137,slip44:"137",explorer:{name:"Polygonscan",transactionUrl:"https://polygonscan.com/tx/{hash}",addressUrl:"https://polygonscan.com/address/{address}"}},"eip155:80002":{name:"Polygon Amoy",chain:"polygon",network:"amoy",internalCaip:"eip155:80002",chainId:80002,slip44:"137",explorer:{name:"Polygonscan",transactionUrl:"https://amoy.polygonscan.com/tx/{hash}",addressUrl:"https://amoy.polygonscan.com/address/{address}"}},"eip155:8453":{name:"Base Mainnet",chain:"base",network:"mainnet",internalCaip:"eip155:8453",chainId:8453,slip44:"8453",explorer:{name:"Basescan",transactionUrl:"https://basescan.org/tx/{hash}",addressUrl:"https://basescan.org/address/{address}"}},"eip155:84532":{name:"Base Sepolia",chain:"base",network:"sepolia",internalCaip:"eip155:84532",chainId:84532,slip44:"8453",explorer:{name:"Basescan",transactionUrl:"https://sepolia.basescan.org/tx/{hash}",addressUrl:"https://sepolia.basescan.org/address/{address}"}},"eip155:42161":{name:"Arbitrum One",chain:"arbitrum",network:"mainnet",internalCaip:"eip155:42161",chainId:42161,slip44:"42161",explorer:{name:"Arbiscan",transactionUrl:"https://arbiscan.io/tx/{hash}",addressUrl:"https://arbiscan.io/address/{address}"}},"eip155:421614":{name:"Arbitrum Sepolia",chain:"arbitrum",network:"sepolia",internalCaip:"eip155:421614",chainId:421614,slip44:"42161",explorer:{name:"Arbiscan",transactionUrl:"https://sepolia.arbiscan.io/tx/{hash}",addressUrl:"https://sepolia.arbiscan.io/address/{address}"}},"eip155:143":{name:"Monad Mainnet",chain:"monad",network:"mainnet",internalCaip:"eip155:143",chainId:143,slip44:"60",explorer:{name:"Monad Explorer",transactionUrl:"https://monadexplorer.com/tx/{hash}",addressUrl:"https://monadexplorer.com/address/{address}"}},"eip155:10143":{name:"Monad Testnet",chain:"monad",network:"testnet",internalCaip:"eip155:10143",chainId:10143,slip44:"60",explorer:{name:"Monad Testnet Explorer",transactionUrl:"https://testnet.monadexplorer.com/tx/{hash}",addressUrl:"https://testnet.monadexplorer.com/address/{address}"}},"bip122:000000000019d6689c085ae165831e93":{name:"Bitcoin Mainnet",chain:"bitcoin",network:"mainnet",internalCaip:"bip122:000000000019d6689c085ae165831e93",slip44:"0",explorer:{name:"Blockstream",transactionUrl:"https://blockstream.info/tx/{hash}",addressUrl:"https://blockstream.info/address/{address}"}},"bip122:000000000933ea01ad0ee984209779ba":{name:"Bitcoin Testnet",chain:"bitcoin",network:"testnet",internalCaip:"bip122:000000000933ea01ad0ee984209779ba",slip44:"0",explorer:{name:"Blockstream",transactionUrl:"https://blockstream.info/testnet/tx/{hash}",addressUrl:"https://blockstream.info/testnet/address/{address}"}},"sui:35834a8a":{name:"Sui Mainnet",chain:"sui",network:"mainnet",internalCaip:"sui:mainnet",slip44:"784",explorer:{name:"Sui Explorer",transactionUrl:"https://explorer.sui.io/txblock/{hash}?network=mainnet",addressUrl:"https://explorer.sui.io/address/{address}?network=mainnet"}},"sui:4c78adac":{name:"Sui Testnet",chain:"sui",network:"testnet",internalCaip:"sui:testnet",slip44:"784",explorer:{name:"Sui Explorer",transactionUrl:"https://explorer.sui.io/txblock/{hash}?network=testnet",addressUrl:"https://explorer.sui.io/address/{address}?network=testnet"}},"sui:devnet":{name:"Sui Devnet",chain:"sui",network:"devnet",internalCaip:"sui:devnet",slip44:"784",explorer:{name:"Sui Explorer",transactionUrl:"https://explorer.sui.io/txblock/{hash}?network=devnet",addressUrl:"https://explorer.sui.io/address/{address}?network=devnet"}}};function OA(e){return ro[e]}function NA(e,t,n){const i=OA(e);return i?.explorer?i.explorer.transactionUrl.replace("{hash}",n):void 0}function _f(e){return Object.keys(ro).find(t=>ro[t].chainId===e)}function pp(e){return ro[e]?.chainId}function kA(e){const t=ro[e];if(!t||!t.internalCaip)throw new Error(`No internal CAIP mapping found for NetworkId: ${e}`);return t.internalCaip}function Td(e){const t=Object.keys(ro).find(n=>ro[n].internalCaip===e);if(!t)throw new Error(`No NetworkId mapping found for internal CAIP: ${e}`);return t}var Va={SDK_TYPE:"x-phantom-sdk-type",SDK_VERSION:"x-phantom-sdk-version",PLATFORM:"x-
18phantom-platform",WALLET_TYPE:"x-phantom-wallet-type",APP_ID:"x-app-id",PLATFORM_VERSION:"x-phantom-platform-version",CLIENT:"x-phantom-client"},UA="https://connect.phantom.app/login/start",jA="https://auth.phantom.app",LA="https://api.phantom.app/v1/wallets",VE="user-wallet",zA={google:"Google",apple:"Apple",phantom:"Phantom",device:"Device",injected:"Wallet",deeplink:"Deeplink"};function PA(e){return zA[e]||"Wallet"}function FE(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Rc=class{constructor(){this.cache=null,this.CACHE_DURATION=3e4,this.TIME_API_URL="https://time.phantom.app/utc"}static getInstance(){return Rc.instance||(Rc.instance=new Rc),Rc.instance}async now(){const e=Date.now();if(this.cache&&e-this.cache.fetchedAt<this.CACHE_DURATION){const t=e-this.cache.fetchedAt;return this.cache.timestamp+t}try{const t=await fetch(this.TIME_API_URL);if(!t.ok)throw new Error(`Time API responded with status: ${t.status}`);const n=await t.text(),i=parseInt(n,10);if(isNaN(i))throw new Error(`Invalid timestamp received: ${n}`);return this.cache={timestamp:i,fetchedAt:e},i}catch{return Date.now()}}nowSync(){if(this.cache){const e=Date.now()-this.cache.fetchedAt;if(e<this.CACHE_DURATION)return this.cache.timestamp+e}return Date.now()}clearCache(){this.cache=null}},HA=Rc.getInstance(),ei=()=>HA.now();function KE(e){return e.split(":")[0].toLowerCase()}function Tg(e){return KE(e)==="eip155"}function VA(e){return KE(e)==="solana"}function FA(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var gp={exports:{}};const KA={},qA=Object.freeze(Object.defineProperty({__proto__:null,default:KA},Symbol.toStringTag,{value:"Module"})),qE=Qg(qA);var pv;function $A(){return pv||(pv=1,(function(e){(function(t){var n=function(C){var V,F=new Float64Array(16);if(C)for(V=0;V<C.length;V++)F[V]=C[V];return F},i=function(){throw new Error("no PRNG")},o=new Uint8Array(16),l=new Uint8Array(32);l[0]=9;var u=n(),f=n([1]),h=n([56129,1]),y=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),_=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),A=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),D=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),U=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function L(C,V,F,x){C[V]=F>>24&255,C[V+1]=F>>16&255,C[V+2]=F>>8&255,C[V+3]=F&255,C[V+4]=x>>24&255,C[V+5]=x>>16&255,C[V+6]=x>>8&255,C[V+7]=x&255}function k(C,V,F,x,$){var me,he=0;for(me=0;me<$;me++)he|=C[V+me]^F[x+me];return(1&he-1>>>8)-1}function j(C,V,F,x){return k(C,V,F,x,16)}function M(C,V,F,x){return k(C,V,F,x,32)}function W(C,V,F,x){for(var $=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,me=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,he=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Ie=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,Ve=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,$e=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,Ke=V[0]&255|(V[1]&255)<<8|(V[2]&255)<<16|(V[3]&255)<<24,Gt=V[4]&255|(V[5]&255)<<8|(V[6]&255)<<16|(V[7]&255)<<24,et=V[8]&255|(V[9]&255)<<8|(V[10]&255)<<16|(V[11]&255)<<24,gt=V[12]&255|(V[13]&255)<<8|(V[14]&255)<<16|(V[15]&255)<<24,xt=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,_t=F[16]&255|(F[17]&255)<<8|(F[18]&255)<<16|(F[19]&255)<<24,Et=F[20]&255|(F[21]&255)<<8|(F[22]&255)<<16|(F[23]&255)<<24,yt=F[24]&255|(F[25]&255)<<8|(F[26]&255)<<16|(F[27]&255)<<24,wt=F[28]&255|(F[29]&255)<<8|(F[30]&255)<<16|(F[31]&255)<<24,st=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,nt=$,ut=me,Ge=he,Qe=Ie,at=Ve,Ye=$e,Ce=Ke,Be=Gt,Le=et,Ne=gt,ke=xt,ze=_t,bt=Et,Nt=yt,Dt=wt,Ot=st,ie,Ht=0;Ht<20;Ht+=2)ie=nt+bt|0,at^=ie<<7|ie>>>25,ie=at+nt|0,Le^=ie<<9|ie>>>23,ie=Le+at|0,bt^=ie<<13|ie>>>19,ie=bt+Le|0,nt^=ie<<18|ie>>>14,ie=Ye+ut|0,Ne^=ie<<7|ie>>>25,ie=Ne+Ye|0,Nt^=ie<<9|ie>>>23,ie=Nt+Ne|0,ut^=ie<<13|ie>>>19,ie=ut+Nt|0,Ye^=ie<<18|ie>>>14,ie=ke+Ce|0,Dt^=ie<<7|ie>>>25,ie=Dt+ke|0,Ge^=ie<<9|ie>>>23,ie=Ge+Dt|0,Ce^=ie<<13|ie>>>19,ie=Ce+Ge|0,ke^=ie<<18|ie>>>14,ie=Ot+ze|0,Qe^=ie<<7|ie>>>25,ie=Qe+Ot|0,Be^=ie<<9|ie>>>23,ie=Be+Qe|0,ze^=ie<<13|ie>>>19,ie=ze+Be|0,Ot^=ie<<18|ie>>>14,ie=nt+Qe|0,ut^=ie<<7|ie>>>25,ie=ut+nt|0,Ge^=ie<<9|ie>>>23,ie=Ge+ut|0,Qe^=ie<<13|ie>>>19,ie=Qe+Ge|0,nt^=ie<<18|ie>>>14,ie=Ye+at|0,Ce^=ie<<7|ie>>>25,ie=Ce+Ye|0,Be^=ie<<9|ie>>>23,ie=Be+Ce|0,at^=ie<<13|ie>>>19,ie=at+Be|0,Ye^=ie<<18|ie>>>
vendor: 28,277 bytes, line 18
1814,ie=ke+Ne|0,ze^=ie<<7|ie>>>25,ie=ze+ke|0,Le^=ie<<9|ie>>>23,ie=Le+ze|0,Ne^=ie<<13|ie>>>19,ie=Ne+Le|0,ke^=ie<<18|ie>>>14,ie=Ot+Dt|0,bt^=ie<<7|ie>>>25,ie=bt+Ot|0,Nt^=ie<<9|ie>>>23,ie=Nt+bt|0,Dt^=ie<<13|ie>>>19,ie=Dt+Nt|0,Ot^=ie<<18|ie>>>14;nt=nt+$|0,ut=ut+me|0,Ge=Ge+he|0,Qe=Qe+Ie|0,at=at+Ve|0,Ye=Ye+$e|0,Ce=Ce+Ke|0,Be=Be+Gt|0,Le=Le+et|0,Ne=Ne+gt|0,ke=ke+xt|0,ze=ze+_t|0,bt=bt+Et|0,Nt=Nt+yt|0,Dt=Dt+wt|0,Ot=Ot+st|0,C[0]=nt>>>0&255,C[1]=nt>>>8&255,C[2]=nt>>>16&255,C[3]=nt>>>24&255,C[4]=ut>>>0&255,C[5]=ut>>>8&255,C[6]=ut>>>16&255,C[7]=ut>>>24&255,C[8]=Ge>>>0&255,C[9]=Ge>>>8&255,C[10]=Ge>>>16&255,C[11]=Ge>>>24&255,C[12]=Qe>>>0&255,C[13]=Qe>>>8&255,C[14]=Qe>>>16&255,C[15]=Qe>>>24&255,C[16]=at>>>0&255,C[17]=at>>>8&255,C[18]=at>>>16&255,C[19]=at>>>24&255,C[20]=Ye>>>0&255,C[21]=Ye>>>8&255,C[22]=Ye>>>16&255,C[23]=Ye>>>24&255,C[24]=Ce>>>0&255,C[25]=Ce>>>8&255,C[26]=Ce>>>16&255,C[27]=Ce>>>24&255,C[28]=Be>>>0&255,C[29]=Be>>>8&255,C[30]=Be>>>16&255,C[31]=Be>>>24&255,C[32]=Le>>>0&255,C[33]=Le>>>8&255,C[34]=Le>>>16&255,C[35]=Le>>>24&255,C[36]=Ne>>>0&255,C[37]=Ne>>>8&255,C[38]=Ne>>>16&255,C[39]=Ne>>>24&255,C[40]=ke>>>0&255,C[41]=ke>>>8&255,C[42]=ke>>>16&255,C[43]=ke>>>24&255,C[44]=ze>>>0&255,C[45]=ze>>>8&255,C[46]=ze>>>16&255,C[47]=ze>>>24&255,C[48]=bt>>>0&255,C[49]=bt>>>8&255,C[50]=bt>>>16&255,C[51]=bt>>>24&255,C[52]=Nt>>>0&255,C[53]=Nt>>>8&255,C[54]=Nt>>>16&255,C[55]=Nt>>>24&255,C[56]=Dt>>>0&255,C[57]=Dt>>>8&255,C[58]=Dt>>>16&255,C[59]=Dt>>>24&255,C[60]=Ot>>>0&255,C[61]=Ot>>>8&255,C[62]=Ot>>>16&255,C[63]=Ot>>>24&255}function K(C,V,F,x){for(var $=x[0]&255|(x[1]&255)<<8|(x[2]&255)<<16|(x[3]&255)<<24,me=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,he=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Ie=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,Ve=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,$e=x[4]&255|(x[5]&255)<<8|(x[6]&255)<<16|(x[7]&255)<<24,Ke=V[0]&255|(V[1]&255)<<8|(V[2]&255)<<16|(V[3]&255)<<24,Gt=V[4]&255|(V[5]&255)<<8|(V[6]&255)<<16|(V[7]&255)<<24,et=V[8]&255|(V[9]&255)<<8|(V[10]&255)<<16|(V[11]&255)<<24,gt=V[12]&255|(V[13]&255)<<8|(V[14]&255)<<16|(V[15]&255)<<24,xt=x[8]&255|(x[9]&255)<<8|(x[10]&255)<<16|(x[11]&255)<<24,_t=F[16]&255|(F[17]&255)<<8|(F[18]&255)<<16|(F[19]&255)<<24,Et=F[20]&255|(F[21]&255)<<8|(F[22]&255)<<16|(F[23]&255)<<24,yt=F[24]&255|(F[25]&255)<<8|(F[26]&255)<<16|(F[27]&255)<<24,wt=F[28]&255|(F[29]&255)<<8|(F[30]&255)<<16|(F[31]&255)<<24,st=x[12]&255|(x[13]&255)<<8|(x[14]&255)<<16|(x[15]&255)<<24,nt=$,ut=me,Ge=he,Qe=Ie,at=Ve,Ye=$e,Ce=Ke,Be=Gt,Le=et,Ne=gt,ke=xt,ze=_t,bt=Et,Nt=yt,Dt=wt,Ot=st,ie,Ht=0;Ht<20;Ht+=2)ie=nt+bt|0,at^=ie<<7|ie>>>25,ie=at+nt|0,Le^=ie<<9|ie>>>23,ie=Le+at|0,bt^=ie<<13|ie>>>19,ie=bt+Le|0,nt^=ie<<18|ie>>>14,ie=Ye+ut|0,Ne^=ie<<7|ie>>>25,ie=Ne+Ye|0,Nt^=ie<<9|ie>>>23,ie=Nt+Ne|0,ut^=ie<<13|ie>>>19,ie=ut+Nt|0,Ye^=ie<<18|ie>>>14,ie=ke+Ce|0,Dt^=ie<<7|ie>>>25,ie=Dt+ke|0,Ge^=ie<<9|ie>>>23,ie=Ge+Dt|0,Ce^=ie<<13|ie>>>19,ie=Ce+Ge|0,ke^=ie<<18|ie>>>14,ie=Ot+ze|0,Qe^=ie<<7|ie>>>25,ie=Qe+Ot|0,Be^=ie<<9|ie>>>23,ie=Be+Qe|0,ze^=ie<<13|ie>>>19,ie=ze+Be|0,Ot^=ie<<18|ie>>>14,ie=nt+Qe|0,ut^=ie<<7|ie>>>25,ie=ut+nt|0,Ge^=ie<<9|ie>>>23,ie=Ge+ut|0,Qe^=ie<<13|ie>>>19,ie=Qe+Ge|0,nt^=ie<<18|ie>>>14,ie=Ye+at|0,Ce^=ie<<7|ie>>>25,ie=Ce+Ye|0,Be^=ie<<9|ie>>>23,ie=Be+Ce|0,at^=ie<<13|ie>>>19,ie=at+Be|0,Ye^=ie<<18|ie>>>14,ie=ke+Ne|0,ze^=ie<<7|ie>>>25,ie=ze+ke|0,Le^=ie<<9|ie>>>23,ie=Le+ze|0,Ne^=ie<<13|ie>>>19,ie=Ne+Le|0,ke^=ie<<18|ie>>>14,ie=Ot+Dt|0,bt^=ie<<7|ie>>>25,ie=bt+Ot|0,Nt^=ie<<9|ie>>>23,ie=Nt+bt|0,Dt^=ie<<13|ie>>>19,ie=Dt+Nt|0,Ot^=ie<<18|ie>>>14;C[0]=nt>>>0&255,C[1]=nt>>>8&255,C[2]=nt>>>16&255,C[3]=nt>>>24&255,C[4]=Ye>>>0&255,C[5]=Ye>>>8&255,C[6]=Ye>>>16&255,C[7]=Ye>>>24&255,C[8]=ke>>>0&255,C[9]=ke>>>8&255,C[10]=ke>>>16&255,C[11]=ke>>>24&255,C[12]=Ot>>>0&255,C[13]=Ot>>>8&255,C[14]=Ot>>>16&255,C[15]=Ot>>>24&255,C[16]=Ce>>>0&255,C[17]=Ce>>>8&255,C[18]=Ce>>>16&255,C[19]=Ce>>>24&255,C[20]=Be>>>0&255,C[21]=Be>>>8&255,C[22]=Be>>>16&255,C[23]=Be>>>24&255,C[24]=Le>>>0&255,C[25]=Le>>>8&255,C[26]=Le>>>16&255,C[27]=Le>>>24&255,C[28]=Ne>>>0&255,C[29]=Ne>>>8&255,C[30]=Ne>>>16&255,C[31]=Ne>>>24&255}function se(C,V,F,x){W(C,V,F,x)}function re(C,V,F,x){K(C,V,F,x)}var te=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function pe(C,V,F,x,$,me,he){var Ie=new Uint8Array(16),Ve=new Uint8Array(64),$e,Ke;for(Ke=0;Ke<16;Ke++)Ie[Ke]=0;for(Ke=0;Ke<8;Ke++)Ie[Ke]=me[Ke];for(;$>=64;){for(se(Ve,Ie,he,te),Ke=0;Ke<64;Ke++)C[V+Ke]=F[x+Ke]^Ve[Ke];for($e=1,Ke=8;Ke<16;Ke++)$e=$e+(Ie[Ke]&255)|0,Ie[Ke]=$e&255,$e>>>=8;$-=64,V+=64,x+=64}if($>0)for(se(Ve,Ie,he,te),Ke=0;Ke<$;Ke++)C[V+Ke]=F[x+Ke]^Ve[Ke];return 0}function we(C,V,F,x,$){var me=new Uint8Array(16),he=new Uint8Array(64),Ie,Ve;for(Ve=0;Ve<16;Ve++)me[Ve]=0;for(Ve=0;Ve<8;Ve++)me[Ve]=x[Ve];for(;F>=64;){for(se(he,me,$,te),Ve=0;Ve<64;Ve++)C[V+Ve]=he[Ve];for(Ie=1,Ve=8;Ve<16;Ve++)Ie=Ie+(me[Ve]&255)|0,me[Ve]=Ie&255,Ie>>>=8;F-=64,V+=64}if(F>0)for(se(he,me,$,te),Ve=0;Ve<F;Ve++)C[V+Ve]=he[Ve];return 0}function X(C,V,F,x,$){var me=new Uint8Array(32);re(me,x,$,te);for(var he=new Uint8Array(8),Ie=0;Ie<8;Ie++)he[Ie]=x[Ie+16];return we(C,V,F,he,me)}function Z(C,V,F,x,$,me,he){var Ie=new Uint8Array(32);re(Ie,me,he,te);for(var Ve=new Uint8Array(8),$e=0;$e<8;$e++)Ve[$e]=me[$e+16];return pe(C,V,F,x,$,Ve,Ie)}var ae=function(C){this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0;var V,F,x,$,me,he,Ie,Ve;V=C[0]&255|(C[1]&255)<<8,this.r[0]=V&8191,F=C[2]&255|(C[3]&255)<<8,this.r[1]=(V>>>13|F<<3)&8191,x=C[4]&255|(C[5]&255)<<8,this.r[2]=(F>>>10|x<<6)&7939,$=C[6]&255|(C[7]&255)<<8,this.r[3]=(x>>>7|$<<9)&8191,me=C[8]&255|(C[9]&255)<<8,this.r[4]=($>>>4|me<<12)&255,this.r[5]=me>>>1&8190,he=C[10]&255|(C[11]&255)<<8,this.r[6]=(me>>>14|he<<2)&8191,Ie=C[12]&255|(C[13]&255)<<8,this.r[7]=(he>>>11|Ie<<5)&8065,Ve=C[14]&255|(C[15]&255)<<8,this.r[8]=(Ie>>>8|Ve<<8)&8191,this.r[9]=Ve>>>5&127,this.pad[0]=C[16]&255|(C[17]&255)<<8,this.pad[1]=C[18]&255|(C[19]&255)<<8,this.pad[2]=C[20]&255|(C[21]&255)<<8,this.pad[3]=C[22]&255|(C[23]&255)<<8,this.pad[4]=C[24]&255|(C[25]&255)<<8,this.pad[5]=C[26]&255|(C[27]&255)<<8,this.pad[6]=C[28]&255|(C[29]&255)<<8,this.pad[7]=C[30]&255|(C[31]&255)<<8};ae.prototype.blocks=function(C,V,F){for(var x=this.fin?0:2048,$,me,he,Ie,Ve,$e,Ke,Gt,et,gt,xt,_t,Et,yt,wt,st,nt,ut,Ge,Qe=this.h[0],at=this.h[1],Ye=this.h[2],Ce=this.h[3],Be=this.h[4],Le=this.h[5],Ne=this.h[6],ke=this.h[7],ze=this.h[8],bt=this.h[9],Nt=this.r[0],Dt=this.r[1],Ot=this.r[2],ie=this.r[3],Ht=this.r[4],Mt=this.r[5],Qt=this.r[6],zt=this.r[7],Jt=this.r[8],Vt=this.r[9];F>=16;)$=C[V+0]&255|(C[V+1]&255)<<8,Qe+=$&8191,me=C[V+2]&255|(C[V+3]&255)<<8,at+=($>>>13|me<<3)&8191,he=C[V+4]&255|(C[V+5]&255)<<8,Ye+=(me>>>10|he<<6)&8191,Ie=C[V+6]&255|(C[V+7]&255)<<8,Ce+=(he>>>7|Ie<<9)&8191,Ve=C[V+8]&255|(C[V+9]&255)<<8,Be+=(Ie>>>4|Ve<<12)&8191,Le+=Ve>>>1&8191,$e=C[V+10]&255|(C[V+11]&255)<<8,Ne+=(Ve>>>14|$e<<2)&8191,Ke=C[V+12]&255|(C[V+13]&255)<<8,ke+=($e>>>11|Ke<<5)&8191,Gt=C[V+14]&255|(C[V+15]&255)<<8,ze+=(Ke>>>8|Gt<<8)&8191,bt+=Gt>>>5|x,et=0,gt=et,gt+=Qe*Nt,gt+=at*(5*Vt),gt+=Ye*(5*Jt),gt+=Ce*(5*zt),gt+=Be*(5*Qt),et=gt>>>13,gt&=8191,gt+=Le*(5*Mt),gt+=Ne*(5*Ht),gt+=ke*(5*ie),gt+=ze*(5*Ot),gt+=bt*(5*Dt),et+=gt>>>13,gt&=8191,xt=et,xt+=Qe*Dt,xt+=at*Nt,xt+=Ye*(5*Vt),xt+=Ce*(5*Jt),xt+=Be*(5*zt),et=xt>>>13,xt&=8191,xt+=Le*(5*Qt),xt+=Ne*(5*Mt),xt+=ke*(5*Ht),xt+=ze*(5*ie),xt+=bt*(5*Ot),et+=xt>>>13,xt&=8191,_t=et,_t+=Qe*Ot,_t+=at*Dt,_t+=Ye*Nt,_t+=Ce*(5*Vt),_t+=Be*(5*Jt),et=_t>>>13,_t&=8191,_t+=Le*(5*zt),_t+=Ne*(5*Qt),_t+=ke*(5*Mt),_t+=ze*(5*Ht),_t+=bt*(5*ie),et+=_t>>>13,_t&=8191,Et=et,Et+=Qe*ie,Et+=at*Ot,Et+=Ye*Dt,Et+=Ce*Nt,Et+=Be*(5*Vt),et=Et>>>13,Et&=8191,Et+=Le*(5*Jt),Et+=Ne*(5*zt),Et+=ke*(5*Qt),Et+=ze*(5*Mt),Et+=bt*(5*Ht),et+=Et>>>13,Et&=8191,yt=et,yt+=Qe*Ht,yt+=at*ie,yt+=Ye*Ot,yt+=Ce*Dt,yt+=Be*Nt,et=yt>>>13,yt&=8191,yt+=Le*(5*Vt),yt+=Ne*(5*Jt),yt+=ke*(5*zt),yt+=ze*(5*Qt),yt+=bt*(5*Mt),et+=yt>>>13,yt&=8191,wt=et,wt+=Qe*Mt,wt+=at*Ht,wt+=Ye*ie,wt+=Ce*Ot,wt+=Be*Dt,et=wt>>>13,wt&=8191,wt+=Le*Nt,wt+=Ne*(5*Vt),wt+=ke*(5*Jt),wt+=ze*(5*zt),wt+=bt*(5*Qt),et+=wt>>>13,wt&=8191,st=et,st+=Qe*Qt,st+=at*Mt,st+=Ye*Ht,st+=Ce*ie,st+=Be*Ot,et=st>>>13,st&=8191,st+=Le*Dt,st+=Ne*Nt,st+=ke*(5*Vt),st+=ze*(5*Jt),st+=bt*(5*zt),et+=st>>>13,st&=8191,nt=et,nt+=Qe*zt,nt+=at*Qt,nt+=Ye*Mt,nt+=Ce*Ht,nt+=Be*ie,et=nt>>>13,nt&=8191,nt+=Le*Ot,nt+=Ne*Dt,nt+=ke*Nt,nt+=ze*(5*Vt),nt+=bt*(5*Jt),et+=nt>>>13,nt&=8191,ut=et,ut+=Qe*Jt,ut+=at*zt,ut+=Ye*Qt,ut+=Ce*Mt,ut+=Be*Ht,et=ut>>>13,ut&=8191,ut+=Le*ie,ut+=Ne*Ot,ut+=ke*Dt,ut+=ze*Nt,ut+=bt*(5*Vt),et+=ut>>>13,ut&=8191,Ge=et,Ge+=Qe*Vt,Ge+=at*Jt,Ge+=Ye*zt,Ge+=Ce*Qt,Ge+=Be*Mt,et=Ge>>>13,Ge&=8191,Ge+=Le*Ht,Ge+=Ne*ie,Ge+=ke*Ot,Ge+=ze*Dt,Ge+=bt*Nt,et+=Ge>>>13,Ge&=8191,et=(et<<2)+et|0,et=et+gt|0,gt=et&8191,et=et>>>13,xt+=et,Qe=gt,at=xt,Ye=_t,Ce=Et,Be=yt,Le=wt,Ne=st,ke=nt,ze=ut,bt=Ge,V+=16,F-=16;this.h[0]=Qe,this.h[1]=at,this.h[2]=Ye,this.h[3]=Ce,this.h[4]=Be,this.h[5]=Le,this.h[6]=Ne,this.h[7]=ke,this.h[8]=ze,this.h[9]=bt},ae.prototype.finish=function(C,V){var F=new Uint16Array(10),x,$,me,he;if(this.leftover){for(he=this.leftover,this.buffer[he++]=1;he<16;he++)this.buffer[he]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(x=this.h[1]>>>13,this.h[1]&=8191,he=2;he<10;he++)this.h[he]+=x,x=this.h[he]>>>13,this.h[he]&=8191;for(this.h[0]+=x*5,x=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=x,x=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=x,F[0]=this.h[0]+5,x=F[0]>>>13,F[0]&=8191,he=1;he<10;he++)F[he]=this.h[he]+x,x=F[he]>>>13,F[he]&=8191;for(F[9]-=8192,$=(x^1)-1,he=0;he<10;he++)F[he]&=$;for($=~$,he=0;he<10;he++)this.h[he]=this.h[he]&$|F[he];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,me=this.h[0]+this.pad[0],this.h[0]=me&65535,he=1;he<8;he++)me=(this.h[he]+this.pad[he]|0)+(me>>>16)|0,this.h[he]=me&65535;C[V+0]=this.h[0]>>>0&255,C[V+1]=this.h[0]>>>8&255,C[V+2]=this.h[1]>>>0&255,C[V+3]=this.h[1]>>>8&255,C[V+4]=this.h[2]>>>0&255,C[V+5]=this.h[2]>>>8&255,C[V+6]=this.h[3]>>>0&255,C[V+7]=this.h[3]>>>8&255,C[V+8]=this.h[4]>>>0&255,C[V+9]=this.h[4]>>>8&255,C[V+10]=this.h[5]>>>0&255,C[V+11]=this.h[5]>>>8&255,C[V+12]=this.h[6]>>>0&255,C[V+13]=this.h[6]>>>8&255,C[V+14]=this.h[7]>>>0&255,C[V+15]=this.h[7]>>>8&255},ae.prototype.update=function(C,V,F){var x,$;if(this.leftover){for($=16-this.leftover,$>F&&($=F),x=0;x<$;x++)this.buffer[this.leftover+x]=C[V+x];if(F-=$,V+=$,this.leftover+=$,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(F>=16&&($=F-F%16,this.blocks(C,V,$),V+=$,F-=$),F){for(x=0;x<F;x++)this.buffer[this.leftover+x]=C[V+x];this.leftover+=F}};function ce(C,V,F,x,$,me){var he=new ae(me);return he.update(F,x,$),he.finish(C,V),0}function N(C,V,F,x,$,me){var he=new Uint8Array(16);return ce(he,0,F,x,$,me),j(C,V,he,0)}function g(C,V,F,x,$){var me;if(F<32)return-1;for(Z(C,0,V,0,F,x,$),ce(C,16,C,32,F-32,C),me=0;me<16;me++)C[me]=0;return 0}function v(C,V,F,x,$){var me,he=new Uint8Array(32);if(F<32||(X(he,0,32,x,$),N(V,16,V,32,F-32,he)!==0))return-1;for(Z(C,0,V,0,F,x,$),me=0;me<32;me++)C[me]=0;return 0}function E(C,V){var F;for(F=0;F<16;F++)C[F]=V[F]|0}function B(C){var V,F,x=1;for(V=0;V<16;V++)F=C[V]+x+65535,x=Math.floor(F/65536),C[V]=F-x*65536;C[0]+=x-1+37*(x-1)}function z(C,V,F){for(var x,$=~(F-1),me=0;me<16;me++)x=$&(C[me]^V[me]),C[me]^=x,V[me]^=x}function G(C,V){var F,x,$,me=n(),he=n();for(F=0;F<16;F++)he[F]=V[F];for(B(he),B(he),B(he),x=0;x<2;x++){for(me[0]=he[0]-65517,F=1;F<15;F++)me[F]=he[F]-65535-(me[F-1]>>16&1),me[F-1]&=65535;me[15]=he[15]-32767-(me[14]>>16&1),$=me[15]>>16&1,me[14]&=65535,z(he,me,1-$)}for(F=0;F<16;F++)C[2*F]=he[F]&255,C[2*F+1]=he[F]>>8}function J(C,V){var F=new Uint8Array(32),x=new Uint8Array(32);return G(F,C),G(x,V),M(F,0,x,0)}function T(C){var V=new Uint8Array(32);return G(V,C),V[0]&1}function m(C,V){var F;for(F=0;F<16;F++)C[F]=V[2*F]+(V[2*F+1]<<8);C[15]&=32767}function b(C,V,F){for(var x=0;x<16;x++)C[x]=V[x]+F[x]}function O(C,V,F){for(var x=0;x<16;x++)C[x]=V[x]-F[x]}function P(C,V,F){var x,$,me=0,he=0,Ie=0,Ve=0,$e=0,Ke=0,Gt=0,et=0,gt=0,xt=0,_t=0,Et=0,yt=0,wt=0,st=0,nt=0,ut=0,Ge=0,Qe=0,at=0,Ye=0,Ce=0,Be=0,Le=0,Ne=0,ke=0,ze=0,bt=0,Nt=0,Dt=0,Ot=0,ie=F[0],Ht=F[1],Mt=F[2],Qt=F[3],zt=F[4],Jt=F[5],Vt=F[6],zn=F[7],fn=F[8],mn=F[9],Pn=F[10],On=F[11],$n=F[12],rr=F[13],fr=F[14],dr=F[15];x=V[0],me+=x*ie,he+=x*Ht,Ie+=x*Mt,Ve+=x*Qt,$e+=x*zt,Ke+=x*Jt,Gt+=x*Vt,et+=x*zn,gt+=x*fn,xt+=x*mn,_t+=x*Pn,Et+=x*On,yt+=x*$n,wt+=x*rr,st+=x*fr,nt+=x*dr,x=V[1],he+=x*ie,Ie+=x*Ht,Ve+=x*Mt,$e+=x*Qt,Ke+=x*zt,Gt+=x*Jt,et+=x*Vt,gt+=x*zn,xt+=x*fn,_t+=x*mn,Et+=x*Pn,yt+=x*On,wt+=x*$n,st+=x*rr,nt+=x*fr,ut+=x*dr,x=V[2],Ie+=x*ie,Ve+=x*Ht,$e+=x*Mt,Ke+=x*Qt,Gt+=x*zt,et+=x*Jt,gt+=x*Vt,xt+=x*zn,_t+=x*fn,Et+=x*mn,yt+=x*Pn,wt+=x*On,st+=x*$n,nt+=x*rr,ut+=x*fr,Ge+=x*dr,x=V[3],Ve+=x*ie,$e+=x*Ht,Ke+=x*Mt,Gt+=x*Qt,et+=x*zt,gt+=x*Jt,xt+=x*Vt,_t+=x*zn,Et+=x*fn,yt+=x*mn,wt+=x*Pn,st+=x*On,nt+=x*$n,ut+=x*rr,Ge+=x*fr,Qe+=x*dr,x=V[4],$e+=x*ie,Ke+=x*Ht,Gt+=x*Mt,et+=x*Qt,gt+=x*zt,xt+=x*Jt,_t+=x*Vt,Et+=x*zn,yt+=x*fn,wt+=x*mn,st+=x*Pn,nt+=x*On,ut+=x*$n,Ge+=x*rr,Qe+=x*fr,at+=x*dr,x=V[5],Ke+=x*ie,Gt+=x*Ht,et+=x*Mt,gt+=x*Qt,xt+=x*zt,_t+=x*Jt,Et+=x*Vt,yt+=x*zn,wt+=x*fn,st+=x*mn,nt+=x*Pn,ut+=x*On,Ge+=x*$n,Qe+=x*rr,at+=x*fr,Ye+=x*dr,x=V[6],Gt+=x*ie,et+=x*Ht,gt+=x*Mt,xt+=x*Qt,_t+=x*zt,Et+=x*Jt,yt+=x*Vt,wt+=x*zn,st+=x*fn,nt+=x*mn,ut+=x*Pn,Ge+=x*On,Qe+=x*$n,at+=x*rr,Ye+=x*fr,Ce+=x*dr,x=V[7],et+=x*ie,gt+=x*Ht,xt+=x*Mt,_t+=x*Qt,Et+=x*zt,yt+=x*Jt,wt+=x*Vt,st+=x*zn,nt+=x*fn,ut+=x*mn,Ge+=x*Pn,Qe+=x*On,at+=x*$n,Ye+=x*rr,Ce+=x*fr,Be+=x*dr,x=V[8],gt+=x*ie,xt+=x*Ht,_t+=x*Mt,Et+=x*Qt,yt+=x*zt,wt+=x*Jt,st+=x*Vt,nt+=x*zn,ut+=x*fn,Ge+=x*mn,Qe+=x*Pn,at+=x*On,Ye+=x*$n,Ce+=x*rr,Be+=x*fr,Le+=x*dr,x=V[9],xt+=x*ie,_t+=x*Ht,Et+=x*Mt,yt+=x*Qt,wt+=x*zt,st+=x*Jt,nt+=x*Vt,ut+=x*zn,Ge+=x*fn,Qe+=x*mn,at+=x*Pn,Ye+=x*On,Ce+=x*$n,Be+=x*rr,Le+=x*fr,Ne+=x*dr,x=V[10],_t+=x*ie,Et+=x*Ht,yt+=x*Mt,wt+=x*Qt,st+=x*zt,nt+=x*Jt,ut+=x*Vt,Ge+=x*zn,Qe+=x*fn,at+=x*mn,Ye+=x*Pn,Ce+=x*On,Be+=x*$n,Le+=x*rr,Ne+=x*fr,ke+=x*dr,x=V[11],Et+=x*ie,yt+=x*Ht,wt+=x*Mt,st+=x*Qt,nt+=x*zt,ut+=x*Jt,Ge+=x*Vt,Qe+=x*zn,at+=x*fn,Ye+=x*mn,Ce+=x*Pn,Be+=x*On,Le+=x*$n,Ne+=x*rr,ke+=x*fr,ze+=x*dr,x=V[12],yt+=x*ie,wt+=x*Ht,st+=x*Mt,nt+=x*Qt,ut+=x*zt,Ge+=x*Jt,Qe+=x*Vt,at+=x*zn,Ye+=x*fn,Ce+=x*mn,Be+=x*Pn,Le+=x*On,Ne+=x*$n,ke+=x*rr,ze+=x*fr,bt+=x*dr,x=V[13],wt+=x*ie,st+=x*Ht,nt+=x*Mt,ut+=x*Qt,Ge+=x*zt,Qe+=x*Jt,at+=x*Vt,Ye+=x*zn,Ce+=x*fn,Be+=x*mn,Le+=x*Pn,Ne+=x*On,ke+=x*$n,ze+=x*rr,bt+=x*fr,Nt+=x*dr,x=V[14],st+=x*ie,nt+=x*Ht,ut+=x*Mt,Ge+=x*Qt,Qe+=x*zt,at+=x*Jt,Ye+=x*Vt,Ce+=x*zn,Be+=x*fn,Le+=x*mn,Ne+=x*Pn,ke+=x*On,ze+=x*$n,bt+=x*rr,Nt+=x*fr,Dt+=x*dr,x=V[15],nt+=x*ie,ut+=x*Ht,Ge+=x*Mt,Qe+=x*Qt,at+=x*zt,Ye+=x*Jt,Ce+=x*Vt,Be+=x*zn,Le+=x*fn,Ne+=x*mn,ke+=x*Pn,ze+=x*On,bt+=x*$n,Nt+=x*rr,Dt+=x*fr,Ot+=x*dr,me+=38*ut,he+=38*Ge,Ie+=38*Qe,Ve+=38*at,$e+=38*Ye,Ke+=38*Ce,Gt+=38*Be,et+=38*Le,gt+=38*Ne,xt+=38*ke,_t+=38*ze,Et+=38*bt,yt+=38*Nt,wt+=38*Dt,st+=38*Ot,$=1,x=me+$+65535,$=Math.floor(x/65536),me=x-$*65536,x=he+$+65535,$=Math.floor(x/65536),he=x-$*65536,x=Ie+$+65535,$=Math.floor(x/65536),Ie=x-$*65536,x=Ve+$+65535,$=Math.floor(x/65536),Ve=x-$*65536,x=$e+$+65535,$=Math.floor(x/65536),$e=x-$*65536,x=Ke+$+65535,$=Math.floor(x/65536),Ke=x-$*65536,x=Gt+$+65535,$=Math.floor(x/65536),Gt=x-$*65536,x=et+$+65535,$=Math.floor(x/65536),et=x-$*65536,x=gt+$+65535,$=Math.floor(x/65536),gt=x-$*65536,x=xt+$+65535,$=Math.floor(x/65536),xt=x-$*65536,x=_t+$+65535,$=Math.floor(x/65536),_t=x-$*65536,x=Et+$+65535,$=Math.floor(x/65536),Et=x-$*65536,x=yt+$+65535,$=Math.floor(x/65536),yt=x-$*65536,x=wt+$+65535,$=Math.floor(x/65536),wt=x-$*65536,x=st+$+65535,$=Math.floor(x/65536),st=x-$*65536,x=nt+$+65535,$=Math.floor(x/65536),nt=x-$*65536,me+=$-1+37*($-1),$=1,x=me+$+65535,$=Math.floor(x/65536),me=x-$*65536,x=he+$+65535,$=Math.floor(x/65536),he=x-$*65536,x=Ie+$+65535,$=Math.floor(x/65536),Ie=x-$*65536,x=Ve+$+65535,$=Math.floor(x/65536),Ve=x-$*65536,x=$e+$+65535,$=Math.floor(x/65536),$e=x-$*65536,x=Ke+$+65535,$=Math.floor(x/65536),Ke=x-$*65536,x=Gt+$+65535,$=Math.floor(x/65536),Gt=x-$*65536,x=et+$+65535,$=Math.floor(x/65536),et=x-$*65536,x=gt+$+65535,$=Math.floor(x/65536),gt=x-$*65536,x=xt+$+65535,$=Math.floor(x/65536),xt=x-$*65536,x=_t+$+65535,$=Math.floor(x/65536),_t=x-$*65536,x=Et+$+65535,$=Math.floor(x/65536),Et=x-$*65536,x=yt+$+65535,$=Math.floor(x/65536),yt=x-$*65536,x=wt+$+65535,$=Math.floor(x/65536),wt=x-$*65536,x=st+$+65535,$=Math.floor(x/65536),st=x-$*65536,x=nt+$+65535,$=Math.floor(x/65536),nt=x-$*65536,me+=$-1+37*($-1),C[0]=me,C[1]=he,C[2]=Ie,C[3]=Ve,C[4]=$e,C[5]=Ke,C[6]=Gt,C[7]=et,C[8]=gt,C[9]=xt,C[10]=_t,C[11]=Et,C[12]=yt,C[13]=wt,C[14]=st,C[15]=nt}function ne(C,V){P(C,V,V)}function ue(C,V){var F=n(),x;for(x=0;x<16;x++)F[x]=V[x];for(x=253;x>=0;x--)ne(F,F),x!==2&&x!==4&&P(F,F,V);for(x=0;x<16;x++)C[x]=F[x]}function Te(C,V){var F=n(),x;for(x=0;x<16;x++)F[x]=V[x];for(x=250;x>=0;x--)ne(F,F),x!==1&&P(F,F,V);for(x=0;x<16;x++)C[x]=F[x]}function ve(C,V,F){var x=new Uint8Array(32),$=new Float64Array(80),me,he,Ie=n(),Ve=n(),$e=n(),Ke=n(),Gt=n(),et=n();for(he=0;he<31;he++)x[he]=V[he];for(x[31]=V[31]&127|64,x[0]&=248,m($,F),he=0;he<16;he++)Ve[he]=$[he],Ke[he]=Ie[he]=$e[he]=0;for(Ie[0]=Ke[0]=1,he=254;he>=0;--he)me=x[he>>>3]>>>(he&7)&1,z(Ie,Ve,me),z($e,Ke,me),b(Gt,Ie,$e),O(Ie,Ie,$e),b($e,Ve,Ke),O(Ve,Ve,Ke),ne(Ke,Gt),ne(et,Ie),P(Ie,$e,Ie),P($e,Ve,Gt),b(Gt,Ie,$e),O(Ie,Ie,$e),ne(Ve,Ie),O($e,Ke,et),P(Ie,$e,h),b(Ie,Ie,Ke),P($e,$e,Ie),P(Ie,Ke,et),P(Ke,Ve,$),ne(Ve,Gt),z(Ie,Ve,me),z($e,Ke,me);for(he=0;he<16;he++)$[he+16]=Ie[he],$[he+32]=$e[he],$[he+48]=Ve[he],$[he+64]=Ke[he];var gt=$.subarray(32),xt=$.subarray(16);return ue(gt,gt),P(xt,xt,gt),G(C,xt),0}function Xe(C,V){return ve(C,V,l)}function mt(C,V){return i(V,32),Xe(C,V)}function He(C,V,F){var x=new Uint8Array(32);return ve(x,F,V),re(C,o,x,te)}var At=g,tt=v;function Rt(C,V,F,x,$,me){var he=new Uint8Array(32);return He(he,$,me),At(C,V,F,x,he)}function qn(C,V,F,x,$,me){var he=new Uint8Array(32);return He(he,$,me),tt(C,V,F,x,he)}var Bt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Ze(C,V,F,x){for(var $=new Int32Array(16),me=new Int32Array(16),he,Ie,Ve,$e,Ke,Gt,et,gt,xt,_t,Et,yt,wt,st,nt,ut,Ge,Qe,at,Ye,Ce,Be,Le,Ne,ke,ze,bt=C[0],Nt=C[1],Dt=C[2],Ot=C[3],ie=C[4],Ht=C[5],Mt=C[6],Qt=C[7],zt=V[0],Jt=V[1],Vt=V[2],zn=V[3],fn=V[4],mn=V[5],Pn=V[6],On=V[7],$n=0;x>=128;){for(at=0;at<16;at++)Ye=8*at+$n,$[at]=F[Ye+0]<<24|F[Ye+1]<<16|F[Ye+2]<<8|F[Ye+3],me[at]=F[Ye+4]<<24|F[Ye+5]<<16|F[Ye+6]<<8|F[Ye+7];for(at=0;at<80;at++)if(he=bt,Ie=Nt,Ve=Dt,$e=Ot,Ke=ie,Gt=Ht,et=Mt,gt=Qt,xt=zt,_t=Jt,Et=Vt,yt=zn,wt=fn,st=mn,nt=Pn,ut=On,Ce=Qt,Be=On,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=(ie>>>14|fn<<18)^(ie>>>18|fn<<14)^(fn>>>9|ie<<23),Be=(fn>>>14|ie<<18)^(fn>>>18|ie<<14)^(ie>>>9|fn<<23),Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ce=ie&Ht^~ie&Mt,Be=fn&mn^~fn&Pn,Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ce=Bt[at*2],Be=Bt[at*2+1],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ce=$[at%16],Be=me[at%16],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,Ge=ke&65535|ze<<16,Qe=Le&65535|Ne<<16,Ce=Ge,Be=Qe,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=(bt>>>28|zt<<4)^(zt>>>2|bt<<30)^(zt>>>7|bt<<25),Be=(zt>>>28|bt<<4)^(bt>>>2|zt<<30)^(bt>>>7|zt<<25),Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ce=bt&Nt^bt&Dt^Nt&Dt,Be=zt&Jt^zt&Vt^Jt&Vt,Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,gt=ke&65535|ze<<16,ut=Le&65535|Ne<<16,Ce=$e,Be=yt,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=Ge,Be=Qe,Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,$e=ke&65535|ze<<16,yt=Le&65535|Ne<<16,Nt=he,Dt=Ie,Ot=Ve,ie=$e,Ht=Ke,Mt=Gt,Qt=et,bt=gt,Jt=xt,Vt=_t,zn=Et,fn=yt,mn=wt,Pn=st,On=nt,zt=ut,at%16===15)for(Ye=0;Ye<16;Ye++)Ce=$[Ye],Be=me[Ye],Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=$[(Ye+9)%16],Be=me[(Ye+9)%16],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ge=$[(Ye+1)%16],Qe=me[(Ye+1)%16],Ce=(Ge>>>1|Qe<<31)^(Ge>>>8|Qe<<24)^Ge>>>7,Be=(Qe>>>1|Ge<<31)^(Qe>>>8|Ge<<24)^(Qe>>>7|Ge<<25),Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ge=$[(Ye+14)%16],Qe=me[(Ye+14)%16],Ce=(Ge>>>19|Qe<<13)^(Qe>>>29|Ge<<3)^Ge>>>6,Be=(Qe>>>19|Ge<<13)^(Ge>>>29|Qe<<3)^(Qe>>>6|Ge<<26),Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,$[Ye]=ke&65535|ze<<16,me[Ye]=Le&65535|Ne<<16;Ce=bt,Be=zt,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[0],Be=V[0],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[0]=bt=ke&65535|ze<<16,V[0]=zt=Le&65535|Ne<<16,Ce=Nt,Be=Jt,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[1],Be=V[1],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[1]=Nt=ke&65535|ze<<16,V[1]=Jt=Le&65535|Ne<<16,Ce=Dt,Be=Vt,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[2],Be=V[2],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[2]=Dt=ke&65535|ze<<16,V[2]=Vt=Le&65535|Ne<<16,Ce=Ot,Be=zn,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[3],Be=V[3],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[3]=Ot=ke&65535|ze<<16,V[3]=zn=Le&65535|Ne<<16,Ce=ie,Be=fn,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[4],Be=V[4],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[4]=ie=ke&65535|ze<<16,V[4]=fn=Le&65535|Ne<<16,Ce=Ht,Be=mn,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[5],Be=V[5],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[5]=Ht=ke&65535|ze<<16,V[5]=mn=Le&65535|Ne<<16,Ce=Mt,Be=Pn,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[6],Be=V[6],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[6]=Mt=ke&65535|ze<<16,V[6]=Pn=Le&65535|Ne<<16,Ce=Qt,Be=On,Le=Be&65535,Ne=Be>>>16,ke=Ce&65535,ze=Ce>>>16,Ce=C[7],Be=V[7],Le+=Be&65535,Ne+=Be>>>16,ke+=Ce&65535,ze+=Ce>>>16,Ne+=Le>>>16,ke+=Ne>>>16,ze+=ke>>>16,C[7]=Qt=ke&65535|ze<<16,V[7]=On=Le&65535|Ne<<16,$n+=128,x-=128}return x}function an(C,V,F){var x=new Int32Array(8),$=new Int32Array(8),me=new Uint8Array(256),he,Ie=F;for(x[0]=1779033703,x[1]=3144134277,x[2]=1013904242,x[3]=2773480762,x[4]=1359893119,x[5]=2600822924,x[6]=528734635,x[7]=1541459225,$[0]=4089235720,$[1]=2227873595,$[2]=4271175723,$[3]=1595750129,$[4]=2917565137,$[5]=725511199,$[6]=4215389547,$[7]=327033209,Ze(x,$,V,F),F%=128,he=0;he<F;he++)me[he]=V[Ie-F+he];for(me[F]=128,F=256-128*(F<112?1:0),me[F-9]=0,L(me,F-8,Ie/536870912|0,Ie<<3),Ze(x,$,me,F),he=0;he<8;he++)L(C,8*he,x[he],$[he]);return 0}function jt(C,V){var F=n(),x=n(),$=n(),me=n(),he=n(),Ie=n(),Ve=n(),$e=n(),Ke=n();O(F,C[1],C[0]),O(Ke,V[1],V[0]),P(F,F,Ke),b(x,C[0],C[1]),b(Ke,V[0],V[1]),P(x,x,Ke),P($,C[3],V[3]),P($,$,_),P(me,C[2],V[2]),b(me,me,me),O(he,x,F),O(Ie,me,$),b(Ve,me,$),b($e,x,F),P(C[0],he,Ie),P(C[1],$e,Ve),P(C[2],Ve,Ie),P(C[3],he,$e)}function Lt(C,V,F){var x;for(x=0;x<4;x++)z(C[x],V[x],F)}function jn(C,V){var F=n(),x=n(),$=n();ue($,V[2]),P(F,V[0],$),P(x,V[1],$),G(C,x),C[31]^=T(F)<<7}function Fe(C,V,F){var x,$;for(E(C[0],u),E(C[1],f),E(C[2],f),E(C[3],u),$=255;$>=0;--$)x=F[$/8|0]>>($&7)&1,Lt(C,V,x),jt(V,C),jt(C,C),Lt(C,V,x)}function qe(C,V){var F=[n(),n(),n(),n()];E(F[0],A),E(F[1],D),E(F[2],f),P(F[3],A,D),Fe(C,F,V)}function Yt(C,V,F){var x=new Uint8Array(64),$=[n(),n(),n(),n()],me;for(F||i(V,32),an(x,V,32),x[0]&=248,x[31]&=127,x[31]|=64,qe($,x),jn(C,$),me=0;me<32;me++)V[me+32]=C[me];return 0}var Wt=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function H(C,V){var F,x,$,me;for(x=63;x>=32;--x){for(F=0,$=x-32,me=x-12;$<me;++$)V[$]+=F-16*V[x]*Wt[$-(x-32)],F=Math.floor((V[$]+128)/256),V[$]-=F*256;V[$]+=F,V[x]=0}for(F=0,$=0;$<32;$++)V[$]+=F-(V[31]>>4)*Wt[$],F=V[$]>>8,V[$]&=255;for($=0;$<32;$++)V[$]-=F*Wt[$];for(x=0;x<32;x++)V[x+1]+=V[x]>>8,C[x]=V[x]&255}function S(C){var V=new Float64Array(64),F;for(F=0;F<64;F++)V[F]=C[F];for(F=0;F<64;F++)C[F]=0;H(C,V)}function I(C,V,F,x){var $=new Uint8Array(64),me=new Uint8Array(64),he=new Uint8Array(64),Ie,Ve,$e=new Float64Array(64),Ke=[n(),n(),n(),n()];an($,x,32),$[0]&=248,$[31]&=127,$[31]|=64;var Gt=F+64;for(Ie=0;Ie<F;Ie++)C[64+Ie]=V[Ie];for(Ie=0;Ie<32;Ie++)C[32+Ie]=$[32+Ie];for(an(he,C.subarray(32),F+32),S(he),qe(Ke,he),jn(C,Ke),Ie=32;Ie<64;Ie++)C[Ie]=x[Ie];for(an(me,C,F+64),S(me),Ie=0;Ie<64;Ie++)$e[Ie]=0;for(Ie=0;Ie<32;Ie++)$e[Ie]=he[Ie];for(Ie=0;Ie<32;Ie++)for(Ve=0;Ve<32;Ve++)$e[Ie+Ve]+=me[Ie]*$[Ve];return H(C.subarray(32),$e),Gt}function Y(C,V){var F=n(),x=n(),$=n(),me=n(),he=n(),Ie=n(),Ve=n();return E(C[2],f),m(C[1],V),ne($,C[1]),P(me,$,y),O($,$,C[2]),b(me,C[2],me),ne(he,me),ne(Ie,he),P(Ve,Ie,he),P(F,Ve,$),P(F,F,me),Te(F,F),P(F,F,$),P(F,F,me),P(F,F,me),P(C[0],F,me),ne(x,C[0]),P(x,x,me),J(x,$)&&P(C[0],C[0],U),ne(x,C[0]),P(x,x,me),J(x,$)?-1:(T(C[0])===V[31]>>7&&O(C[0],u,C[0]),P(C[3],C[0],C[1]),0)}function ge(C,V,F,x){var $,me=new Uint8Array(32),he=new Uint8Array(64),Ie=[n(),n(),n(),n()],Ve=[n(),n(),n(),n()];if(F<64||Y(Ve,x))return-1;for($=0;$<F;$++)C[$]=V[$];for($=0;$<32;$++)C[$+32]=x[$];if(an(he,C,F),S(he),Fe(Ie,Ve,he),qe(Ve,V.subarray(32)),jt(Ie,Ve),jn(me,Ie),F-=64,M(V,0,me,0)){for($=0;$<F;$++)C[$]=0;return-1}for($=0;$<F;$++)C[$]=V[$+64];return F}var be=32,Re=24,ft=32,dt=16,rt=32,Zt=32,pt=32,gn=32,Di=32,vn=Re,In=ft,yi=dt,on=64,un=32,Oi=64,Tn=32,xn=64;t.lowlevel={crypto_core_hsalsa20:re,crypto_stream_xor:Z,crypto_stream:X,crypto_stream_salsa20_xor:pe,crypto_stream_salsa20:we,crypto_onetimeauth:ce,crypto_onetimeauth_verify:N,crypto_verify_16:j,crypto_verify_32:M,crypto_secretbox:g,crypto_secretbox_open:v,crypto_scalarmult:ve,crypto_scalarmult_base:Xe,crypto_box_beforenm:He,crypto_box_afternm:At,crypto_box:Rt,crypto_box_open:qn,crypto_box_keypair:mt,crypto_hash:an,crypto_sign:I,crypto_sign_keypair:Yt,crypto_sign_open:ge,crypto_secretbox_KEYBYTES:be,crypto_secretbox_NONCEBYTES:Re,crypto_secretbox_ZEROBYTES:ft,crypto_secretbox_BOXZEROBYTES:dt,crypto_scalarmult_BYTES:rt,crypto_scalarmult_SCALARBYTES:Zt,crypto_box_PUBLICKEYBYTES:pt,crypto_box_SECRETKEYBYTES:gn,crypto_box_BEFORENMBYTES:Di,crypto_box_NONCEBYTES:vn,crypto_box_ZEROBYTES:In,crypto_box_BOXZEROBYTES:yi,crypto_sign_BYTES:on,crypto_sign_PUBLICKEYBYTES:un,crypto_sign_SECRETKEYBYTES:Oi,crypto_sign_SEEDBYTES:Tn,crypto_hash_BYTES:xn,gf:n,D:y,L:Wt,pack25519:G,unpack25519:m,M:P,A:b,S:ne,Z:O,pow2523:Te,add:jt,set25
18519:E,modL:H,scalarmult:Fe,scalarbase:qe};function Ni(C,V){if(C.length!==be)throw new Error("bad key size");if(V.length!==Re)throw new Error("bad nonce size")}function Ln(C,V){if(C.length!==pt)throw new Error("bad public key size");if(V.length!==gn)throw new Error("bad secret key size")}function Xt(){for(var C=0;C<arguments.length;C++)if(!(arguments[C]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function Os(C){for(var V=0;V<C.length;V++)C[V]=0}t.randomBytes=function(C){var V=new Uint8Array(C);return i(V,C),V},t.secretbox=function(C,V,F){Xt(C,V,F),Ni(F,V);for(var x=new Uint8Array(ft+C.length),$=new Uint8Array(x.length),me=0;me<C.length;me++)x[me+ft]=C[me];return g($,x,x.length,V,F),$.subarray(dt)},t.secretbox.open=function(C,V,F){Xt(C,V,F),Ni(F,V);for(var x=new Uint8Array(dt+C.length),$=new Uint8Array(x.length),me=0;me<C.length;me++)x[me+dt]=C[me];return x.length<32||v($,x,x.length,V,F)!==0?null:$.subarray(ft)},t.secretbox.keyLength=be,t.secretbox.nonceLength=Re,t.secretbox.overheadLength=dt,t.scalarMult=function(C,V){if(Xt(C,V),C.length!==Zt)throw new Error("bad n size");if(V.length!==rt)throw new Error("bad p size");var F=new Uint8Array(rt);return ve(F,C,V),F},t.scalarMult.base=function(C){if(Xt(C),C.length!==Zt)throw new Error("bad n size");var V=new Uint8Array(rt);return Xe(V,C),V},t.scalarMult.scalarLength=Zt,t.scalarMult.groupElementLength=rt,t.box=function(C,V,F,x){var $=t.box.before(F,x);return t.secretbox(C,V,$)},t.box.before=function(C,V){Xt(C,V),Ln(C,V);var F=new Uint8Array(Di);return He(F,C,V),F},t.box.after=t.secretbox,t.box.open=function(C,V,F,x){var $=t.box.before(F,x);return t.secretbox.open(C,V,$)},t.box.open.after=t.secretbox.open,t.box.keyPair=function(){var C=new Uint8Array(pt),V=new Uint8Array(gn);return mt(C,V),{publicKey:C,secretKey:V}},t.box.keyPair.fromSecretKey=function(C){if(Xt(C),C.length!==gn)throw new Error("bad secret key size");var V=new Uint8Array(pt);return Xe(V,C),{publicKey:V,secretKey:new Uint8Array(C)}},t.box.publicKeyLength=pt,t.box.secretKeyLength=gn,t.box.sharedKeyLength=Di,t.box.nonceLength=vn,t.box.overheadLength=t.secretbox.overheadLength,t.sign=function(C,V){if(Xt(C,V),V.length!==Oi)throw new Error("bad secret key size");var F=new Uint8Array(on+C.length);return I(F,C,C.length,V),F},t.sign.open=function(C,V){if(Xt(C,V),V.length!==un)throw new Error("bad public key size");var F=new Uint8Array(C.length),x=ge(F,C,C.length,V);if(x<0)return null;for(var $=new Uint8Array(x),me=0;me<$.length;me++)$[me]=F[me];return $},t.sign.detached=function(C,V){for(var F=t.sign(C,V),x=new Uint8Array(on),$=0;$<x.length;$++)x[$]=F[$];return x},t.sign.detached.verify=function(C,V,F){if(Xt(C,V,F),V.length!==on)throw new Error("bad signature size");if(F.length!==un)throw new Error("bad public key size");var x=new Uint8Array(on+C.length),$=new Uint8Array(on+C.length),me;for(me=0;me<on;me++)x[me]=V[me];for(me=0;me<C.length;me++)x[me+on]=C[me];return ge($,x,x.length,F)>=0},t.sign.keyPair=function(){var C=new Uint8Array(un),V=new Uint8Array(Oi);return Yt(C,V),{publicKey:C,secretKey:V}},t.sign.keyPair.fromSecretKey=function(C){if(Xt(C),C.length!==Oi)throw new Error("bad secret key size");for(var V=new Uint8Array(un),F=0;F<V.length;F++)V[F]=C[32+F];return{publicKey:V,secretKey:new Uint8Array(C)}},t.sign.keyPair.fromSeed=function(C){if(Xt(C),C.length!==Tn)throw new Error("bad seed size");for(var V=new Uint8Array(un),F=new Uint8Array(Oi),x=0;x<32;x++)F[x]=C[x];return Yt(V,F,!0),{publicKey:V,secretKey:F}},t.sign.publicKeyLength=un,t.sign.secretKeyLength=Oi,t.sign.seedLength=Tn,t.sign.signatureLength=on,t.hash=function(C){Xt(C);var V=new Uint8Array(xn);return an(V,C,C.length),V},t.hash.hashLength=xn,t.verify=function(C,V){return Xt(C,V),C.length===0||V.length===0||C.length!==V.length?!1:k(C,0,V,0,C.length)===0},t.setPRNG=function(C){i=C},(function(){var C=typeof self<"u"?self.crypto||self.msCrypto:null;if(C&&C.getRandomValues){var V=65536;t.setPRNG(function(F,x){var $,me=new Uint8Array(x);for($=0;$<x;$+=V)C.getRandomValues(me.subarray($,$+Math.min(x-$,V)));for($=0;$<x;$++)F[$]=me[$];Os(me)})}else typeof FA<"u"&&(C=qE,C&&C.randomBytes&&t.setPRNG(function(F,x){var $,me=C.randomBytes(x);for($=0;
18$<x;$++)F[$]=me[$];Os(me)}))})()})(e.exports?e.exports:self.nacl=self.nacl||{})})(gp)),gp.exports}$A();var mp,gv;function WA(){if(gv)return mp;gv=1;function e(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),i=0;i<n.length;i++)n[i]=255;for(var o=0;o<t.length;o++){var l=t.charAt(o),u=l.charCodeAt(0);if(n[u]!==255)throw new TypeError(l+" is ambiguous");n[u]=o}var f=t.length,h=t.charAt(0),y=Math.log(f)/Math.log(256),_=Math.log(256)/Math.log(f);function A(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"";for(var k=0,j=0,M=0,W=L.length;M!==W&&L[M]===0;)M++,k++;for(var K=(W-M)*_+1>>>0,se=new Uint8Array(K);M!==W;){for(var re=L[M],te=0,pe=K-1;(re!==0||te<j)&&pe!==-1;pe--,te++)re+=256*se[pe]>>>0,se[pe]=re%f>>>0,re=re/f>>>0;if(re!==0)throw new Error("Non-zero carry");j=te,M++}for(var we=K-j;we!==K&&se[we]===0;)we++;for(var X=h.repeat(k);we<K;++we)X+=t.charAt(se[we]);return X}function D(L){if(typeof L!="string")throw new TypeError("Expected String");if(L.length===0)return new Uint8Array;for(var k=0,j=0,M=0;L[k]===h;)j++,k++;for(var W=(L.length-k)*y+1>>>0,K=new Uint8Array(W);L[k];){var se=L.charCodeAt(k);if(se>255)return;var re=n[se];if(re===255)return;for(var te=0,pe=W-1;(re!==0||te<M)&&pe!==-1;pe--,te++)re+=f*K[pe]>>>0,K[pe]=re%256>>>0,re=re/256>>>0;if(re!==0)throw new Error("Non-zero carry");M=te,k++}for(var we=W-M;we!==W&&K[we]===0;)we++;for(var X=new Uint8Array(j+(W-we)),Z=j;we!==W;)X[Z++]=K[we++];return X}function U(L){var k=D(L);if(k)return k;throw new Error("Non-base"+f+" character")}return{encode:A,decodeUnsafe:D,decode:U}}return mp=e,mp}var yp,mv;function GA(){return mv||(mv=1,yp=WA()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),yp}GA();async function $E(e){const t=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(t)}var YA={[Yn.SOLANA_MAINNET]:{chain:"solana",network:"mainnet",description:"Solana Mainnet-Beta"},[Yn.SOLANA_DEVNET]:{chain:"solana",network:"devnet",description:"Solana Devnet"},[Yn.SOLANA_TESTNET]:{chain:"solana",network:"testnet",description:"Solana Testnet"},[Yn.ETHEREUM_MAINNET]:{chain:"ethereum",network:"mainnet",description:"Ethereum Mainnet"},[Yn.ETHEREUM_SEPOLIA]:{chain:"ethereum",network:"sepolia",description:"Sepolia Testnet"},[Yn.POLYGON_MAINNET]:{chain:"polygon",network:"mainnet",description:"Polygon Mainnet"},[Yn.POLYGON_AMOY]:{chain:"polygon",network:"amoy",description:"Polygon Amoy Testnet"},[Yn.BASE_MAINNET]:{chain:"base",network:"mainnet",description:"Base Mainnet"},[Yn.BASE_SEPOLIA]:{chain:"base",network:"sepolia",description:"Base Sepolia Testnet"},[Yn.ARBITRUM_ONE]:{chain:"arbitrum",network:"mainnet",description:"Arbitrum One"},[Yn.ARBITRUM_SEPOLIA]:{chain:"arbitrum",network:"sepolia",description:"Arbitrum Sepolia Testnet"},[Yn.MONAD_MAINNET]:{chain:"monad",network:"mainnet",description:"Monad Mainnet"},[Yn.MONAD_TESTNET]:{chain:"monad",network:"testnet",description:"Monad Testnet"},[Yn.BITCOIN_MAINNET]:{chain:"bitcoin",network:"mainnet",description:"Bitcoin Mainnet"},[Yn.BITCOIN_TESTNET]:{chain:"bitcoin",network:"testnet",description:"Bitcoin Testnet"},[Yn.SUI_MAINNET]:{chain:"sui",network:"mainnet",description:"Sui Mainnet"},[Yn.SUI_TESTNET]:{chain:"sui",network:"testnet",description:"Sui Testnet"}};function ZA(e){const t=YA[e];if(t)return{chain:t.chain,network:t.network}}var jr={Solana:(e=0)=>`m/44'/501'/${e}'/0'`,Ethereum:(e=0)=>`m/44'/60'/0'/0/${e}`,Bitcoin:(e=0)=>`m/84'/0'/${e}'/0`,Sui:(e=0)=>`m/44'/784'/${e}'/0'/0'`};function If(e,t=0){switch(e.split(":")[0].toLowerCase()){case"solana":return{derivationPath:jr.Solana(t),curve:Ji.ed25519,algorithm:ma.ed25519,addressFormat:Ct.solana};case"sui":return{derivationPath:jr.Sui(t),curve:Ji.ed25519,algorithm:ma.ed25519,addressFormat:Ct.sui};case"bitcoin":case"btc":return{derivationPath:jr.Bitcoin(t),curve:Ji.secp256k1,algorithm:ma.secp256k1,addressFormat:Ct.bitcoinSegwit};case"eip155":return{derivationPath:jr.Ethereum(t),curve:Ji.secp256k1,algorithm:ma.secp256k1,addressFormat:Ct.ethereum};default:return null}}
18var Pc=class extends Error{constructor(e,t){super(e.detail),this.name=t,this.type=e.type,this.title=e.title,this.detail=e.detail,this.requestId=e.requestId}};function WE(e){if(c1(e))return e.response?.data}function wp(e,t="An error occurred"){if(e instanceof Pc)return e.detail||e.title||e.message||t;const n=WE(e);return n?n.message||n.detail||n.title||t:e instanceof Error?e.message:t}function JA(e){return c1(e)?e.response?.status===401||e.response?.status===403:!1}function XA(e){if(!e||!e.type)return null;switch(e.type){case"spending-limit-exceeded":return new GE(e);case"transaction-blocked":return new QA(e);default:return null}}var GE=class extends Pc{constructor(e){super(e,"SpendingLimitError"),this.previousSpendCents=e.previousSpendCents,this.transactionSpendCents=e.transactionSpendCents,this.totalSpendCents=e.totalSpendCents,this.limitCents=e.limitCents}},QA=class extends Pc{constructor(e){super(e,"TransactionBlockedError"),this.scannerResult=e.scannerResult}},bp=class{constructor(e,t){this.config={...e,walletType:e.walletType||"user-wallet"},this.logger=e.logger,this.axiosInstance=Vn.create();const n={};e.headers&&Object.assign(n,e.headers),Object.keys(n).length>0&&this.axiosInstance.interceptors.request.use(o=>(Object.assign(o.headers,n),o)),this.axiosInstance.interceptors.response.use(o=>(this.logger?.debug(`API response: method=${o.config.method?.toUpperCase()} url=${o.config.url} status=${o.status} body=${JSON.stringify(o.data)}`),o),o=>{const l=o.response?.status,u=o.config?.url,f=o.config?.method?.toUpperCase();return this.logger?.error(`API error response: method=${f} url=${u} status=${l} body=${JSON.stringify(o.response?.data)}`),Promise.reject(o)}),t&&(this.axiosInstance.interceptors.request.use(async o=>await this.stampRequest(o,t)),this.stamper=t);const i=new PE({basePath:e.apiBaseUrl});this.kmsApi=new zE(i,e.apiBaseUrl,this.axiosInstance)}setOrganizationId(e){if(!e)throw new Error("organizationId is required");this.config.organizationId=e}getAuthenticatorPublicKey(){if(this.stamper&&this.stamper.type!=="OIDC"&&"getKeyInfo"in this.stamper&&typeof this.stamper.getKeyInfo=="function")return this.stamper.getKeyInfo()?.publicKey}async createWallet(e){try{if(!this.config.organizationId)throw new Error("organizationId is required to create a wallet");const t=await ei(),n={organizationId:this.config.organizationId,walletName:e||`Wallet ${t}
18`,accounts:[jr.Solana(),jr.Ethereum(),jr.Bitcoin(),jr.Sui()]},i={method:bg.createWallet,params:n,timestampMs:t},l=(await this.kmsApi.postKmsRpc(i)).data.result,u={method:nd.getAccounts,params:{accounts:[jr.Solana(),jr.Ethereum(),jr.Bitcoin(),jr.Sui()],organizationId:this.config.organizationId,walletId:l.walletId},timestampMs:t},h=(await this.kmsApi.postKmsRpc(u)).data.result;return{walletId:l.walletId,addresses:h.map(y=>({addressType:y.addressFormat,address:y.address}))}}catch(t){throw this.logger?.error(`Failed to create wallet: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to create wallet: ${t.response?.data?.message||t.message}`,t)}}async prepare(e,t,n,i,o,l){try{const u={transaction:e,organizationId:t,submissionConfig:n,simulationConfig:{account:i},authenticatorPublicKey:o};return this.logger?.debug(`prepare request: submissionConfig=${JSON.stringify(n)} account=${i} methodName=${l} txLength=${e.length} request=${JSON.stringify(u)}`),(await this.axiosInstance.post(`${this.config.apiBaseUrl}/prepare`,u,{headers:{"Content-Type":"application/json","X-Rpc-Method":l}})).data}catch(u){const f=WE(u),h=u.response?.status,y=u.response?.data;this.logger?.error(`[TX_DEBUG] prepare failed: status=${h} methodName=${l} body=${JSON.stringify(y)}`);const _=XA(f);if(_)throw _;const A=f?.detail||wp(u,"Failed to submit transaction");throw new Error(A)}}async getTransactionForSigning(e){const{encodedTransaction:t,networkId:n,submissionConfig:i,account:o,authenticatorPublicKey:l}=e,u=Tg(n),f=VA(n);if(u)return{kind:"RLP_ENCODED",bytes:t};if(f&&this.config.walletType==="user-wallet"){if(!o)throw new Error("Account is required to simulate Solana transactions with spending limits");try{return(await this.prepare(t,this.config.organizationId,i,o,l,e.methodName)).transaction}catch(h){if(h instanceof Pc)throw h;const y=h instanceof Error?h.message:String(h);throw new Error(y)}}return t}getRpcMethodName(e,t){return Tg(e)?t?"eth_sendTransaction":"eth_signTransaction":t?"signAndSendTransaction":"signTransaction"}async performTransactionSigning(e,t,n){const i=e.walletId,o=e.transaction,l=e.networkId,u=e.derivationIndex??0,f=this.getRpcMethodName(l,t);try{if(!this.config.organizationId)throw new Error("organizationId is required to sign a transaction");const h=ZA(l);if(!h)throw new Error(`SubmissionConfig could not be derived for network ID: ${l}`);const y=If(l,u);if(!y)throw new Error(`Unsupported network ID: ${l}`);const _={derivationPath:y.derivationPath,curve:y.curve,addressFormat:y.addressFormat},A=this.getAuthenticatorPublicKey();let D=await this.getTransactionForSigning({encodedTransaction:o,networkId:l,submissionConfig:h,authenticatorPublicKey:A,account:e.account,methodName:f});
18if(n&&typeof D=="string")try{D=await n(D,{networkId:l,walletId:i})}catch(K){throw new Error(`presignTransaction hook failed: ${wp(K,"unknown error")}`)}const U={organizationId:this.config.organizationId,walletId:i,transaction:D,derivationInfo:_};t&&(U.submissionConfig=h),t&&e.account&&(U.simulationConfig={account:e.account});const L={method:Ag.signTransaction,params:U,timestampMs:await ei()};this.logger?.debug(`[TX_DEBUG] KMS request: methodName=${f} networkId=${l} walletId=${i} account=${e.account}`),this.logger?.debug(`[TX_DEBUG] transactionForSigning=${JSON.stringify(D)}`);const k=await this.kmsApi.postKmsRpc(L,{headers:{"X-Rpc-Method":f}}),j=k.data.result,M=k.data.rpc_submission_result;this.logger?.debug(`[TX_DEBUG] KMS response: methodName=${f} hasResult=${!!j} rpcSubmissionResult=${JSON.stringify(M)} fullResponse=${JSON.stringify(k.data)}`);let W;if(t&&M){if(M.error){const{error:se}=M;throw new Error(`Transaction broadcast failed: ${se.data??se.message??JSON.stringify(M)}`)}const K=M.result;if(K!=null){if(typeof K=="string")W=K;else if(typeof K.result=="string")W=K.result;else if(K.error){const{error:se}=K;throw new Error(`Transaction broadcast failed: ${se.data??se.message??JSON.stringify(K)}`)}}}return{signedTransaction:j.transaction,hash:W}}catch(h){const y=t?"sign and send":"sign";if(h instanceof Pc)throw h;const _=h.response?.status,A=h.response?.data;throw this.logger?.error(`[TX_DEBUG] performTransactionSigning failed: methodName=${f} status=${_} body=${JSON.stringify(A)}`),this.wrapAxiosError(wp(h,`Failed to ${y} transaction`),h)}}async signTransaction(e){return{rawTransaction:(await this.performTransactionSigning(e,!1,e.presignTransaction)).signedTransaction}}async signAndSendTransaction(e){const t=await this.performTransactionSigning(e,!0,e.presignTransaction);return{rawTransaction:t.signedTransaction,hash:t.hash}}async getWalletAddresses(e,t,n){try{const i=n??0,o=t||[jr.Solana(i),jr.Ethereum(i),jr.Bitcoin(i),jr.Sui(i)],l={method:nd.getAccounts,params:{accounts:o,organizationId:this.config.organizationId,walletId:e},timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(l)).data.result.map(y=>({addressType:y.addressFormat,address:y.address}))}catch(i){throw this.logger?.error(`Failed to get wallet addresses: ${JSON.stringify(i.response?.data)||i.message}`),this.wrapAxiosError(`Failed to get wallet addresses: ${i.response?.data?.message||i.message}`,i)}}async ethereumSignMessage(e){const t=e.walletId,n=e.message,i=e.networkId,o=e.derivationIndex??0;try{if(!this.config.organizationId)throw new Error("organizationId is required to sign a message");const l=If(i,o);if(!l)throw new Error(`Unsupported network ID: ${i}`);const u={derivationPath:l.derivationPath,curve:l.curve,addressFormat:l.addressFormat},h={method:"ethereumSignMessage",params:{message:n,organizationId:this.config.organizationId,walletId:t,derivationInfo:u},timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(h)).data.result.signature}catch(l){throw this.logger?.error(`Failed to sign Ethereum message: ${JSON.stringify(l.response?.data)||l.message}`),this.wrapAxiosError(`Failed to sign Ethereum message: ${l.response?.data?.message||l.message}`,l)}}async signUtf8Message(e){const t=e.walletId,n=e.message,i=e.networkId,o=e.derivationIndex??0;try{if(!this.config.organizationId)throw new Error("organizationId is required to sign a message");const l=If(i,o);if(!l)throw new Error(`Unsupported network ID: ${i}`);const u={derivationPath:l.derivationPath,curve:l.curve,addressFormat:l.addressFormat},f={organizationId:this.config.organizationId,walletId:t,message:n,algorithm:l.algorithm,derivationInfo:u},h={method:_g.signUtf8Message,params:f,timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(h)).data.result.signature}catch(l){throw this.logger?.error(`Failed to sign raw payload: ${JSON.stringify(l.response?.data)||l.message}`),this.wrapAxiosError(`Failed to sign raw payload: ${l.response?.data?.message||l.message}`,l)}}async ethereumSignTypedData(e){const t=e.walletId,n=e.typedData,i=e.networkId,o=e.derivationIndex??0;try{if(!this.config.organizationId)throw new Error("organizationId is required to sign typed data");const l=If(i,o);if(!l)throw new Error(`Unsupported network ID: ${i}`);const u={derivationPath:l.derivationPath,curve:l.curve,addressFormat:l.addressFormat},f={method:"ethereumSignTypedData",params:{typedData:n,organizationId:this.config.organizationId,walletId:t,derivationInfo:u},timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(f)).data.result.signature}catch(l){throw this.logger?.error(`Failed to sign typed data: ${JSON.stringify(l.response?.data)||l.message}`),this.wrapAxiosError(`Failed to sign typed data: ${l.response?.data?.message||l.message}`,l)}}async getWallets(e,t){try{const n={method:"getOrganizationWallets",params:{organizationId:this.config.organizationId,limit:e||20,offset:t||0},timestampMs:await ei()},o=(await this.kmsApi.postKmsRpc(n)).data.result;return{wallets:o.wallets.map(l=>({walletId:l.walletId,walletName:l.walletName})),totalCount:o.totalCount,limit:o.limit,offset:o.offset}}catch(n){throw this.logger?.error(`Failed to get wallets: ${JSON.stringify(n.response?.data)||n.message}`),this.wrapAxiosError(`Failed to get wallets: ${n.response?.data?.message||n.message}`,n)}}async getOrganization(e){try{const t={method:"getOrganization",params:{organizationId:e},timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(t)).data.result}catch(t){throw this.logger?.error(`Failed to get organization: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to get organization: ${t.response?.data?.message||t.message}`,t)}}validateNameLength(e,t){if(e.length>64)throw new Error(`${t} name cannot exceed 64 characters. Current length: ${e.length}`)}async createOrganization(e,t,n){try{if(!e)throw new Error("Organization name is required");if(this.validateNameLength(e,"Organization"),!t||t.length===0)throw new Error("At least one user is required");for(const f of t){f.username&&this.validateNameLength(f.username,"Username");for(const h of f.authenticators)h.authenticatorName&&this.validateNameLength(h.authenticatorName,"Authenticator")}const i={organizationName:e,users:t.map(f=>({username:f.username||`user-${FE()}`,authenticators:f.authenticators,policy:f.role==="ADMIN"?{type:Ig.root}:{type:"CEL",preset:"LEGACY_USER_ROLE"}})),tags:n},o={method:wg.createOrganization,params:i,timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(o)).data.result}catch(i){throw this.logger?.error(`Failed to create organization: ${JSON.stringify(i.response?.data)||i.message}`),this.wrapAxiosError(`Failed to create organization: ${i.response?.data?.message||i.message}`,i)}}async createAuthenticator(e){try{e.username&&this.validateNameLength(e.username,"Username"),e.authenticatorName&&this.validateNameLength(e.authenticatorName,"Authenticator"),e.authenticator?.authenticatorName&&this.validateNameLength(e.authenticator.authenticatorName,"Authenticator");const t={organizationId:e.organizationId,username:e.username,authenticatorName:e.authenticatorName,authenticator:e.authenticator,replaceExpirable:e.replaceExpirable},n={method:yg.createAuthenticator,params:t,timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(n)).data.result}catch(t){throw this.logger?.error(`Failed to create authenticator: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to create authenticator: ${t.response?.data?.message||t.message}`,t)}}async deleteAuthenticator(e){try{const t={organizationId:e.organizationId,username:e.username,authenticatorId:e.authenticatorId},n={method:vg.deleteAuthenticator,params:t,timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(n)).data.result}catch(t){throw this.logger?.error(`Failed to delete authenticator: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to delete authenticator: ${t.response?.data?.message||t.message}`,t)}}async grantOrganizationAccess(e){try{const t={method:Sg.grantOrganizationAccess,params:e,timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(t)).data.result}catch(t){throw this.logger?.error(`Failed to grant organization access: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to grant organization access: ${t.response?.data?.message||t.message}`,t)}}async addUserToOrganization(e){try{const t={method:mg.addUserToOrganization,params:e,timestampMs:await ei()};await this.kmsApi.postKmsRpc(t)}catch(t){throw this.logger?.error(`Failed to add user to organization: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to add user to organization: ${t.response?.data?.message||t.message}`,t)}}async getWalletWithTag(e){try{const t={method:"getWalletWithTag",params:{organizationId:e.organizationId,tag:e.tag,derivationPaths:e.derivationPaths},timestampMs:await ei()};return(await this.kmsApi.postKmsRpc(t)).data.result}catch(t){throw this.logger?.error(`Failed to get wallet with tag: ${JSON.stringify(t.response?.data)||t.message}`),this.wrapAxiosError(`Failed to get wallet with tag: ${t.response?.data?.message||t.message}`,t)}}
18async stampRequest(e,t){const n=typeof e.data=="string"?e.data:e.data===void 0?"":JSON.stringify(e.data),i=Tt.Buffer.from(n,"utf8"),o=await t.stamp({data:i});e.headers=e.headers||{},e.headers["X-Phantom-Stamp"]=o;const l=this.config.getHeaders?.();if(l)for(const[u,f]of Object.entries(l))typeof f=="string"&&f&&(e.headers[u]=f);return e}wrapAxiosError(e,t){const n=new Error(e);return c1(t)&&(n.response=t.response),n}},e_=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},YE=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Cn=(e,t,n)=>(e_(e,t,"access private method"),n);function Bs(){try{return!!window?.phantom}catch{return!1}}var u1="Phantom wallet not detected.",Li="Ethereum provider not found on window.phantom.",bs="Solana provider not found on window.phantom.",t_="App provider not found on window.phantom.",n_=/^0x[a-fA-F0-9]{40}$/,r_=/^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}(:[0-9]{1,5})?$/,i_=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:[0-9]{1,5})?$/,s_=/^localhost(:[0-9]{1,5})?$/,a_=/^[a-zA-Z0-9]{8,}$/,o_=/^([a-zA-Z][a-zA-Z0-9+-.]*)$/;function l_({address:e,chainId:t,domain:n,nonce:i,uri:o,version:l,scheme:u,statement:f,requestId:h,resources:y,issuedAt:_=new Date,expirationTime:A,notBefore:D}){if(!n_.test(e))throw new Error("address must be a hex value of 20 bytes (40 hex characters).");if(t!==Math.floor(t))throw new Error("chainId must be a EIP-155 chain ID.");if(!(r_.test(n)||i_.test(n)||s_.test(n)))throw new Error("domain must be an RFC 3986 authority.");if(!a_.test(i))throw new Error("nonce must be at least 8 characters.");if(!yv(o))throw new Error("uri must be a RFC 3986 URI referring to the resource that is the subject of the signing.");if(l!=="1")throw new Error("version must be '1'.");if(u&&!o_.test(u))throw new Error("scheme must be an RFC 3986 URI scheme.");if(f?.includes(` 19`))throw new Error("statement must not include '\\n'.");const U=u?`${u}://${n}`:n,L=f?`${f} 20`:"",k=`${U} wants you to sign in with your Ethereum account: 21${e} 22 23${L}`;let j=`URI: ${o} 24Version: ${l} 25Chain ID: ${t} 26Nonce: ${i} 27Issued At: ${_.toISOString()}`;if(A&&(j+=` 28Expiration Time: ${A.toISOString()}`),D&&(j+=` 29Not Before: ${D.toISOString()}`),h&&(j+=` 30Request ID: ${h}`),y){let M=` 31Resources:`;for(const W of y){if(!yv(W))throw new Error("resources must be RFC 3986 URIs.");M+=` 32- ${W}`}j+=M}return`${k} 33${j}`}function yv(e){if(/[^a-z0-9:/?#[\]@!$&'()*+,;=.\-_~%]/i.test(e)||/%[^0-9a-f]/i.test(e)||/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e))return!1;const t=c_(e),n=t[1],i=t[2],o=t[3],l=t[4],u=t[5];if(!(n?.length&&o.length>=0))return!1;if(i?.length){if(!(o.length===0||/^\//.test(o)))return!1}else if(/^\/\//.test(o))return!1;if(!/^[a-z][a-z0-9+\-.]*$/.test(n.toLowerCase()))return!1;let f="";return f+=`${n}:`,i?.length&&(f+=`//${i}`),f+=o,l?.length&&(f+=`?${l}`),u?.length&&(f+=`#${u}`),f}function c_(e){return e.match(/(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)}var u_=6,f_=100,Ur,Fr,d_=class{constructor(){YE(this,Ur),this.type="injected"}load(){let e=0;const t=(n,i)=>{const o=f_*Math.pow(2,Math.min(e,5));setTimeout(()=>{if(Cn(this,Ur,Fr).call(this)){n();return}e++,e>=u_?Bs()?i(new Error(Li)):i(new Error(u1)):t(n,i)},o)};return new Promise((n,i)=>{t(()=>n(this),i)})}getProvider(){return Cn(this,Ur,Fr).call(this)||null}get isConnected(){const e=Cn(this,Ur,Fr).call(this);return!!(e?.isConnected&&e.selectedAddress)}async connect({onlyIfTrusted:e}){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);if(t.isConnected&&t.selectedAddress)return this.getAccounts();try{return await t.request({method:e?"eth_accounts":"eth_requestAccounts"})}catch{return}}async disconnect(){return Promise.resolve()}async getAccounts(){const e=Cn(this,Ur,Fr).call(this);if(!e)return[];try{return await e.request({method:"eth_accounts"})||[]}catch{return[]}}async signMessage(e,t){const n=Cn(this,Ur,Fr).call(this);if(!n)throw new Error(Li);if(!n.isConnected)throw new Error("Provider is not connected.");return await n.request({method:"eth_sign",params:[t,e]})}async signPersonalMessage(e,t){const n=Cn(this,Ur,Fr).call(this);if(!n)throw new Error(Li);if(!n.isConnected)throw new Error("Provider is not connected.");return await n.request({method:"personal_sign",params:[e,t]})}async signTypedData(e,t){const n=Cn(this,Ur,Fr).call(this);if(!n)throw new Error(Li);if(!n.isConnected)throw new Error("Provider is not connected.");return await n.request({method:"eth_signTypedData_v4",params:[t,JSON.stringify(e)]})}async signIn(e){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);const n=l_(e),i=t.selectedAddress;if(!i)throw new Error("No address available.");const o=await this.signPersonalMessage(n,i);return{address:i,signature:o,signedMessage:n}}async sendTransaction(e){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);if(!t.isConnected)throw new Error("Provider is not connected.");return await t.request({method:"eth_sendTransaction",params:[e]})}async signTransaction(e){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);if(!t.isConnected)throw new Error("Provider is not connected.");return await t.request({method:"eth_signTransaction",params:[e]})}async getChainId(){const e=Cn(this,Ur,Fr).call(this);if(!e)throw new Error(Li);return await e.request({method:"eth_chainId"})}async switchChain(e){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);await t.request({method:"wallet_switchEthereumChain",params:[{chainId:e}]})}async request(e){const t=Cn(this,Ur,Fr).call(this);if(!t)throw new Error(Li);return await t.request(e)}};Ur=new WeakSet;Fr=function(){if(Bs())return window.phantom.ethereum};async function Hi(e="injected"){if(e==="injected"){const t=new d_;return await t.load(),t}else throw new Error("Invalid provider type.")}var Oc=new Map;function h_(e,t){return Oc.has(e)||Oc.set(e,new Set),Oc.get(e)?.add(t),()=>ZE(e,t)}function ZE(e,t){const n=Oc.get(e);n&&n.delete(t)}function pa(e,t){const n=Oc.get(e);
33n&&n.forEach(i=>{try{i(t)}catch(o){console.error(`Error in ${e} event listener:`,o)}})}async function p_({onlyIfTrusted:e=!1}={}){const t=await Hi();if(t.isConnected)return await t.getAccounts();try{const n=await t.connect({onlyIfTrusted:!0});if(n&&n.length>0)return pa("connect",n),n}catch{}if(e)throw new Error("No trusted connection available.");try{const n=await t.connect({onlyIfTrusted:!1});if(n&&n.length>0)return pa("connect",n),n}catch{}throw new Error("Failed to connect to Phantom.")}async function g_(){await(await Hi()).disconnect(),pa("disconnect",[])}async function m_(){return(await Hi()).getAccounts()}async function y_(e,t){const n=await Hi();return n.isConnected||await n.connect({onlyIfTrusted:!1}),n.signPersonalMessage(e,t)}async function w_(e,t){const n=await Hi();return n.isConnected||await n.connect({onlyIfTrusted:!1}),n.signTypedData(e,t)}async function b_(e){const t=await Hi();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.sendTransaction(e)}async function v_(e){const t=await Hi();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.signTransaction(e)}async function x_(){return(await Hi()).getChainId()}async function E_(e){return(await Hi()).switchChain(e)}var S_=class{constructor(){this._chainId="0x1",this._accounts=[],this.bindProviderEvents()}get chainId(){return this._chainId}get accounts(){return this._accounts}async request(e){const n=(await Hi()).getProvider();if(!n)throw new Error("Provider instance not found.");return n.request(e)}async connect(){const e=await p_();return this._accounts=e,e}async disconnect(){await g_(),this._accounts=[]}signPersonalMessage(e,t){return y_(e,t)}signTypedData(e,t){return w_(e,t)}signTransaction(e){return v_(e)}sendTransaction(e){return b_(e)}
33async switchChain(e){const t=typeof e=="string"?e.toLowerCase().startsWith("0x")?e.toLowerCase():`0x${parseInt(e,10).toString(16)}`:`0x${e.toString(16)}`;await E_(t),this._chainId=t}async getChainId(){const e=await x_(),t=parseInt(e,16);return this._chainId=e,t}async getAccounts(){const e=await m_();return this._accounts=e,e}isConnected(){return this._accounts.length>0}on(e,t){h_(e,t)}off(e,t){ZE(e,t)}async bindProviderEvents(){try{const t=(await Hi()).getProvider();t&&(t.on("connect",async()=>{try{const n=await t.request({method:"eth_accounts"});n?.length>0&&(this._accounts=n,pa("connect",n))}catch{}}),t.on("disconnect",()=>{this._accounts=[],pa("disconnect",{code:4900,message:"Provider disconnected"})}),t.on("accountsChanged",n=>{this._accounts=n,pa("accountsChanged",n),n&&n.length>0&&pa("connect",n)}),t.on("chainChanged",n=>{this._chainId=n,pa("chainChanged",n)}))}catch{}}};function A_(){return{name:"ethereum",create:()=>new S_}}var __={isInstalled:Bs};function I_(){return{name:"extension",create:()=>__}}function T_({plugins:e=[]}){const t={};for(const n of e)t[n.name]=n.create();return t}var R_=6,C_=100,ti,di,M_=class{constructor(){YE(this,ti),this.type="injected"}load(){let e=0;const t=(n,i)=>{const o=C_*Math.pow(2,Math.min(e,5));setTimeout(()=>{if(Cn(this,ti,di).call(this)){n();return}e++,e>=R_?Bs()?i(new Error(bs)):i(new Error(u1)):t(n,i)},o)};return new Promise((n,i)=>{t(()=>n(this),i)})}getProvider(){return Cn(this,ti,di).call(this)||null}get isConnected(){const e=Cn(this,ti,di).call(this);return!!(e?.isConnected&&e.publicKey)}async connect({onlyIfTrusted:e}){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);if(t.isConnected&&t.publicKey)return this.getAccount()??void 0;try{return(await t.connect({onlyIfTrusted:e})).publicKey.toString()}catch{return}}async disconnect(){const e=Cn(this,ti,di).call(this);if(!e)throw new Error(bs);await e.disconnect()}async getAccount(){const e=Cn(this,ti,di).call(this);return e&&e.isConnected&&e.publicKey?Promise.resolve(e.publicKey.toString()):Promise.resolve(void 0)}async signMessage(e,t){const n=Cn(this,ti,di).call(this);if(!n)throw new Error(bs);if(!n.isConnected)throw new Error("Provider is not connected.");const i=await n.signMessage(e,t);return{signature:i.signature,address:i.publicKey.toString()}}async signIn(e){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);const n=await t.signIn(e);return{address:n.address.toString(),signature:n.signature,signedMessage:n.signedMessage}}async signAndSendTransaction(e){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);if(!t.isConnected)throw new Error("Provider is not connected.");const n=await t.signAndSendTransaction(e);return{signature:n.signature,address:n.publicKey}}async signAndSendAllTransactions(e){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);if(!t.isConnected)throw new Error("Provider is not connected.");if(!t.signAndSendAllTransactions)throw new Error("Provider does not support signAndSendAllTransactions.");const n=await t.signAndSendAllTransactions(e);return{signatures:n.signatures,address:n.publicKey}}async signTransaction(e){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);if(!t.isConnected)throw new Error("Provider is not connected.");return await t.signTransaction(e)}async signAllTransactions(e){const t=Cn(this,ti,di).call(this);if(!t)throw new Error(bs);if(!t.isConnected)throw new Error("Provider is not connected.");return await t.signAllTransactions(e)}};ti=new WeakSet;di=function(){if(Bs())return window.phantom.solana};async function _a(e="injected"){if(e==="injected"){const t=new M_;return await t.load(),t}else throw new Error("Invalid provider type.")}var Rs=new Map;function B_(e,t){return Rs.has(e)||Rs.set(e,new Set),Rs.get(e)?.add(t),()=>{JE(e,t)}}function JE(e,t){Rs.has(e)&&(Rs.get(e)?.delete(t),Rs.get(e)?.size===0&&Rs.delete(e))}function ga(e,...t){Rs.has(e)&&Rs.get(e)?.forEach(n=>{try{n(...t)}catch(i){console.error(`Error in ${e} event listener:`,i)}})}async function D_({onlyIfTrusted:e=!1}={}){const t=await _a();if(t.isConnected)return t.getAccount();try{const n=await t.connect({onlyIfTrusted:!0});if(n)return ga("connect",n),n}catch{}if(e)throw new Error("No trusted connection available.");try{const n=await t.connect({onlyIfTrusted:!1});if(n)return ga("connect",n),n}catch{}throw new Error("Failed to connect to Phantom.")}async function O_(){await(await _a()).disconnect(),ga("disconnect")}
33async function N_(e){const t=await _a();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.signAndSendTransaction(e)}async function k_(e){const t=await _a();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.signAndSendAllTransactions(e)}async function U_(e){const t=await _a();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.signTransaction(e)}async function j_(e){const t=await _a();return t.isConnected||await t.connect({onlyIfTrusted:!1}),t.signAllTransactions(e)}async function L_(e,t){const n=await _a();return n.isConnected||await n.connect({onlyIfTrusted:!1}),n.signMessage(e,t)}var z_=class{constructor(){this._publicKey=null,this.bindProviderEvents()}get publicKey(){return this._publicKey}get isConnected(){return this._publicKey!==null}async connect(e){const t=await D_(e);if(!t)throw new Error("Failed to connect to Solana wallet");return this._publicKey=t,{publicKey:t}}async disconnect(){await O_(),this._publicKey=null}async signMessage(e){const t=typeof e=="string"?new TextEncoder().encode(e):e,n=await L_(t);return{signature:n.signature instanceof Uint8Array?n.signature:new Uint8Array(n.signature),publicKey:n.address||this._publicKey||""}}signTransaction(e){return U_(e)}async signAndSendTransaction(e){return{signature:(await N_(e)).signature}}signAllTransactions(e){return j_(e)}async signAndSendAllTransactions(e){return{signatures:(await k_(e)).signatures}}async switchNetwork(e){return Promise.resolve()}on(e,t){B_(e,t)}off(e,t){JE(e,t)}async bindProviderEvents(){try{const t=(await _a()).getProvider();t&&(t.on("connect",n=>{if(n){const i=n.toString();this._publicKey=i,ga("connect",i)}}),t.on("disconnect",()=>{this._publicKey=null,ga("disconnect")}),t.on("accountChanged",n=>{if(n){const i=n.toString();this._publicKey=i,ga("accountChanged",i),ga("connect",i)}else this._publicKey=null,ga("accountChanged",null)}))}catch{}}};function P_(){return{name:"solana",create:()=>new z_}}function Rd(){if(!Bs())throw new Error(u1);const e=window.phantom.app;if(!e)throw new Error(t_);return e}async function H_(e){const t=Rd(),n=e?.chains?{chains:e.chains.map(kA)}:{},i=await t.request({method:"phantom_auto_confirm_enable",params:n});return{...i,chains:i.chains.map(Td)}}async function V_(){const t=await Rd().request({method:"phantom_auto_confirm_disable",params:{}});return{...t,chains:t.chains.map(Td)}}async function F_(){const t=await Rd().request({method:"phantom_auto_confirm_status",params:{}});return{...t,chains:t.chains.map(Td)}}async function K_(){return{chains:(await Rd().request({method:"phantom_auto_confirm_supported_chains",params:{}})).chains.map(Td)}}var q_={autoConfirmEnable:H_,autoConfirmDisable:V_,autoConfirmStatus:F_,autoConfirmSupportedChains:K_};function $_(){return{name:"autoConfirm",create:()=>q_}}var vp={exports:{}},wv;function W_(){return wv||(wv=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function o(h,y,_){this.fn=h,this.context=y,this.once=_||!1}function l(h,y,_,A,D){if(typeof _!="function")throw new TypeError("The listener must be a function");var U=new o(_,A||h,D),L=n?n+y:y;return h._events[L]?h._events[L].fn?h._events[L]=[h._events[L],U]:h._events[L].push(U):(h._events[L]=U,h._eventsCount++),h}function u(h,y){--h._eventsCount===0?h._events=new i:delete h._events[y]}function f(){this._events=new i,this._eventsCount=0}f.prototype.eventNames=function(){var y=[],_,A;if(this._eventsCount===0)return y;for(A in _=this._events)t.call(_,A)&&y.push(n?A.slice(1):A);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(_)):y},f.prototype.listeners=function(y){var _=n?n+y:y,A=this._events[_];if(!A)return[];if(A.fn)return[A.fn];for(var D=0,U=A.length,L=new Array(U);D<U;D++)L[D]=A[D].fn;return L},f.prototype.listenerCount=function(y){var _=n?n+y:y,A=this._events[_];return A?A.fn?1:A.length:0},f.prototype.emit=function(y,_,A,D,U,L){var k=n?n+y:y;if(!this._events[k])return!1;var j=this._events[k],M=arguments.length,W,K;if(j.fn){switch(j.once&&this.removeListener(y,j.fn,void 0,!0),M){case 1:return j.fn.call(j.context),!0;case 2:return j.fn.call(j.context,_),!0;case 3:return j.fn.call(j.context,_,A),!0;case 4:return j.fn.call(j.context,_,A,D),!0;case 5:return j.fn.call(j.context,_,A,D,U),!0;case 6:return j.fn.call(j.context,_,A,D,U,L),!0}for(K=1,W=new Array(M-1);K<M;K++)W[K-1]=arguments[K];j.fn.apply(j.context,W)}else{var se=j.length,re;for(K=0;K<se;K++)switch(j[K].once&&this.removeListener(y,j[K].fn,void 0,!0),M){case 1:j[K].fn.call(j[K].context);break;case 2:j[K].fn.call(j[K].context,_);break;case 3:j[K].fn.call(j[K].context,_,A);break;case 4:j[K].fn.call(j[K].context,_,A,D);break;default:if(!W)for(re=1,W=new Array(M-1);re<M;re++)W[re-1]=arguments[re];j[K].fn.apply(j[K].context,W)}}return!0},f.prototype.on=function(y,_,A){return l(this,y,_,A,!1)},f.prototype.once=function(y,_,A){return l(this,y,_,A,!0)},f.prototype.removeListener=function(y,_,A,D){var U=n?n+y:y;if(!this._events[U])return this;if(!_)return u(this,U),this;var L=this._events[U];if(L.fn)L.fn===_&&(!D||L.once)&&(!A||L.context===A)&&u(this,U);else{for(var k=0,j=[],M=L.length;k<M;k++)(L[k].fn!==_||D&&!L[k].once||A&&L[k].context!==A)&&j.push(L[k]);j.length?this._events[U]=j.length===1?j[0]:j:u(this,U)}return this},f.prototype.removeAllListeners=function(y){var _;return y?(_=n?n+y:y,this._events[_]&&u(this,_)):(this._events=new i,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=n,f.EventEmitter=f,e.exports=f})(vp)),vp.exports}var G_=W_();const ru=Xc(G_);var rd=typeof window<"u"&&typeof window.btoa<"u";function Un(e){let t;return rd?typeof e=="string"?t=btoa(e):t=btoa(String.fromCharCode(...Array.from(e))):typeof e=="string"?t=Buffer.from(e,"utf8").toString("base64"):t=Buffer.from(e).toString("base64"),t.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function xl(e){const t=e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(4-e.length%4)%4,"=");if(rd){const n=atob(t),i=new Uint8Array(n.length);for(let o=0;o<n.length;o++)i[o]=n.charCodeAt(o);return i}else return new Uint8Array(Buffer.from(t,"base64"))}function Y_(e){if(rd&&typeof TextEncoder<"u"){const t=new TextEncoder().encode(e);return Un(t)}else return Un(e)}var Z_=8078e3,J_=8078001,X_=8078004,Q_=8078005,eI=8078006,tI=8078011;function XE(e){return Array.isArray(e)?"%5B"+e.map(XE).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function nI([e,t]){return`${e}=${XE(t)}`}function rI(e){const t=Object.entries(e).map(nI).join("&");return btoa(t)}function iI(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${rI(t)}'`),`${n}\``}}
33var il=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,i;if(t){const{cause:l,...u}=t;l&&(i={cause:l}),Object.keys(u).length>0&&(n=u)}const o=iI(e,n);super(o,i),this.context={__code:e,...n},this.name="SolanaError"}};function sI(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function aI(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(sI(t,e));return e.write(t,n,0),n}})}function oI(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function Wo(e){return"fixedSize"in e&&typeof e.fixedSize=="number"}function lI(e,t){if(Wo(e)!==Wo(t))throw new il(X_);if(Wo(e)&&Wo(t)&&e.fixedSize!==t.fixedSize)throw new il(Q_,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!Wo(e)&&!Wo(t)&&e.maxSize!==t.maxSize)throw new il(eI,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function cI(e,t,n=0){if(t.length-n<=0)throw new il(Z_,{codecDescription:e})}function uI(e,t,n,i=0){const o=n.length-i;if(o<t)throw new il(J_,{bytesLength:o,codecDescription:e,expected:t})}function fI(e,t,n,i){if(i<t||i>n)throw new il(tI,{codecDescription:e,max:n,min:t,value:i})}function QE(e){return e?.endian!==1}function dI(e){return aI({fixedSize:e.size,write(t,n,i){e.range&&fI(e.name,e.range[0],e.range[1],t);const o=new ArrayBuffer(e.size);return e.set(new DataView(o),t,QE(e.config)),n.set(new Uint8Array(o),i),i+e.size}})}function hI(e){return oI({fixedSize:e.size,read(t,n=0){cI(e.name,t,n),uI(e.name,e.size,t,n);const i=new DataView(pI(t,n,e.size));return[e.get(i,QE(e.config)),n+e.size]}})}function pI(e,t,n){const i=e.byteOffset+(t??0),o=n??e.byteLength;return e.buffer.slice(i,i+o)}var gI=(e={})=>dI({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,i)=>t.setBigUint64(0,BigInt(n),i),size:8}),mI=(e={})=>hI({config:e,get:(t,n)=>t.getBigUint64(0,n),name:"u64",size:8}),yI=(e={})=>lI(gI(e),mI(e));const wI="6.17.0";function bv(e,t,n){for(let i in t){let o=t[i];Object.defineProperty(e,i,{enumerable:!0,value:o,writable:!1})}}function Qo(e,t){if(e==null)return"null";if(t==null&&(t=new Set),typeof e=="object"){if(t.has(e))return"[Circular]";t.add(e)}if(Array.isArray(e))return"[ "+e.map(n=>Qo(n,t)).join(", ")+" ]";if(e instanceof Uint8Array){const n="0123456789abcdef";let i="0x";for(let o=0;o<e.length;
33o++)i+=n[e[o]>>4],i+=n[e[o]&15];return i}if(typeof e=="object"&&typeof e.toJSON=="function")return Qo(e.toJSON(),t);switch(typeof e){case"boolean":case"number":case"symbol":return e.toString();case"bigint":return BigInt(e).toString();case"string":return JSON.stringify(e);case"object":{const n=Object.keys(e);return n.sort(),"{ "+n.map(i=>`${Qo(i,t)}: ${Qo(e[i],t)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function bI(e,t,n){let i=e;{const l=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${Qo(n)}`);for(const u in n){if(u==="shortMessage")continue;const f=n[u];l.push(u+"="+Qo(f))}}l.push(`code=${t}`),l.push(`version=${wI}`),l.length&&(e+=" ("+l.join(", ")+")")}let o;switch(t){case"INVALID_ARGUMENT":o=new TypeError(e);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":o=new RangeError(e);break;default:o=new Error(e)}return bv(o,{code:t}),n&&Object.assign(o,n),o.shortMessage==null&&bv(o,{shortMessage:i}),o}function qr(e,t,n,i){if(!e)throw bI(t,n,i)}function it(e,t,n,i){qr(e,t,"INVALID_ARGUMENT",{argument:n,value:i})}["NFD","NFC","NFKD","NFKC"].reduce((e,t)=>{try{if("test".normalize(t)!=="test")throw new Error("bad");if(t==="NFD"&&"é".normalize("NFD")!=="eÌ")throw new Error("broken");e.push(t)}catch{}return e},[]);function vI(e,t,n){if(e!==t){let i=n,o="new";i+=".",o+=" "+n,qr(!1,`private constructor; use ${i}from* methods`,"UNSUPPORTED_OPERATION",{operation:o})}}function e3(e,t,n){if(e instanceof Uint8Array)return n?new Uint8Array(e):e;if(typeof e=="string"&&e.length%2===0&&e.match(/^0x[0-9a-f]*$/i)){const i=new Uint8Array((e.length-2)/2);let o=2;for(let l=0;l<i.length;l++)i[l]=parseInt(e.substring(o,o+2),16),o+=2;return i}it(!1,"invalid BytesLike value",t||"value",e)}function Mn(e,t){return e3(e,t,!1)}function Ec(e,t){return e3(e,t,!0)}function Sa(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||typeof t=="number"&&e.length!==2+2*t||t===!0&&e.length%2!==0)}function xI(e){return Sa(e,!0)||e instanceof Uint8Array}const vv="0123456789abcdef";function qt(e){const t=Mn(e);let n="0x";for(let i=0;i<t.length;i++){const o=t[i];n+=vv[(o&240)>>4]+vv[o&15]}return n}function Xi(e){return"0x"+e.map(t=>qt(t).substring(2)).join("")}function Nc(e){return Sa(e,!0)?(e.length-2)/2:Mn(e).length}function EI(e,t,n){const i=Mn(e);qr(t>=i.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(i),length:t,offset:t+1});const o=new Uint8Array(t);return o.fill(0),o.set(i,t-i.length),qt(o)}function io(e,t){return EI(e,t)}const f1=BigInt(0);BigInt(1);const el=9007199254740991;function Ar(e,t){switch(typeof e){case"bigint":return e;case"number":return it(Number.isInteger(e),"underflow",t||"value",e),it(e>=-el&&e<=el,"overflow",t||"value",e),BigInt(e);case"string":try{if(e==="")throw new Error("empty string");return e[0]==="-"&&e[1]!=="-"?-BigInt(e.substring(1)):BigInt(e)}catch(n){it(!1,`invalid BigNumberish string: ${n.message}`,t||"value",e)}}it(!1,"invalid BigNumberish value",t||"value",e)}function t3(e,t){const n=Ar(e,t);return qr(n>=f1,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:e}),n}function ba(e,t){switch(typeof e){case"bigint":return it(e>=-el&&e<=el,"overflow",t||"value",e),Number(e);case"number":return it(Number.isInteger(e),"underflow",t||"value",e),it(e>=-el&&e<=el,"overflow",t||"value",e),e;case"string":try{if(e==="")throw new Error("empty string");return ba(BigInt(e),t)}catch(n){it(!1,`invalid numeric string: ${n.message}`,t||"value",e)}}it(!1,"invalid numeric value",t||"value",e)}function xv(e,t){const n=t3(e,"value");let i=n.toString(16);{const o=ba(t,"width");if(o===0&&n===f1)return"0x";for(qr(o*2>=i.length,`value exceeds width (${o} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:e});i.length<o*2;)i="0"+i}return"0x"+i}function _r(e,t){const n=t3(e,"value");if(n===f1)return new Uint8Array(0);let i=n.toString(16);i.length%2&&(i="0"+i);const o=new Uint8Array(i.length/2);for(let l=0;l<o.length;l++){const u=l*2;o[l]=parseInt(i.substring(u,u+2),16)}return o}function SI(e){let t=e.toString(16);for(;t.length<2;)t="0"+t;return"0x"+t}function Ev(e,t,n){let i=0;for(let o=0;o<n;o++)i=i*256+e[t+o];return i}function Sv(e,t,n,i){const o=[];for(;n<t+1+i;){const l=n3(e,n);o.push(l.result),n+=l.consumed,qr(n<=t+1+i,"child data too short","BUFFER_OVERRUN",{buffer:e,length:i,offset:t})}return{consumed:1+i,result:o}}function n3(e,t){qr(e.length!==0,"data too short","BUFFER_OVERRUN",{buffer:e,length:0,offset:1});const n=i=>{qr(i<=e.length,"data short segment too short","BUFFER_OVERRUN",{buffer:e,length:e.length,offset:i})};if(e[t]>=248){const i=e[t]-247;n(t+1+i);const o=Ev(e,t+1,i);return n(t+1+i+o),Sv(e,t,t+1+i,i+o)}else if(e[t]>=192){const i=e[t]-192;return n(t+1+i),Sv(e,t,t+1,i)}else if(e[t]>=184){const i=e[t]-183;n(t+1+i);const o=Ev(e,t+1,i);n(t+1+i+o);const l=qt(e.slice(t+1+i,t+1+i+o));return{consumed:1+i+o,result:l}}else if(e[t]>=128){const i=e[t]-128;n(t+1+i);const o=qt(e.slice(t+1,t+1+i));return{consumed:1+i,result:o}}return{consumed:1,result:SI(e[t])}}function iu(e){const t=Mn(e,"data"),n=n3(t,0);return it(n.consumed===t.length,"unexpected junk after rlp payload","data",e),n.result}function Av(e){const t=[];for(;e;)t.unshift(e&255),e>>=8;return t}function r3(e){if(Array.isArray(e)){let i=[];if(e.forEach(function(l){i=i.concat(r3(l))}),i.length<=55)return i.unshift(192+i.length),i;const o=Av(i.length);return o.unshift(247+o.length),o.concat(i)}const t=Array.prototype.slice.call(Mn(e,"object"));if(t.length===1&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const n=Av(t.length);return n.unshift(183+n.length),n.concat(t)}const _v="0123456789abcdef";function va(e){let t="0x";for(const n of r3(e))t+=_v[n>>4],t+=_v[n&15];return t}function id(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function d1(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function AI(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");id(e.outputLen),id(e.blockLen)}function ul(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 i3(e,t){d1(e);const n=t.outputLen;if(e.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const xp=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;const s3=e=>e instanceof Uint8Array,_I=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),Ep=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Gi=(e,t)=>e<<32-t|e>>>t,II=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!II)throw new Error("Non little-endian hardware is not supported");function TI(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Cd(e){if(typeof e=="string"&&(e=TI(e)),!s3(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function RI(...e){const t=new Uint8Array(e.reduce((i,o)=>i+o.length,0));let n=0;return e.forEach(i=>
vendor: 7,370 bytes, line 33
33{if(!s3(i))throw new Error("Uint8Array expected");t.set(i,n),n+=i.length}),t}let h1=class{clone(){return this._cloneInto()}};function p1(e){const t=i=>e().update(Cd(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function CI(e=32){if(xp&&typeof xp.getRandomValues=="function")return xp.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}let a3=class extends h1{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,AI(t);const i=Cd(n);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;const o=this.blockLen,l=new Uint8Array(o);l.set(i.length>o?t.create().update(i).digest():i);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=t.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),l.fill(0)}update(t){return ul(this),this.iHash.update(t),this}digestInto(t){ul(this),d1(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:o,destroyed:l,blockLen:u,outputLen:f}=this;return t=t,t.finished=o,t.destroyed=l,t.blockLen=u,t.outputLen=f,t.oHash=n._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const o3=(e,t,n)=>new a3(e,t).update(n).digest();o3.create=(e,t)=>new a3(e,t);function MI(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const o=BigInt(32),l=BigInt(4294967295),u=Number(n>>o&l),f=Number(n&l),h=i?4:0,y=i?0:4;e.setUint32(t+h,u,i),e.setUint32(t+y,f,i)}class l3 extends h1{constructor(t,n,i,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=Ep(this.buffer)}update(t){ul(this);const{view:n,buffer:i,blockLen:o}=this;t=Cd(t);const l=t.length;for(let u=0;u<l;){const f=Math.min(o-this.pos,l-u);if(f===o){const h=Ep(t);for(;o<=l-u;u+=o)this.process(h,u);continue}i.set(t.subarray(u,u+f),this.pos),this.pos+=f,u+=f,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){ul(this),i3(t,this),this.finished=!0;const{buffer:n,view:i,blockLen:o,isLE:l}=this;let{pos:u}=this;n[u++]=128,this.buffer.subarray(u).fill(0),this.padOffset>o-u&&(this.process(i,0),u=0);for(let A=u;A<o;A++)n[A]=0;MI(i,o-8,BigInt(this.length*8),l),this.process(i,0);const f=Ep(t),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const y=h/4,_=this.get();if(y>_.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<y;A++)f.setUint32(4*A,_[A],l)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:i,length:o,finished:l,destroyed:u,pos:f}=this;return t.length=o,t.pos=f,t.finished=l,t.destroyed=u,o%n&&t.buffer.set(i),t}}const BI=(e,t,n)=>e&t^~e&n,DI=(e,t,n)=>e&t^e&n^t&n,OI=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ra=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ia=new Uint32Array(64);let NI=class extends l3{constructor(){super(64,32,8,!1),this.A=ra[0]|0,this.B=ra[1]|0,this.C=ra[2]|0,this.D=ra[3]|0,this.E=ra[4]|0,this.F=ra[5]|0,this.G=ra[6]|0,this.H=ra[7]|0}get(){const{A:t,B:n,C:i,D:o,E:l,F:u,G:f,H:h}=this;return[t,n,i,o,l,u,f,h]}set(t,n,i,o,l,u,f,h){this.A=t|0,this.B=n|0,this.C=i|0,this.D=o|0,this.E=l|0,this.F=u|0,this.G=f|0,this.H=h|0}process(t,n){for(let A=0;A<16;A++,n+=4)ia[A]=t.getUint32(n,!1);for(let A=16;A<64;A++){const D=ia[A-15],U=ia[A-2],L=Gi(D,7)^Gi(D,18)^D>>>3,k=Gi(U,17)^Gi(U,19)^U>>>10;ia[A]=k+ia[A-7]+L+ia[A-16]|0}let{A:i,B:o,C:l,D:u,E:f,F:h,G:y,H:_}=this;for(let A=0;A<64;A++){const D=Gi(f,6)^Gi(f,11)^Gi(f,25),U=_+D+BI(f,h,y)+OI[A]+ia[A]|0,k=(Gi(i,2)^Gi(i,13)^Gi(i,22))+DI(i,o,l)|0;_=y,y=h,h=f,f=u+U|0,u=l,l=o,o=i,i=U+k|0}i=i+this.A|0,o=o+this.B|0,l=l+this.C|0,u=u+this.D|0,f=f+this.E|0,h=h+this.F|0,y=y+this.G|0,_=_+this.H|0,this.set(i,o,l,u,f,h,y,_)}roundClean(){ia.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const c3=p1(()=>new NI),Tf=BigInt(2**32-1),Rg=BigInt(32);function u3(e,t=!1){return t?{h:Number(e&Tf),l:Number(e>>Rg&Tf)}:{h:Number(e>>Rg&Tf)|0,l:Number(e&Tf)|0}}function f3(e,t=!1){let n=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let o=0;o<e.length;o++){const{h:l,l:u}=u3(e[o],t);[n[o],i[o]]=[l,u]}return[n,i]}const kI=(e,t)=>BigInt(e>>>0)<<Rg|BigInt(t>>>0),UI=(e,t,n)=>e>>>n,jI=(e,t,n)=>e<<32-n|t>>>n,LI=(e,t,n)=>e>>>n|t<<32-n,zI=(e,t,n)=>e<<32-n|t>>>n,PI=(e,t,n)=>e<<64-n|t>>>n-32,HI=(e,t,n)=>e>>>n-32|t<<64-n,VI=(e,t)=>t,FI=(e,t)=>e,d3=(e,t,n)=>e<<n|t>>>32-n,h3=(e,t,n)=>t<<n|e>>>32-n,p3=(e,t,n)=>t<<n-32|e>>>64-n,g3=(e,t,n)=>e<<n-32|t>>>64-n;function KI(e,t,n,i){const o=(t>>>0)+(i>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const qI=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),$I=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,WI=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),GI=(e,t,n,i,o)=>t+n+i+o+(e/2**32|0)|0,YI=(e,t,n,i,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(o>>>0),ZI=(e,t,n,i,o,l)=>t+n+i+o+l+(e/2**32|0)|0,Kt={fromBig:u3,split:f3,toBig:kI,shrSH:UI,shrSL:jI,rotrSH:LI,rotrSL:zI,rotrBH:PI,rotrBL:HI,rotr32H:VI,rotr32L:FI,rotlSH:d3,rotlSL:h3,rotlBH:p3,rotlBL:g3,add:KI,add3L:qI,add3H:$I,add4L:WI,add4H:GI,add5H:ZI,add5L:YI},[JI,XI]=Kt.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
335771202a","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))),sa=new Uint32Array(80),aa=new Uint32Array(80);let QI=class extends l3{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:n,Bh:i,Bl:o,Ch:l,Cl:u,Dh:f,Dl:h,Eh:y,El:_,Fh:A,Fl:D,Gh:U,Gl:L,Hh:k,Hl:j}=this;return[t,n,i,o,l,u,f,h,y,_,A,D,U,L,k,j]}set(t,n,i,o,l,u,f,h,y,_,A,D,U,L,k,j){this.Ah=t|0,this.Al=n|0,this.Bh=i|0,this.Bl=o|0,this.Ch=l|0,this.Cl=u|0,this.Dh=f|0,this.Dl=h|0,this.Eh=y|0,this.El=_|0,this.Fh=A|0,this.Fl=D|0,this.Gh=U|0,this.Gl=L|0,this.Hh=k|0,this.Hl=j|0}process(t,n){for(let K=0;K<16;K++,n+=4)sa[K]=t.getUint32(n),aa[K]=t.getUint32(n+=4);for(let K=16;K<80;K++){const se=sa[K-15]|0,re=aa[K-15]|0,te=Kt.rotrSH(se,re,1)^Kt.rotrSH(se,re,8)^Kt.shrSH(se,re,7),pe=Kt.rotrSL(se,re,1)^Kt.rotrSL(se,re,8)^Kt.shrSL(se,re,7),we=sa[K-2]|0,X=aa[K-2]|0,Z=Kt.rotrSH(we,X,19)^Kt.rotrBH(we,X,61)^Kt.shrSH(we,X,6),ae=Kt.rotrSL(we,X,19)^Kt.rotrBL(we,X,61)^Kt.shrSL(we,X,6),ce=Kt.add4L(pe,ae,aa[K-7],aa[K-16]),N=Kt.add4H(ce,te,Z,sa[K-7],sa[K-16]);sa[K]=N|0,aa[K]=ce|0}let{Ah:i,Al:o,Bh:l,Bl:u,Ch:f,Cl:h,Dh:y,Dl:_,Eh:A,El:D,Fh:U,Fl:L,Gh:k,Gl:j,Hh:M,Hl:W}=this;for(let K=0;K<80;K++){const se=Kt.rotrSH(A,D,14)^Kt.rotrSH(A,D,18)^Kt.rotrBH(A,D,41),re=Kt.rotrSL(A,D,14)^Kt.rotrSL(A,D,18)^Kt.rotrBL(A,D,41),te=A&U^~A&k,pe=D&L^~D&j,we=Kt.add5L(W,re,pe,XI[K],aa[K]),X=Kt.add5H(we,M,se,te,JI[K],sa[K]),Z=we|0,ae=Kt.rotrSH(i,o,28)^Kt.rotrBH(i,o,34)^Kt.rotrBH(i,o,39),ce=Kt.rotrSL(i,o,28)^Kt.rotrBL(i,o,34)^Kt.rotrBL(i,o,39),N=i&l^i&f^l&f,g=o&u^o&h^u&h;M=k|0,W=j|0,k=U|0,j=L|0,U=A|0,L=D|0,{h:A,l:D}=Kt.add(y|0,_|0,X|0,Z|0),y=f|0,_=h|0,f=l|0,h=u|0,l=i|0,u=o|0;const v=Kt.add3L(Z,ce,g);i=Kt.add3H(v,X,ae,N),o=v|0}({h:i,l:o}=Kt.add(this.Ah|0,this.Al|0,i|0,o|0)),{h:l,l:u}=Kt.add(this.Bh|0,this.Bl|0,l|0,u|0),{h:f,l:h}=Kt.add(this.Ch|0,this.Cl|0,f|0,h|0),{h:y,l:_}=Kt.add(this.Dh|0,this.Dl|0,y|0,_|0),{h:A,l:D}=Kt.add(this.Eh|0,this.El|0,A|0,D|0),{h:U,l:L}=Kt.add(this.Fh|0,this.Fl|0,U|0,L|0),{h:k,l:j}=Kt.add(this.Gh|0,this.Gl|0,k|0,j|0),{h:M,l:W}=Kt.add(this.Hh|0,this.Hl|0,M|0,W|0),this.set(i,o,l,u,f,h,y,_,A,D,U,L,k,j,M,W)}roundClean(){sa.fill(0),aa.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const eT=p1(()=>new QI);function tT(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const Iv=tT();Iv.crypto||Iv.msCrypto;function nT(e){switch(e){case"sha256":return c3.create();case"sha512":return eT.create()}it(!1,"invalid hashing algorithm name","algorithm",e)}const[m3,y3,w3]=[[],[],[]],rT=BigInt(0),Sc=BigInt(1),iT=BigInt(2),sT=BigInt(7),aT=BigInt(256),oT=BigInt(113);for(let e=0,t=Sc,n=1,i=0;e<24;e++){[n,i]=[i,(2*n+3*i)%5],m3.push(2*(5*i+n)),y3.push((e+1)*(e+2)/2%64);let o=rT;for(let l=0;l<7;l++)t=(t<<Sc^(t>>sT)*oT)%aT,t&iT&&(o^=Sc<<(Sc<<BigInt(l))-Sc);w3.push(o)}const[lT,cT]=f3(w3,!0),Tv=(e,t,n)=>n>32?p3(e,t,n):d3(e,t,n),Rv=(e,t,n)=>n>32?g3(e,t,n):h3(e,t,n);function uT(e,t=24){const n=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let u=0;u<10;u++)n[u]=e[u]^e[u+10]^e[u+20]^e[u+30]^e[u+40];for(let u=0;u<10;u+=2){const f=(u+8)%10,h=(u+2)%10,y=n[h],_=n[h+1],A=Tv(y,_,1)^n[f],D=Rv(y,_,1)^n[f+1];for(let U=0;U<50;U+=10)e[u+U]^=A,e[u+U+1]^=D}let o=e[2],l=e[3];for(let u=0;u<24;u++){const f=y3[u],h=Tv(o,l,f),y=Rv(o,l,f),_=m3[u];o=e[_],l=e[_+1],e[_]=h,e[_+1]=y}for(let u=0;u<50;u+=10){for(let f=0;f<10;f++)n[f]=e[u+f];for(let f=0;f<10;f++)e[u+f]^=~n[(f+2)%10]&n[(f+4)%10]}e[0]^=lT[i],e[1]^=cT[i]}n.fill(0)}class g1 extends h1{constructor(t,n,i,o=!1,l=24){if(super(),this.blockLen=t,this.suffix=n,this.outputLen=i,this.enableXOF=o,this.rounds=l,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,id(i),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=_I(this.state)}keccak(){uT(this.state32,this.rounds),this.posOut=0,this.pos=0}update(t){ul(this);const{blockLen:n,state:i}=this;t=Cd(t);const o=t.length;for(let l=0;l<o;){const u=Math.min(n-this.pos,o-l);for(let f=0;f<u;
33f++)i[this.pos++]^=t[l++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:i,blockLen:o}=this;t[i]^=n,(n&128)!==0&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){ul(this,!1),d1(t),this.finish();const n=this.state,{blockLen:i}=this;for(let o=0,l=t.length;o<l;){this.posOut>=i&&this.keccak();const u=Math.min(i-this.posOut,l-o);t.set(n.subarray(this.posOut,this.posOut+u),o),this.posOut+=u,o+=u}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return id(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(i3(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,this.state.fill(0)}_cloneInto(t){const{blockLen:n,suffix:i,outputLen:o,rounds:l,enableXOF:u}=this;return t||(t=new g1(n,i,o,u,l)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=l,t.suffix=i,t.outputLen=o,t.enableXOF=u,t.destroyed=this.destroyed,t}}const fT=(e,t,n)=>p1(()=>new g1(t,e,n)),dT=fT(1,136,256/8);let b3=!1;const v3=function(e){return dT(e)};let x3=v3;function Aa(e){const t=Mn(e,"data");return qt(x3(t))}Aa._=v3;Aa.lock=function(){b3=!0};Aa.register=function(e){if(b3)throw new TypeError("keccak256 is locked");x3=e};Object.freeze(Aa);const E3=function(e){return nT("sha256").update(e).digest()};let S3=E3,A3=!1;function El(e){const t=Mn(e,"data");return qt(S3(t))}El._=E3;El.lock=function(){A3=!0};El.register=function(e){if(A3)throw new Error("sha256 is locked");S3=e};Object.freeze(El);Object.freeze(El);BigInt(0);const hT=BigInt(1),pT=BigInt(2),Md=e=>e instanceof Uint8Array,gT=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fl(e){if(!Md(e))throw new Error("Uint8Array expected");let t="";for(let n=0;n<e.length;n++)t+=gT[e[n]];return t}function m1(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return BigInt(e===""?"0":`0x${e}`)}function Hc(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(t/2);for(let i=0;i<n.length;i++){const o=i*2,l=e.slice(o,o+2),u=Number.parseInt(l,16);if(Number.isNaN(u)||u<0)throw new Error("Invalid byte sequence");n[i]=u}return n}function Xa(e){return m1(fl(e))}function y1(e){if(!Md(e))throw new Error("Uint8Array expected");return m1(fl(Uint8Array.from(e).reverse()))}function dl(e,t){return Hc(e.toString(16).padStart(t*2,"0"))}function w1(e,t){return dl(e,t).reverse()}function zi(e,t,n){let i;if(typeof t=="string")try{i=Hc(t)}catch(l){throw new Error(`${e} must be valid hex string, got "${t}". Cause: ${l}`)}else if(Md(t))i=Uint8Array.from(t);else throw new Error(`${e} must be hex string or Uint8Array`);const o=i.length;if(typeof n=="number"&&o!==n)throw new Error(`${e} expected ${n} bytes, got ${o}`);return i}function Vc(...e){const t=new Uint8Array(e.reduce((i,o)=>i+o.length,0));let n=0;return e.forEach(i=>{if(!Md(i))throw new Error("Uint8Array expected");t.set(i,n),n+=i.length}),t}const b1=e=>(pT<<BigInt(e-1))-hT,Sp=e=>new Uint8Array(e),Cv=e=>Uint8Array.from(e);function _3(e,t,n){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 n!="function")throw new Error("hmacFn must be a function");let i=Sp(e),o=Sp(e),l=0;const u=()=>{i.fill(1),o.fill(0),l=0},f=(...A)=>n(o,i,...A),h=(A=Sp())=>{o=f(Cv([0]),A),i=f(),A.length!==0&&(o=f(Cv([1]),A),i=f())},y=()=>{if(l++>=1e3)throw new Error("drbg: tried 1000 values");let A=0;const D=[];for(;A<t;){i=f();const U=i.slice();D.push(U),A+=i.length}return Vc(...D)};return(A,D)=>{u(),h(A);let U;for(;!(U=D(y()));)h();return u(),U}}const mT={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"||e instanceof Uint8Array,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 su(e,t,n={}){const i=(o,l,u)=>{const f=mT[l];if(typeof f!="function")throw new Error(`Invalid validator "${l}", expected function`);const h=e[o];if(!(u&&h===void 0)&&!f(h,e))throw new Error(`Invalid param ${String(o)}=${h} (${typeof h}), expected ${l}`)};for(const[o,l]of Object.entries(t))i(o,l,!1);for(const[o,l]of Object.entries(n))i(o,l,!0);return e}const yT=Object.freeze(Object.defineProperty({__proto__:null,bitMask:b1,bytesToHex:fl,bytesToNumberBE:Xa,bytesToNumberLE:y1,
vendor: 4,766 bytes, line 33
33concatBytes:Vc,createHmacDrbg:_3,ensureBytes:zi,hexToBytes:Hc,hexToNumber:m1,numberToBytesBE:dl,numberToBytesLE:w1,validateObject:su},Symbol.toStringTag,{value:"Module"}));const yr=BigInt(0),nr=BigInt(1),Ka=BigInt(2),wT=BigInt(3),Cg=BigInt(4),Mv=BigInt(5),Bv=BigInt(8);BigInt(9);BigInt(16);function ni(e,t){const n=e%t;return n>=yr?n:t+n}function bT(e,t,n){if(n<=yr||t<yr)throw new Error("Expected power/modulo > 0");if(n===nr)return yr;let i=nr;for(;t>yr;)t&nr&&(i=i*e%n),e=e*e%n,t>>=nr;return i}function Ii(e,t,n){let i=e;for(;t-- >yr;)i*=i,i%=n;return i}function Mg(e,t){if(e===yr||t<=yr)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=ni(e,t),i=t,o=yr,l=nr;for(;n!==yr;){const f=i/n,h=i%n,y=o-l*f;i=n,n=h,o=l,l=y}if(i!==nr)throw new Error("invert: does not exist");return ni(o,t)}function vT(e){const t=(e-nr)/Ka;let n,i,o;for(n=e-nr,i=0;n%Ka===yr;n/=Ka,i++);for(o=Ka;o<e&&bT(o,t,e)!==e-nr;o++);if(i===1){const u=(e+nr)/Cg;return function(h,y){const _=h.pow(y,u);if(!h.eql(h.sqr(_),y))throw new Error("Cannot find square root");return _}}const l=(n+nr)/Ka;return function(f,h){if(f.pow(h,t)===f.neg(f.ONE))throw new Error("Cannot find square root");let y=i,_=f.pow(f.mul(f.ONE,o),n),A=f.pow(h,l),D=f.pow(h,n);for(;!f.eql(D,f.ONE);){if(f.eql(D,f.ZERO))return f.ZERO;let U=1;for(let k=f.sqr(D);U<y&&!f.eql(k,f.ONE);U++)k=f.sqr(k);const L=f.pow(_,nr<<BigInt(y-U-1));_=f.sqr(L),A=f.mul(A,L),D=f.mul(D,_),y=U}return A}}function xT(e){if(e%Cg===wT){const t=(e+nr)/Cg;return function(i,o){const l=i.pow(o,t);if(!i.eql(i.sqr(l),o))throw new Error("Cannot find square root");return l}}if(e%Bv===Mv){const t=(e-Mv)/Bv;return function(i,o){const l=i.mul(o,Ka),u=i.pow(l,t),f=i.mul(o,u),h=i.mul(i.mul(f,Ka),u),y=i.mul(f,i.sub(h,i.ONE));if(!i.eql(i.sqr(y),o))throw new Error("Cannot find square root");return y}}return vT(e)}const ET=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ST(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=ET.reduce((i,o)=>(i[o]="function",i),t);return su(e,n)}function AT(e,t,n){if(n<yr)throw new Error("Expected power > 0");if(n===yr)return e.ONE;if(n===nr)return t;let i=e.ONE,o=t;for(;n>yr;)n&nr&&(i=e.mul(i,o)),o=e.sqr(o),n>>=nr;return i}function _T(e,t){const n=new Array(t.length),i=t.reduce((l,u,f)=>e.is0(u)?l:(n[f]=l,e.mul(l,u)),e.ONE),o=e.inv(i);return t.reduceRight((l,u,f)=>e.is0(u)?l:(n[f]=e.mul(l,n[f]),e.mul(l,u)),o),n}function I3(e,t){const n=t!==void 0?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function IT(e,t,n=!1,i={}){if(e<=yr)throw new Error(`Expected Field ORDER > 0, got ${e}`);const{nBitLength:o,nByteLength:l}=I3(e,t);if(l>2048)throw new Error("Field lengths over 2048 bytes are not supported");const u=xT(e),f=Object.freeze({ORDER:e,BITS:o,BYTES:l,MASK:b1(o),ZERO:yr,ONE:nr,create:h=>ni(h,e),isValid:h=>{if(typeof h!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof h}`);return yr<=h&&h<e},is0:h=>h===yr,isOdd:h=>(h&nr)===nr,neg:h=>ni(-h,e),eql:(h,y)=>h===y,sqr:h=>ni(h*h,e),add:(h,y)=>ni(h+y,e),sub:(h,y)=>ni(h-y,e),mul:(h,y)=>ni(h*y,e),pow:(h,y)=>AT(f,h,y),div:(h,y)=>ni(h*Mg(y,e),e),sqrN:h=>h*h,addN:(h,y)=>h+y,subN:(h,y)=>h-y,mulN:(h,y)=>h*y,inv:h=>Mg(h,e),sqrt:i.sqrt||(h=>u(f,h)),invertBatch:h=>_T(f,h),cmov:(h,y,_)=>_?y:h,toBytes:h=>n?w1(h,l):dl(h,l),fromBytes:h=>{if(h.length!==l)throw new Error(`Fp.fromBytes: expected ${l}, got ${h.length}`);return n?y1(h):Xa(h)}});return Object.freeze(f)}function T3(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function R3(e){const t=T3(e);return t+Math.ceil(t/2)}function TT(e,t,n=!1){const i=e.length,o=T3(t),l=R3(t);if(i<16||i<l||i>1024)throw new Error(`expected ${l}-1024 bytes of input, got ${i}`);const u=n?Xa(e):y1(e),f=ni(u,t-nr)+nr;return n?w1(f,o):dl(f,o)}const RT=BigInt(0),Ap=BigInt(1);function CT(e,t){const n=(o,l)=>{const u=l.negate();return o?u:l},i=o=>{const l=Math.ceil(t/o)+1,u=2**(o-1);return{windows:l,windowSize:u}};return{constTimeNegate:n,unsafeLadder(o,l){let u=e.ZERO,f=o;for(;l>RT;)l&Ap&&(u=u.add(f)),f=f.double(),l>>=Ap;return u},precomputeWindow(o,l){const{windows:u,windowSize:f}=i(l),h=[];let y=o,_=y;for(let A=0;A<u;A++){_=y,h.push(_);for(let D=1;D<f;D++)_=_.add(y),h.push(_);y=_.double()}return h},wNAF(o,l,u){const{windows:f,windowSize:h}=i(o);let y=e.ZERO,_=e.BASE;const A=BigInt(2**o-1),D=2**o,U=BigInt(o);for(let L=0;L<f;L++){const k=L*h;let j=Number(u&A);u>>=U,j>h&&(j-=D,u+=Ap);const M=k,W=k+Math.abs(j)-1,K=L%2!==0,se=j<0;j===0?_=_.add(n(K,l[M])):y=y.add(n(se,l[W]))}return{p:y,f:_}},wNAFCached(o,l,u,f){const h=o._WINDOW_SIZE||1;let y=l.get(o);
33return y||(y=this.precomputeWindow(o,h),h!==1&&l.set(o,f(y))),this.wNAF(h,y,u)}}}function C3(e){return ST(e.Fp),su(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...I3(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function MT(e){const t=C3(e);su(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:i,a:o}=t;if(n){if(!i.eql(o,i.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}const{bytesToNumberBE:BT,hexToBytes:DT}=yT,Wa={Err:class extends Error{constructor(t=""){super(t)}},_parseInt(e){const{Err:t}=Wa;if(e.length<2||e[0]!==2)throw new t("Invalid signature integer tag");const n=e[1],i=e.subarray(2,n+2);if(!n||i.length!==n)throw new t("Invalid signature integer: wrong length");if(i[0]&128)throw new t("Invalid signature integer: negative");if(i[0]===0&&!(i[1]&128))throw new t("Invalid signature integer: unnecessary leading zero");return{d:BT(i),l:e.subarray(n+2)}},toSig(e){const{Err:t}=Wa,n=typeof e=="string"?DT(e):e;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let i=n.length;if(i<2||n[0]!=48)throw new t("Invalid signature tag");if(n[1]!==i-2)throw new t("Invalid signature: incorrect length");const{d:o,l}=Wa._parseInt(n.subarray(2)),{d:u,l:f}=Wa._parseInt(l);if(f.length)throw new t("Invalid signature: left bytes after parsing");return{r:o,s:u}},hexFromSig(e){const t=y=>Number.parseInt(y[0],16)&8?"00"+y:y,n=y=>{const _=y.toString(16);return _.length&1?`0${_}`:_},i=t(n(e.s)),o=t(n(e.r)),l=i.length/2,u=o.length/2,f=n(l),h=n(u);return`30${n(u+l+4)}02${h}${o}02${f}${i}`}},As=BigInt(0),Ri=BigInt(1);BigInt(2);const Dv=BigInt(3);BigInt(4);function OT(e){const t=MT(e),{Fp:n}=t,i=t.toBytes||((L,k,j)=>{const M=k.toAffine();return Vc(Uint8Array.from([4]),n.toBytes(M.x),n.toBytes(M.y))}),o=t.fromBytes||(L=>{const k=L.subarray(1),j=n.fromBytes(k.subarray(0,n.BYTES)),M=n.fromBytes(k.subarray(n.BYTES,2*n.BYTES));return{x:j,y:M}});function l(L){const{a:k,b:j}=t,M=n.sqr(L),W=n.mul(M,L);return n.add(n.add(W,n.mul(L,k)),j)}if(!n.eql(n.sqr(t.Gy),l(t.Gx)))throw new Error("bad generator point: equation left != right");function u(L){return typeof L=="bigint"&&As<L&&L<t.n}function f(L){if(!u(L))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function h(L){const{allowedPrivateKeyLengths:k,nByteLength:j,wrapPrivateKey:M,n:W}=t;if(k&&typeof L!="bigint"){if(L instanceof Uint8Array&&(L=fl(L)),typeof L!="string"||!k.includes(L.length))throw new Error("Invalid key");L=L.padStart(j*2,"0")}let K;try{K=typeof L=="bigint"?L:Xa(zi("private key",L,j))}catch{throw new Error(`private key must be ${j} bytes, hex or bigint, not ${typeof L}`)}return M&&(K=ni(K,W)),f(K),K}const y=new Map;function _(L){if(!(L instanceof A))throw new Error("ProjectivePoint expected")}class A{constructor(k,j,M){if(this.px=k,this.py=j,this.pz=M,k==null||!n.isValid(k))throw new Error("x required");if(j==null||!n.isValid(j))throw new Error("y required");if(M==null||!n.isValid(M))throw new Error("z required")}static fromAffine(k){const{x:j,y:M}=k||{};if(!k||!n.isValid(j)||!n.isValid(M))throw new Error("invalid affine point");if(k instanceof A)throw new Error("projective point not allowed");const W=K=>n.eql(K,n.ZERO);return W(j)&&W(M)?A.ZERO:new A(j,M,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(k){const j=n.invertBatch(k.map(M=>M.pz));return k.map((M,W)=>M.toAffine(j[W])).map(A.fromAffine)}static fromHex(k){const j=A.fromAffine(o(zi("pointHex",k)));return j.assertValidity(),j}static fromPrivateKey(k){return A.BASE.multiply(h(k))}_setWindowSize(k){this._WINDOW_SIZE=k,y.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:k,y:j}=this.toAffine();if(!n.isValid(k)||!n.isValid(j))throw new Error("bad point: x or y not FE");const M=n.sqr(j),W=l(k);if(!n.eql(M,W))throw new Error("bad point: equation left != right");
33if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:k}=this.toAffine();if(n.isOdd)return!n.isOdd(k);throw new Error("Field doesn't support isOdd")}equals(k){_(k);const{px:j,py:M,pz:W}=this,{px:K,py:se,pz:re}=k,te=n.eql(n.mul(j,re),n.mul(K,W)),pe=n.eql(n.mul(M,re),n.mul(se,W));return te&&pe}negate(){return new A(this.px,n.neg(this.py),this.pz)}double(){const{a:k,b:j}=t,M=n.mul(j,Dv),{px:W,py:K,pz:se}=this;let re=n.ZERO,te=n.ZERO,pe=n.ZERO,we=n.mul(W,W),X=n.mul(K,K),Z=n.mul(se,se),ae=n.mul(W,K);return ae=n.add(ae,ae),pe=n.mul(W,se),pe=n.add(pe,pe),re=n.mul(k,pe),te=n.mul(M,Z),te=n.add(re,te),re=n.sub(X,te),te=n.add(X,te),te=n.mul(re,te),re=n.mul(ae,re),pe=n.mul(M,pe),Z=n.mul(k,Z),ae=n.sub(we,Z),ae=n.mul(k,ae),ae=n.add(ae,pe),pe=n.add(we,we),we=n.add(pe,we),we=n.add(we,Z),we=n.mul(we,ae),te=n.add(te,we),Z=n.mul(K,se),Z=n.add(Z,Z),we=n.mul(Z,ae),re=n.sub(re,we),pe=n.mul(Z,X),pe=n.add(pe,pe),pe=n.add(pe,pe),new A(re,te,pe)}add(k){_(k);const{px:j,py:M,pz:W}=this,{px:K,py:se,pz:re}=k;let te=n.ZERO,pe=n.ZERO,we=n.ZERO;const X=t.a,Z=n.mul(t.b,Dv);let ae=n.mul(j,K),ce=n.mul(M,se),N=n.mul(W,re),g=n.add(j,M),v=n.add(K,se);g=n.mul(g,v),v=n.add(ae,ce),g=n.sub(g,v),v=n.add(j,W);let E=n.add(K,re);return v=n.mul(v,E),E=n.add(ae,N),v=n.sub(v,E),E=n.add(M,W),te=n.add(se,re),E=n.mul(E,te),te=n.add(ce,N),E=n.sub(E,te),we=n.mul(X,v),te=n.mul(Z,N),we=n.add(te,we),te=n.sub(ce,we),we=n.add(ce,we),pe=n.mul(te,we),ce=n.add(ae,ae),ce=n.add(ce,ae),N=n.mul(X,N),v=n.mul(Z,v),ce=n.add(ce,N),N=n.sub(ae,N),N=n.mul(X,N),v=n.add(v,N),ae=n.mul(ce,v),pe=n.add(pe,ae),ae=n.mul(E,v),te=n.mul(g,te),te=n.sub(te,ae),ae=n.mul(g,ce),we=n.mul(E,we),we=n.add(we,ae),new A(te,pe,we)}subtract(k){return this.add(k.negate())}is0(){return this.equals(A.ZERO)}wNAF(k){return U.wNAFCached(this,y,k,j=>{const M=n.invertBatch(j.map(W=>W.pz));return j.map((W,K)=>W.toAffine(M[K])).map(A.fromAffine)})}multiplyUnsafe(k){const j=A.ZERO;if(k===As)return j;if(f(k),k===Ri)return this;const{endo:M}=t;if(!M)return U.unsafeLadder(this,k);let{k1neg:W,k1:K,k2neg:se,k2:re}=M.splitScalar(k),te=j,pe=j,we=this;for(;K>As||re>As;)K&Ri&&(te=te.add(we)),re&Ri&&(pe=pe.add(we)),we=we.double(),K>>=Ri,re>>=Ri;return W&&(te=te.negate()),se&&(pe=pe.negate()),pe=new A(n.mul(pe.px,M.beta),pe.py,pe.pz),te.add(pe)}multiply(k){f(k);let j=k,M,W;const{endo:K}=t;if(K){const{k1neg:se,k1:re,k2neg:te,k2:pe}=K.splitScalar(j);let{p:we,f:X}=this.wNAF(re),{p:Z,f:ae}=this.wNAF(pe);we=U.constTimeNegate(se,we),Z=U.constTimeNegate(te,Z),Z=new A(n.mul(Z.px,K.beta),Z.py,Z.pz),M=we.add(Z),W=X.add(ae)}else{const{p:se,f:re}=this.wNAF(j);M=se,W=re}return A.normalizeZ([M,W])[0]}multiplyAndAddUnsafe(k,j,M){const W=A.BASE,K=(re,te)=>te===As||te===Ri||!re.equals(W)?re.multiplyUnsafe(te):re.multiply(te),se=K(this,j).add(K(k,M));return se.is0()?void 0:se}toAffine(k){const{px:j,py:M,pz:W}=this,K=this.is0();k==null&&(k=K?n.ONE:n.inv(W));const se=n.mul(j,k),re=n.mul(M,k),te=n.mul(W,k);if(K)return{x:n.ZERO,y:n.ZERO};if(!n.eql(te,n.ONE))throw new Error("invZ was invalid");return{x:se,y:re}}isTorsionFree(){const{h:k,isTorsionFree:j}=t;if(k===Ri)return!0;if(j)return j(A,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:k,clearCofactor:j}=t;return k===Ri?this:j?j(A,this):this.multiplyUnsafe(t.h)}toRawBytes(k=!0){return this.assertValidity(),i(A,this,k)}toHex(k=!0){return fl(this.toRawBytes(k))}}A.BASE=new A(t.Gx,t.Gy,n.ONE),A.ZERO=new A(n.ZERO,n.ONE,n.ZERO);const D=t.nBitLength,U=CT(A,t.endo?Math.ceil(D/2):D);return{CURVE:t,ProjectivePoint:A,normPrivateKeyToScalar:h,weierstrassEquation:l,isWithinCurveOrder:u}}function NT(e){const t=C3(e);return su(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function kT(e){const t=NT(e),{Fp:n,n:i}=t,o=n.BYTES+1,l=2*n.BYTES+1;function u(v){return As<v&&v<n.ORDER}function f(v){return ni(v,i)}function h(v){return Mg(v,i)}const{ProjectivePoint:y,normPrivateKeyToScalar:_,weierstrassEquation:A,isWithinCurveOrder:D}=OT({...t,toBytes(v,E,B){const z=E.toAffine(),G=n.toBytes(z.x),J=Vc;return B?J(Uint8Array.from([E.hasEvenY()?2:3]),G):J(Uint8Array.from([4]),G,n.toBytes(z.y))},fromBytes(v){const E=v.length,B=v[0],z=v.subarray(1);if(E===o&&(B===2||B===3)){const G=Xa(z);if(!u(G))throw new Error("Point is not on curve");const J=A(G);let T=n.sqrt(J);const m=(T&Ri)===Ri;return(B&1)===1!==m&&(T=n.neg(T)),{x:G,y:T}}else if(E===l&&B===4){const G=n.fromBytes(z.subarray(0,n.BYTES)),J=n.fromBytes(z.subarray(n.BYTES,2*n.BYTES));return{x:G,y:J}}else throw new Error(`Point of length ${E}
33 was invalid. Expected ${o} compressed bytes or ${l} uncompressed bytes`)}}),U=v=>fl(dl(v,t.nByteLength));function L(v){const E=i>>Ri;return v>E}function k(v){return L(v)?f(-v):v}const j=(v,E,B)=>Xa(v.slice(E,B));class M{constructor(E,B,z){this.r=E,this.s=B,this.recovery=z,this.assertValidity()}static fromCompact(E){const B=t.nByteLength;return E=zi("compactSignature",E,B*2),new M(j(E,0,B),j(E,B,2*B))}static fromDER(E){const{r:B,s:z}=Wa.toSig(zi("DER",E));return new M(B,z)}assertValidity(){if(!D(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!D(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new M(this.r,this.s,E)}recoverPublicKey(E){const{r:B,s:z,recovery:G}=this,J=pe(zi("msgHash",E));if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");const T=G===2||G===3?B+t.n:B;if(T>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const m=(G&1)===0?"02":"03",b=y.fromHex(m+U(T)),O=h(T),P=f(-J*O),ne=f(z*O),ue=y.BASE.multiplyAndAddUnsafe(b,P,ne);if(!ue)throw new Error("point at infinify");return ue.assertValidity(),ue}hasHighS(){return L(this.s)}normalizeS(){return this.hasHighS()?new M(this.r,f(-this.s),this.recovery):this}toDERRawBytes(){return Hc(this.toDERHex())}toDERHex(){return Wa.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Hc(this.toCompactHex())}toCompactHex(){return U(this.r)+U(this.s)}}const W={isValidPrivateKey(v){try{return _(v),!0}catch{return!1}},normPrivateKeyToScalar:_,randomPrivateKey:()=>{const v=R3(t.n);return TT(t.randomBytes(v),t.n)},precompute(v=8,E=y.BASE){return E._setWindowSize(v),E.multiply(BigInt(3)),E}};function K(v,E=!0){return y.fromPrivateKey(v).toRawBytes(E)}function se(v){const E=v instanceof Uint8Array,B=typeof v=="string",z=(E||B)&&v.length;return E?z===o||z===l:B?z===2*o||z===2*l:v instanceof y}function re(v,E,B=!0){if(se(v))throw new Error("first arg must be private key");if(!se(E))throw new Error("second arg must be public key");return y.fromHex(E).multiply(_(v)).toRawBytes(B)}const te=t.bits2int||function(v){const E=Xa(v),B=v.length*8-t.nBitLength;return B>0?E>>BigInt(B):E},pe=t.bits2int_modN||function(v){return f(te(v))},we=b1(t.nBitLength);function X(v){if(typeof v!="bigint")throw new Error("bigint expected");if(!(As<=v&&v<we))throw new Error(`bigint expected < 2^${t.nBitLength}`);return dl(v,t.nByteLength)}function Z(v,E,B=ae){if(["recovered","canonical"].some(ve=>ve in B))throw new Error("sign() legacy options not supported");const{hash:z,randomBytes:G}=t;let{lowS:J,prehash:T,extraEntropy:m}=B;J==null&&(J=!0),v=zi("msgHash",v),T&&(v=zi("prehashed msgHash",z(v)));const b=pe(v),O=_(E),P=[X(O),X(b)];if(m!=null){const ve=m===!0?G(n.BYTES):m;P.push(zi("extraEntropy",ve))}const ne=Vc(...P),ue=b;function Te(ve){const Xe=te(ve);if(!D(Xe))return;const mt=h(Xe),He=y.BASE.multiply(Xe).toAffine(),At=f(He.x);if(At===As)return;const tt=f(mt*f(ue+At*O));if(tt===As)return;let Rt=(He.x===At?0:2)|Number(He.y&Ri),qn=tt;return J&&L(tt)&&(qn=k(tt),Rt^=1),new M(At,qn,Rt)}return{seed:ne,k2sig:Te}}const ae={lowS:t.lowS,prehash:!1},ce={lowS:t.lowS,prehash:!1};function N(v,E,B=ae){const{seed:z,k2sig:G}=Z(v,E,B),J=t;return _3(J.hash.outputLen,J.nByteLength,J.hmac)(z,G)}y.BASE._setWindowSize(8);function g(v,E,B,z=ce){const G=v;if(E=zi("msgHash",E),B=zi("publicKey",B),"strict"in z)throw new Error("options.strict was renamed to lowS");const{lowS:J,prehash:T}=z;let m,b;try{if(typeof G=="string"||G instanceof Uint8Array)try{m=M.fromDER(G)}catch(He){if(!(He instanceof Wa.Err))throw He;m=M.fromCompact(G)}else if(typeof G=="object"&&typeof G.r=="bigint"&&typeof G.s=="bigint"){const{r:He,s:At}=G;m=new M(He,At)}else throw new Error("PARSE");b=y.fromHex(B)}catch(He){if(He.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(J&&m.hasHighS())return!1;T&&(E=t.hash(E));const{r:O,s:P}=m,ne=pe(E),ue=h(P),Te=f(ne*ue),ve=f(O*ue),Xe=y.BASE.multiplyAndAddUnsafe(b,Te,ve)?.toAffine();return Xe?f(Xe.x)===O:!1}return{CURVE:t,getPublicKey:K,getSharedSecret:re,sign:N,verify:g,ProjectivePoint:y,Signature:M,utils:W}}function UT(e){return{hash:e,hmac:(t,...n)=>o3(e,t,RI(...n)),randomBytes:CI}}function jT(e,t){const n=i=>kT({...e,...UT(i)});return Object.freeze({...n(t),create:n})}const M3=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ov=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),LT=BigInt(1),Bg=BigInt(2),Nv=(e,t)=>(e+t/Bg)/t;function zT(e){const t=M3,n=BigInt(3),i=BigInt(6),o=BigInt(11),l=BigInt(22),u=BigInt(23),f=BigInt(44),h=BigInt(88),y=e*e*e%t,_=y*y*e%t,A=Ii(_,n,t)*_%t,D=Ii(A,n,t)*_%t,U=Ii(D,Bg,t)*y%t,L=Ii(U,o,t)*U%t,k=Ii(L,l,t)*L%t,j=Ii(k,f,t)*k%t,M=Ii(j,h,t)*j%t,W=Ii(M,f,t)*k%t,K=Ii(W,n,t)*_%t,se=Ii(K,u,t)*L%t,re=Ii(se,i,t)*y%t,te=Ii(re,Bg,t);if(!Dg.eql(Dg.sqr(te),e))throw new Error("Cannot find square root");return te}const Dg=IT(M3,void 0,void 0,{sqrt:zT}),ha=jT({a:BigInt(0),b:BigInt(7),Fp:Dg,n:Ov,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Ov,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),i=-LT*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),l=n,u=BigInt("0x100000000000000000000000000000000"),f=Nv(l*e,t),h=Nv(-i*e,t);let y=ni(e-f*n-h*o,t),_=ni(-f*i-h*l,t);const A=y>u,D=_>u;if(A&&(y=t-y),D&&(_=t-_),y>u||_>u)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:A,k1:y,k2neg:D,k2:_}}}},c3);BigInt(0);ha.ProjectivePoint;const B3="0x0000000000000000000000000000000000000000",kv="0x0000000000000000000000000000000000000000000000000000000000000000",Uv=BigInt(0),jv=BigInt(1),Og=BigInt(2),Lv=BigInt(27),zv=BigInt(28),Rf=BigInt(35),D3=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),PT=D3/Og,HT
33=Symbol.for("nodejs.util.inspect.custom"),Fa={};function _p(e){return io(_r(e),32)}class lr{#e;#t;#r;#n;get r(){return this.#e}set r(t){it(Nc(t)===32,"invalid r","value",t),this.#e=qt(t)}get s(){return it(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(t){it(Nc(t)===32,"invalid s","value",t),this.#t=qt(t)}get _s(){return this.#t}isValid(){return BigInt(this.#t)<=PT}get v(){return this.#r}set v(t){const n=ba(t,"value");it(n===27||n===28,"invalid v","v",t),this.#r=n}get networkV(){return this.#n}get legacyChainId(){const t=this.networkV;return t==null?null:lr.getChainId(t)}get yParity(){return this.v===27?0:1}get yParityAndS(){const t=Mn(this.s);return this.yParity&&(t[0]|=128),qt(t)}get compactSerialized(){return Xi([this.r,this.yParityAndS])}get serialized(){return Xi([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(t,n,i,o){vI(t,Fa,"Signature"),this.#e=n,this.#t=i,this.#r=o,this.#n=null}getCanonical(){if(this.isValid())return this;const t=D3-BigInt(this._s),n=55-this.v,i=new lr(Fa,this.r,_p(t),n);return this.networkV&&(i.#n=this.networkV),i}clone(){const t=new lr(Fa,this.r,this._s,this.v);return this.networkV&&(t.#n=this.networkV),t}toJSON(){const t=this.networkV;return{_type:"signature",networkV:t!=null?t.toString():null,r:this.r,s:this._s,v:this.v}}[HT](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(t){const n=Ar(t,"v");return n==Lv||n==zv?Uv:(it(n>=Rf,"invalid EIP-155 v","v",t),(n-Rf)/Og)}static getChainIdV(t,n){return Ar(t)*Og+BigInt(35+n-27)}static getNormalizedV(t){const n=Ar(t);return n===Uv||n===Lv?27:n===jv||n===zv?28:(it(n>=Rf,"invalid v","v",t),n&jv?27:28)}static from(t){function n(y,_){it(y,_,"signature",t)}if(t==null)return new lr(Fa,kv,kv,27);if(typeof t=="string"){const y=Mn(t,"signature");if(y.length===64){const _=qt(y.slice(0,32)),A=y.slice(32,64),D=A[0]&128?28:27;return A[0]&=127,new lr(Fa,_,qt(A),D)}if(y.length===65){const _=qt(y.slice(0,32)),A=qt(y.slice(32,64)),D=lr.getNormalizedV(y[64]);return new lr(Fa,_,A,D)}n(!1,"invalid raw signature length")}if(t instanceof lr)return t.clone();const i=t.r;n(i!=null,"missing r");const o=_p(i),l=(function(y,_){if(y!=null)return _p(y);if(_!=null){n(Sa(_,32),"invalid yParityAndS");const A=Mn(_);return A[0]&=127,qt(A)}n(!1,"missing s")})(t.s,t.yParityAndS),{networkV:u,v:f}=(function(y,_,A){if(y!=null){const D=Ar(y);return{networkV:D>=Rf?D:void 0,v:lr.getNormalizedV(D)}}if(_!=null)return n(Sa(_,32),"invalid yParityAndS"),{v:Mn(_)[0]&128?28:27};if(A!=null){switch(ba(A,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")})(t.v,t.yParityAndS,t.yParity),h=new lr(Fa,o,l,f);return u&&(h.#n=u),n(t.yParity==null||ba(t.yParity,"sig.yParity")===h.yParity,"yParity mismatch"),n(t.yParityAndS==null||t.yParityAndS===h.yParityAndS,"yParityAndS mismatch"),h}}class _s{#e;
33constructor(t){it(Nc(t)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=qt(t)}get privateKey(){return this.#e}get publicKey(){return _s.computePublicKey(this.#e)}get compressedPublicKey(){return _s.computePublicKey(this.#e,!0)}sign(t){it(Nc(t)===32,"invalid digest length","digest",t);const n=ha.sign(Ec(t),Ec(this.#e),{lowS:!0});return lr.from({r:xv(n.r,32),s:xv(n.s,32),v:n.recovery?28:27})}computeSharedSecret(t){const n=_s.computePublicKey(t);return qt(ha.getSharedSecret(Ec(this.#e),Mn(n),!1))}static computePublicKey(t,n){let i=Mn(t,"key");if(i.length===32){const l=ha.getPublicKey(i,!!n);return qt(l)}if(i.length===64){const l=new Uint8Array(65);l[0]=4,l.set(i,1),i=l}const o=ha.ProjectivePoint.fromHex(i);return qt(o.toRawBytes(n))}static recoverPublicKey(t,n){it(Nc(t)===32,"invalid digest length","digest",t);const i=lr.from(n);let o=ha.Signature.fromCompact(Ec(Xi([i.r,i.s])));o=o.addRecoveryBit(i.yParity);const l=o.recoverPublicKey(Ec(t));return it(l!=null,"invalid signature for digest","signature",n),"0x"+l.toHex(!1)}static addPoints(t,n,i){const o=ha.ProjectivePoint.fromHex(_s.computePublicKey(t).substring(2)),l=ha.ProjectivePoint.fromHex(_s.computePublicKey(n).substring(2));return"0x"+o.add(l).toHex(!!i)}}const VT=BigInt(0),FT=BigInt(36);function Pv(e){e=e.toLowerCase();const t=e.substring(2).split(""),n=new Uint8Array(40);for(let o=0;o<40;o++)n[o]=t[o].charCodeAt(0);const i=Mn(Aa(n));for(let o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(i[o>>1]&15)>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}const v1={};for(let e=0;e<10;e++)v1[String(e)]=String(e);for(let e=0;e<26;e++)v1[String.fromCharCode(65+e)]=String(10+e);const Hv=15;function KT(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(i=>v1[i]).join("");for(;t.length>=Hv;){let i=t.substring(0,Hv);t=parseInt(i,10)%97+t.substring(i.length)}let n=String(98-parseInt(t,10)%97);for(;n.length<2;)n="0"+n;return n}const qT=(function(){const e={};for(let t=0;t<36;t++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[t];e[n]=BigInt(t)}return e})();function $T(e){e=e.toLowerCase();let t=VT;for(let n=0;n<e.length;n++)t=t*FT+qT[e[n]];return t}function Sl(e){if(it(typeof e=="string","invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/)){e.startsWith("0x")||(e="0x"+e);const t=Pv(e);return it(!e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||t===e,"bad address checksum","address",e),t}if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){it(e.substring(2,4)===KT(e),"bad icap checksum","address",e);let t=$T(e.substring(4)).toString(16);for(;t.length<40;)t="0"+t;return Pv("0x"+t)}it(!1,"invalid address","address",e)}function Ip(e,t){return{address:Sl(e),storageKeys:t.map((n,i)=>(it(Sa(n,32),"invalid slot",`storageKeys[${i}]`,n),n.toLowerCase()))}}function x1(e){if(Array.isArray(e))return e.map((n,i)=>Array.isArray(n)?(it(n.length===2,"invalid slot set",`value[${i}]`,n),Ip(n[0],n[1])):(it(n!=null&&typeof n=="object","invalid address-slot set","value",e),Ip(n.address,n.storageKeys)));it(e!=null&&typeof e=="object","invalid access list","value",e);const t=Object.keys(e).map(n=>{const i=e[n].reduce((o,l)=>(o[l]=!0,o),{});return Ip(n,Object.keys(i).sort())});return t.sort((n,i)=>n.address.localeCompare(i.address)),t}function WT(e){return{address:Sl(e.address),nonce:Ar(e.nonce!=null?e.nonce:0),chainId:Ar(e.chainId!=null?e.chainId:0),signature:lr.from(e.signature)}}function GT(e){let t;return typeof e=="string"?t=_s.computePublicKey(e,!1):t=e.publicKey,Sl(Aa("0x"+t.substring(4)).substring(26))}function YT(e,t){return GT(_s.recoverPublicKey(e,t))}const gr=BigInt(0),ZT=BigInt(2),JT=BigInt(27),XT=BigInt(28),QT=BigInt(35),eR=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),tR=Symbol.for("nodejs.util.inspect.custom"),Tp=4096*32,$f=128;function nR(e){return{blobToKzgCommitment:i=>{if("computeBlobProof"in e){if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return Mn(e.blobToKzgCommitment(qt(i)))}else if("blobToKzgCommitment"in e&&typeof e.blobToKzgCommitment=="function")return Mn(e.blobToKzgCommitment(i));if("blobToKZGCommitment"in e&&typeof e.blobToKZGCommitment=="function")return Mn(e.blobToKZGCommitment(qt(i)));it(!1,"unsupported KZG library","kzg",e)},computeBlobKzgProof:(i,o)=>
33{if("computeBlobProof"in e&&typeof e.computeBlobProof=="function")return Mn(e.computeBlobProof(qt(i),qt(o)));if("computeBlobKzgProof"in e&&typeof e.computeBlobKzgProof=="function")return e.computeBlobKzgProof(i,o);if("computeBlobKZGProof"in e&&typeof e.computeBlobKZGProof=="function")return Mn(e.computeBlobKZGProof(qt(i),qt(o)));it(!1,"unsupported KZG library","kzg",e)}}}function Vv(e,t){let n=e.toString(16);for(;n.length<2;)n="0"+n;return n+=El(t).substring(4),"0x"+n}function Al(e){return e==="0x"?null:Sl(e)}function Bd(e,t){try{return x1(e)}catch(n){it(!1,n.message,t,e)}}function rR(e,t){try{if(!Array.isArray(e))throw new Error("authorizationList: invalid array");const n=[];for(let i=0;i<e.length;i++){const o=e[i];if(!Array.isArray(o))throw new Error(`authorization[${i}]: invalid array`);if(o.length!==6)throw new Error(`authorization[${i}]: wrong length`);if(!o[1])throw new Error(`authorization[${i}]: null address`);n.push({address:Al(o[1]),nonce:_n(o[2],"nonce"),chainId:_n(o[0],"chainId"),signature:lr.from({yParity:lo(o[3],"yParity"),r:io(o[4],32),s:io(o[5],32)})})}return n}catch(n){it(!1,n.message,t,e)}}function lo(e,t){return e==="0x"?0:ba(e,t)}function _n(e,t){if(e==="0x")return gr;const n=Ar(e,t);return it(n<=eR,"value exceeds uint size",t,n),n}function cn(e,t){const n=Ar(e,"value"),i=_r(n);return it(i.length<=32,"value too large",`tx.${t}`,n),i}function Dd(e){return x1(e).map(t=>[t.address,t.storageKeys])}function iR(e){return e.map(t=>[cn(t.chainId,"chainId"),t.address,cn(t.nonce,"nonce"),cn(t.signature.yParity,"yParity"),_r(t.signature.r),_r(t.signature._s)])}function sR(e,t){it(Array.isArray(e),`invalid ${t}`,"value",e);for(let n=0;n<e.length;n++)it(Sa(e[n],32),"invalid ${ param } hash",`value[${n}]`,e[n]);return e}function aR(e){const t=iu(e);it(Array.isArray(t)&&(t.length===9||t.length===6),"invalid field count for legacy transaction","data",e);const n={type:0,nonce:lo(t[0],"nonce"),gasPrice:_n(t[1],"gasPrice"),gasLimit:_n(t[2],"gasLimit"),to:Al(t[3]),value:_n(t[4],"value"),data:qt(t[5]),chainId:gr};if(t.length===6)return n;const i=_n(t[6],"v"),o=_n(t[7],"r"),l=_n(t[8],"s");if(o===gr&&l===gr)n.chainId=i;else{let u=(i-QT)/ZT;u<gr&&(u=gr),n.chainId=u,it(u!==gr||i===JT||i===XT,"non-canonical legacy v","v",t[6]),n.signature=lr.from({r:io(t[7],32),s:io(t[8],32),v:i})}return n}function oR(e,t){const n=[cn(e.nonce,"nonce"),cn(e.gasPrice||0,"gasPrice"),cn(e.gasLimit,"gasLimit"),e.to||"0x",cn(e.value,"value"),e.data];let i=gr;if(e.chainId!=gr)i=Ar(e.chainId,"tx.chainId"),it(!t||t.networkV==null||t.legacyChainId===i,"tx.chainId/sig.v mismatch","sig",t);else if(e.signature){const l=e.signature.legacyChainId;l!=null&&(i=l)}if(!t)return i!==gr&&(n.push(_r(i)),n.push("0x"),n.push("0x")),va(n);let o=BigInt(27+t.yParity);return i!==gr?o=lr.getChainIdV(i,t.v):BigInt(t.v)!==o&&it(!1,"tx.chainId/sig.v mismatch","sig",t),n.push(_r(o)),n.push(_r(t.r)),n.push(_r(t._s)),va(n)}function Od(e,t){let n;try{if(n=lo(t[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch{it(!1,"invalid yParity","yParity",t[0])}const i=io(t[1],32),o=io(t[2],32),l=lr.from({r:i,s:o,yParity:n});e.signature=l}function lR(e){const t=iu(Mn(e).slice(1));it(Array.isArray(t)&&(t.length===9||t.length===12),"invalid field count for transaction type: 2","data",qt(e));const n={type:2,chainId:_n(t[0],"chainId"),nonce:lo(t[1],"nonce"),maxPriorityFeePerGas:_n(t[2],"maxPriorityFeePerGas"),maxFeePerGas:_n(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:_n(t[4],"gasLimit"),to:Al(t[5]),value:_n(t[6],"value"),data:qt(t[7]),accessList:Bd(t[8],"accessList")};return t.length===9||Od(n,t.slice(9)),n}function cR(e,t){const n=[cn(e.chainId,"chainId"),cn(e.nonce,"nonce"),cn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),cn(e.maxFeePerGas||0,"maxFeePerGas"),cn(e.gasLimit,"gasLimit"),e.to||"0x",cn(e.value,"value"),e.data,Dd(e.accessList||[])];return t&&(n.push(cn(t.yParity,"yParity")),n.push(_r(t.r)),n.push(_r(t.s))),Xi(["0x02",va(n)])}function uR(e){const t=iu(Mn(e).slice(1));it(Array.isArray(t)&&(t.length===8||t.length===11),"invalid field count for transaction type: 1","data",qt(e));const n={type:1,chainId:_n(t[0],"chainId"),nonce:lo(t[1],"nonce"),gasPrice:_n(t[2],"gasPrice"),gasLimit:_n(t[3],"gasLim
33it"),to:Al(t[4]),value:_n(t[5],"value"),data:qt(t[6]),accessList:Bd(t[7],"accessList")};return t.length===8||Od(n,t.slice(8)),n}function fR(e,t){const n=[cn(e.chainId,"chainId"),cn(e.nonce,"nonce"),cn(e.gasPrice||0,"gasPrice"),cn(e.gasLimit,"gasLimit"),e.to||"0x",cn(e.value,"value"),e.data,Dd(e.accessList||[])];return t&&(n.push(cn(t.yParity,"recoveryParam")),n.push(_r(t.r)),n.push(_r(t.s))),Xi(["0x01",va(n)])}function dR(e){let t=iu(Mn(e).slice(1)),n="3",i=null,o=null;if(t.length===4&&Array.isArray(t[0])){n="3 (network format)";const u=t[1],f=t[2],h=t[3];it(Array.isArray(u),"invalid network format: blobs not an array","fields[1]",u),it(Array.isArray(f),"invalid network format: commitments not an array","fields[2]",f),it(Array.isArray(h),"invalid network format: proofs not an array","fields[3]",h),it(u.length===f.length,"invalid network format: blobs/commitments length mismatch","fields",t),it(u.length===h.length,"invalid network format: blobs/proofs length mismatch","fields",t),o=[];for(let y=0;y<t[1].length;y++)o.push({data:u[y],commitment:f[y],proof:h[y]});t=t[0]}else if(t.length===5&&Array.isArray(t[0])){n="3 (EIP-7594 network format)",i=ba(t[1]);const u=t[2],f=t[3],h=t[4];it(i===1,`unsupported EIP-7594 network format version: ${i}`,"fields[1]",i),it(Array.isArray(u),"invalid EIP-7594 network format: blobs not an array","fields[2]",u),it(Array.isArray(f),"invalid EIP-7594 network format: commitments not an array","fields[3]",f),it(Array.isArray(h),"invalid EIP-7594 network format: proofs not an array","fields[4]",h),it(u.length===f.length,"invalid network format: blobs/commitments length mismatch","fields",t),it(u.length*$f===h.length,"invalid network format: blobs/proofs length mismatch","fields",t),o=[];for(let y=0;y<u.length;y++){const _=[];for(let A=0;A<$f;A++)_.push(h[y*$f+A]);o.push({data:u[y],commitment:f[y],proof:Xi(_)})}t=t[0]}it(Array.isArray(t)&&(t.length===11||t.length===14),`invalid field count for transaction type: ${n}`,"data",qt(e));const l={type:3,chainId:_n(t[0],"chainId"),nonce:lo(t[1],"nonce"),maxPriorityFeePerGas:_n(t[2],"maxPriorityFeePerGas"),maxFeePerGas:_n(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:_n(t[4],"gasLimit"),to:Al(t[5]),value:_n(t[6],"value"),data:qt(t[7]),accessList:Bd(t[8],"accessList"),maxFeePerBlobGas:_n(t[9],"maxFeePerBlobGas"),blobVersionedHashes:t[10],blobWrapperVersion:i};o&&(l.blobs=o),it(l.to!=null,`invalid address for transaction type: ${n}`,"data",e),it(Array.isArray(l.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",e);for(let u=0;u<l.blobVersionedHashes.length;u++)it(Sa(l.blobVersionedHashes[u],32),`invalid blobVersionedHash at index ${u}: must be length 32`,"data",e);return t.length===11||Od(l,t.slice(11)),l}function hR(e,t,n){const i=[cn(e.chainId,"chainId"),cn(e.nonce,"nonce"),cn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),cn(e.maxFeePerGas||0,"maxFeePerGas"),cn(e.gasLimit,"gasLimit"),e.to||B3,cn(e.value,"value"),e.data,Dd(e.accessList||[]),cn(e.maxFeePerBlobGas||0,"maxFeePerBlobGas"),sR(e.blobVersionedHashes||[],"blobVersionedHashes")];if(t&&(i.push(cn(t.yParity,"yParity")),i.push(_r(t.r)),i.push(_r(t.s)),n)){if(e.blobWrapperVersion!=null){const o=_r(e.blobWrapperVersion),l=[];for(const{proof:u}of n){const f=Mn(u),h=f.length/$f;for(let y=0;y<f.length;y+=h)l.push(f.subarray(y,y+h))}return Xi(["0x03",va([i,o,n.map(u=>u.data),n.map(u=>u.commitment),l])])}return Xi(["0x03",va([i,n.map(o=>o.data),n.map(o=>o.commitment),n.map(o=>o.proof)])])}return Xi(["0x03",va(i)])}function pR(e){const t=iu(Mn(e).slice(1));it(Array.isArray(t)&&(t.length===10||t.length===13),"invalid field count for transaction type: 4","data",qt(e));const n={type:4,chainId:_n(t[0],"chainId"),nonce:lo(t[1],"nonce"),maxPriorityFeePerGas:_n(t[2],"maxPriorityFeePerGas"),maxFeePerGas:_n(t[3],"maxFeePerGas"),gasPrice:null,gasLimit:_n(t[4],"gasLimit"),to:Al(t[5]),value:_n(t[6],"value"),data:qt(t[7]),accessList:Bd(t[8],"accessList"),authorizationList:rR(t[9],"authorizationList")};return t.length===10||Od(n,t.slice(10)),n}function gR(e,t){const n=[cn(e.chainId,"chainId"),cn(e.nonce,"nonce"),cn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),cn(e.maxFeePerGas||0,"maxFeePerGas"),cn(e.gasLim
33it,"gasLimit"),e.to||"0x",cn(e.value,"value"),e.data,Dd(e.accessList||[]),iR(e.authorizationList||[])];return t&&(n.push(cn(t.yParity,"yParity")),n.push(_r(t.r)),n.push(_r(t.s))),Xi(["0x04",va(n)])}let mR=class Es{#e;#t;#r;#n;#l;#c;#u;#f;#d;#h;#p;#g;#o;#s;#i;#a;#m;#y;get type(){return this.#e}set type(t){switch(t){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:it(!1,"unsupported transaction type","type",t)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const t=this.#t;return t==null&&this.type===3?B3:t}set to(t){this.#t=t==null?null:Sl(t)}get nonce(){return this.#n}set nonce(t){this.#n=ba(t,"value")}get gasLimit(){return this.#l}set gasLimit(t){this.#l=Ar(t)}get gasPrice(){const t=this.#c;return t==null&&(this.type===0||this.type===1)?gr:t}set gasPrice(t){this.#c=t==null?null:Ar(t,"gasPrice")}get maxPriorityFeePerGas(){const t=this.#u;return t??(this.type===2||this.type===3?gr:null)}set maxPriorityFeePerGas(t){this.#u=t==null?null:Ar(t,"maxPriorityFeePerGas")}get maxFeePerGas(){const t=this.#f;return t??(this.type===2||this.type===3?gr:null)}set maxFeePerGas(t){this.#f=t==null?null:Ar(t,"maxFeePerGas")}get data(){return this.#r}set data(t){this.#r=qt(t)}get value(){return this.#d}set value(t){this.#d=Ar(t,"value")}get chainId(){return this.#h}set chainId(t){this.#h=Ar(t)}get signature(){return this.#p||null}set signature(t){this.#p=t==null?null:lr.from(t)}isValid(){const t=this.signature;if(t&&!t.isValid())return!1;const n=this.authorizationList;if(n){for(const i of n)if(!i.signature.isValid())return!1}return!0}get accessList(){const t=this.#g||null;return t??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(t){this.#g=t==null?null:x1(t)}get authorizationList(){const t=this.#m||null;return t==null&&this.type===4?[]:t}set authorizationList(t){this.#m=t==null?null:t.map(n=>WT(n))}get maxFeePerBlobGas(){const t=this.#o;return t==null&&this.type===3?gr:t}set maxFeePerBlobGas(t){this.#o=t==null?null:Ar(t,"maxFeePerBlobGas")}get blobVersionedHashes(){let t=this.#s;return t==null&&this.type===3?[]:t}set blobVersionedHashes(t){if(t!=null){it(Array.isArray(t),"blobVersionedHashes must be an Array","value",t),t=t.slice();for(let n=0;n<t.length;n++)it(Sa(t[n],32),"invalid blobVersionedHash",`value[${n}]`,t[n])}this.#s=t}get blobs(){return this.#a==null?null:this.#a.map(t=>Object.assign({},t))}set blobs(t){if(t==null){this.#a=null;return}const n=[],i=[];for(let o=0;o<t.length;o++){const l=t[o];if(xI(l)){qr(this.#i,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let u=Mn(l);if(it(u.length<=Tp,"blob is too large",`blobs[${o}]`,l),u.length!==Tp){const y=new Uint8Array(Tp);y.set(u),u=y}const f=this.#i.blobToKzgCommitment(u),h=qt(this.#i.computeBlobKzgProof(u,f));n.push({data:qt(u),commitment:qt(f),proof:h}),i.push(Vv(1,f))}else{const u=qt(l.data),f=qt(l.commitment),h=qt(l.proof);n.push({data:u,commitment:f,proof:h}),i.push(Vv(1,f))}}this.#a=n,this.#s=i}get kzg(){return this.#i}set kzg(t){t==null?this.#i=null:this.#i=nR(t)}get blobWrapperVersion(){return this.#y}set blobWrapperVersion(t){this.#y=t}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#l=gr,this.#c=null,this.#u=null,this.#f=null,this.#r="0x",this.#d=gr,this.#h=gr,this.#p=null,this.#g=null,this.#o=null,this.#s=null,this.#i=null,this.#a=null,this.#m=null,this.#y=null}get hash(){return this.signature==null?null:Aa(this.#w(!0,!1))}get unsignedHash(){return Aa(this.unsignedSerialized)}get from(){return this.signature==null?null:YT(this.unsignedHash,this.signature.getCanonical())}get fromPublicKey(){return this.signature==null?null:_s.recoverPublicKey(this.unsignedHash,this.signature.getCanonical())}isSigned(){return this.signature!=null}#w(t,n){qr(!t||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const i=t?this.signature:null;switch(this.inferType()){case 0:return oR(this,i);case 1:return fR(this,i);case 2:return cR(this,i);case 3:return hR(this,i,n?this.blobs:null);case 4:return gR(this,i)}qr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#w(!0,!0)}get unsignedSerialized(){return this.#w(!1,!1)}inferType(){const t=this.inferTypes();return t.indexOf(2)>=0?2:t.pop()}inferTypes(){const t=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,i=this.accessList!=null,o=this.#o!=null||this.#s;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&qr(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),qr(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),qr(this.type!==0||!i,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const l=[];return this.type!=null?l.push(this.type):this.authorizationList&&this.authorizationList.length?l.push(4):n?l.push(2):t?(l.push(1),i||l.push(0)):i?(l.push(1),l.push(2)):(o&&this.to||(l.push(0),l.push(1),l.push(2)),l.push(3)),l.sort(),l}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Es.from(this)}toJSON(){const t=n=>n==null?null:n.toString();
33return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:t(this.gasLimit),gasPrice:t(this.gasPrice),maxPriorityFeePerGas:t(this.maxPriorityFeePerGas),maxFeePerGas:t(this.maxFeePerGas),value:t(this.value),chainId:t(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[tR](){return this.toString()}toString(){const t=[],n=o=>{let l=this[o];typeof l=="string"&&(l=JSON.stringify(l)),t.push(`${o}: ${l}`)};this.type&&n("type"),n("to"),n("data"),n("nonce"),n("gasLimit"),n("value"),this.chainId!=null&&n("chainId"),this.signature&&(n("from"),t.push(`signature: ${this.signature.toString()}`));const i=this.authorizationList;if(i){const o=[];for(const l of i){const u=[];u.push(`address: ${JSON.stringify(l.address)}`),l.nonce!=null&&u.push(`nonce: ${l.nonce}`),l.chainId!=null&&u.push(`chainId: ${l.chainId}`),l.signature&&u.push(`signature: ${l.signature.toString()}`),o.push(`Authorization { ${u.join(", ")} }`)}t.push(`authorizations: [ ${o.join(", ")} ]`)}return`Transaction { ${t.join(", ")} }`}static from(t){if(t==null)return new Es;if(typeof t=="string"){const i=Mn(t);if(i[0]>=127)return Es.from(aR(i));switch(i[0]){case 1:return Es.from(uR(i));case 2:return Es.from(lR(i));case 3:return Es.from(dR(i));case 4:return Es.from(pR(i))}qr(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Es;return t.type!=null&&(n.type=t.type),t.to!=null&&(n.to=t.to),t.nonce!=null&&(n.nonce=t.nonce),t.gasLimit!=null&&(n.gasLimit=t.gasLimit),t.gasPrice!=null&&(n.gasPrice=t.gasPrice),t.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=t.maxPriorityFeePerGas),t.maxFeePerGas!=null&&(n.maxFeePerGas=t.maxFeePerGas),t.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=t.maxFeePerBlobGas),t.data!=null&&(n.data=t.data),t.value!=null&&(n.value=t.value),t.chainId!=null&&(n.chainId=t.chainId),t.signature!=null&&(n.signature=lr.from(t.signature)),t.accessList!=null&&(n.accessList=t.accessList),t.authorizationList!=null&&(n.authorizationList=t.authorizationList),t.blobVersionedHashes!=null&&(n.blobVersionedHashes=t.blobVersionedHashes),t.kzg!=null&&(n.kzg=t.kzg),t.blobWrapperVersion!=null&&(n.blobWrapperVersion=t.blobWrapperVersion),t.blobs!=null&&(n.blobs=t.blobs),t.hash!=null&&(it(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",t),it(n.hash===t.hash,"hash mismatch","tx",t)),t.from!=null&&(it(n.isSigned(),"unsigned transaction cannot define '.from'","tx",t),it(n.from.toLowerCase()===(t.from||"").toLowerCase(),"from mismatch","tx",t)),n}};const Go=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;function au(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Ng(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function co(e,...t){if(!au(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 O3(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Ng(e.outputLen),Ng(e.blockLen)}function sd(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 yR(e,t){co(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function iN(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function hl(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Rp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Yi(e,t){return e<<32-t|e>>>t}const N3=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function k3(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const sN=N3?e=>e:e=>k3(e);function wR(e){for(let t=0;t<e.length;t++)e[t]=k3(e[t]);return e}const aN=N3?e=>e:wR,U3=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",bR=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Qa(e){if(co(e),U3)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=bR[e[n]];return t}const vs={_0:48,_9:57,A:65,F:70,a:97,f:102};function Fv(e){if(e>=vs._0&&e<=vs._9)return e-vs._0;if(e>=vs.A&&e<=vs.F)return e-(vs.A-10);if(e>=vs.a&&e<=vs.f)return e-(vs.a-10)}function ad(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(U3)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(n);for(let o=0,l=0;o<n;o++,l+=2){const u=Fv(e.charCodeAt(l)),f=Fv(e.charCodeAt(l+1));if(u===void 0||f===void 0){const h=e[l]+e[l+1];throw new Error('hex string expected, got non-hex character "'+h+'" at index '+l)}i[o]=u*16+f}return i}function vR(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Nd(e){return typeof e=="string"&&(e=vR(e)),co(e),e}function Zi(...e){let t=0;for(let i=0;i<e.length;i++){const o=e[i];co(o),t+=o.length}const n=new Uint8Array(t);for(let i=0,o=0;i<e.length;i++){const l=e[i];n.set(l,o),o+=l.length}return n}class j3{}function kd(e){const t=i=>e().update(Nd(i)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function oN(e){const t=(i,o)=>e(o).update(Nd(i)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=i=>e(i),t}function E1(e=32){if(Go&&typeof Go.getRandomValues=="function")return Go.getRandomValues(new Uint8Array(e));if(Go&&typeof Go.randomBytes=="function")return Uint8Array.from(Go.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function xR(e,t,n,i){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,i);const o=BigInt(32),l=BigInt(4294967295),u=Number(n>>o&l),f=Number(n&l),h=i?4:0,y=i?0:4;e.setUint32(t+h,u,i),e.setUint32(t+y,f,i)}function ER(e,t,n){return e&t^~e&n}function SR(e,t,n){return e&t^e&n^t&n}class L3 extends j3{constructor(t,n,i,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=i,this.isLE=o,this.buffer=new Uint8Array(t),this.view=Rp(this.buffer)}update(t){sd(this),t=Nd(t),co(t);const{view:n,buffer:i,blockLen:o}=this,l=t.length;for(let u=0;u<l;){const f=Math.min(o-this.pos,l-u);if(f===o){const h=Rp(t);for(;o<=l-u;u+=o)this.process(h,u);continue}i.set(t.subarray(u,u+f),this.pos),this.pos+=f,u+=f,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){sd(this),yR(t,this),this.finished=!0;const{buffer:n,view:i,blockLen:o,isLE:l}=this;let{pos:u}=this;n[u++]=128,hl(this.buffer.subarray(u)),this.padOffset>o-u&&(this.process(i,0),u=0);for(let A=u;A<o;A++)n[A]=0;xR(i,o-8,BigInt(this.length*8),l),this.process(i,0);const f=Rp(t),h=this.outputLen;if(h%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const y=h/4,_=this.get();if(y>_.length)throw new Error("_sha2: outputLen bigger than state");for(let A=0;A<y;A++)f.setUint32(4*A,_[A],l)}
vendor: 4,182 bytes, line 33
33digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const i=t.slice(0,n);return this.destroy(),i}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:i,length:o,finished:l,destroyed:u,pos:f}=this;return t.destroyed=u,t.finished=l,t.length=o,t.pos=f,o%n&&t.buffer.set(i),t}clone(){return this._cloneInto()}}const oa=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Cr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Mr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),Cf=BigInt(2**32-1),Kv=BigInt(32);function AR(e,t=!1){return t?{h:Number(e&Cf),l:Number(e>>Kv&Cf)}:{h:Number(e>>Kv&Cf)|0,l:Number(e&Cf)|0}}function _R(e,t=!1){const n=e.length;let i=new Uint32Array(n),o=new Uint32Array(n);for(let l=0;l<n;l++){const{h:u,l:f}=AR(e[l],t);[i[l],o[l]]=[u,f]}return[i,o]}const qv=(e,t,n)=>e>>>n,$v=(e,t,n)=>e<<32-n|t>>>n,Yo=(e,t,n)=>e>>>n|t<<32-n,Zo=(e,t,n)=>e<<32-n|t>>>n,Mf=(e,t,n)=>e<<64-n|t>>>n-32,Bf=(e,t,n)=>e>>>n-32|t<<64-n,lN=(e,t)=>t,cN=(e,t)=>e,uN=(e,t,n)=>e<<n|t>>>32-n,fN=(e,t,n)=>t<<n|e>>>32-n,dN=(e,t,n)=>t<<n-32|e>>>64-n,hN=(e,t,n)=>e<<n-32|t>>>64-n;function xs(e,t,n,i){const o=(t>>>0)+(i>>>0);return{h:e+n+(o/2**32|0)|0,l:o|0}}const IR=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),TR=(e,t,n,i)=>t+n+i+(e/2**32|0)|0,RR=(e,t,n,i)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0),CR=(e,t,n,i,o)=>t+n+i+o+(e/2**32|0)|0,MR=(e,t,n,i,o)=>(e>>>0)+(t>>>0)+(n>>>0)+(i>>>0)+(o>>>0),BR=(e,t,n,i,o,l)=>t+n+i+o+l+(e/2**32|0)|0,DR=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]),la=new Uint32Array(64);class OR extends L3{constructor(t=32){super(64,t,8,!1),this.A=oa[0]|0,this.B=oa[1]|0,this.C=oa[2]|0,this.D=oa[3]|0,this.E=oa[4]|0,this.F=oa[5]|0,this.G=oa[6]|0,this.H=oa[7]|0}get(){const{A:t,B:n,C:i,D:o,E:l,F:u,G:f,H:h}=this;return[t,n,i,o,l,u,f,h]}set(t,n,i,o,l,u,f,h){this.A=t|0,this.B=n|0,this.C=i|0,this.D=o|0,this.E=l|0,this.F=u|0,this.G=f|0,this.H=h|0}process(t,n){for(let A=0;A<16;A++,n+=4)la[A]=t.getUint32(n,!1);for(let A=16;A<64;A++){const D=la[A-15],U=la[A-2],L=Yi(D,7)^Yi(D,18)^D>>>3,k=Yi(U,17)^Yi(U,19)^U>>>10;la[A]=k+la[A-7]+L+la[A-16]|0}let{A:i,B:o,C:l,D:u,E:f,F:h,G:y,H:_}=this;for(let A=0;A<64;A++){const D=Yi(f,6)^Yi(f,11)^Yi(f,25),U=_+D+ER(f,h,y)+DR[A]+la[A]|0,k=(Yi(i,2)^Yi(i,13)^Yi(i,22))+SR(i,o,l)|0;_=y,y=h,h=f,f=u+U|0,u=l,l=o,o=i,i=U+k|0}i=i+this.A|0,o=o+this.B|0,l=l+this.C|0,u=u+this.D|0,f=f+this.E|0,h=h+this.F|0,y=y+this.G|0,_=_+this.H|0,this.set(i,o,l,u,f,h,y,_)}roundClean(){hl(la)}destroy(){this.set(0,0,0,0,0,0,0,0),hl(this.buffer)}}const z3=_R(["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","0x27b70a854
336d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),NR=z3[0],kR=z3[1],ca=new Uint32Array(80),ua=new Uint32Array(80);class S1 extends L3{constructor(t=64){super(128,t,16,!1),this.Ah=Mr[0]|0,this.Al=Mr[1]|0,this.Bh=Mr[2]|0,this.Bl=Mr[3]|0,this.Ch=Mr[4]|0,this.Cl=Mr[5]|0,this.Dh=Mr[6]|0,this.Dl=Mr[7]|0,this.Eh=Mr[8]|0,this.El=Mr[9]|0,this.Fh=Mr[10]|0,this.Fl=Mr[11]|0,this.Gh=Mr[12]|0,this.Gl=Mr[13]|0,this.Hh=Mr[14]|0,this.Hl=Mr[15]|0}get(){const{Ah:t,Al:n,Bh:i,Bl:o,Ch:l,Cl:u,Dh:f,Dl:h,Eh:y,El:_,Fh:A,Fl:D,Gh:U,Gl:L,Hh:k,Hl:j}=this;return[t,n,i,o,l,u,f,h,y,_,A,D,U,L,k,j]}set(t,n,i,o,l,u,f,h,y,_,A,D,U,L,k,j){this.Ah=t|0,this.Al=n|0,this.Bh=i|0,this.Bl=o|0,this.Ch=l|0,this.Cl=u|0,this.Dh=f|0,this.Dl=h|0,this.Eh=y|0,this.El=_|0,this.Fh=A|0,this.Fl=D|0,this.Gh=U|0,this.Gl=L|0,this.Hh=k|0,this.Hl=j|0}process(t,n){for(let K=0;K<16;K++,n+=4)ca[K]=t.getUint32(n),ua[K]=t.getUint32(n+=4);for(let K=16;K<80;K++){const se=ca[K-15]|0,re=ua[K-15]|0,te=Yo(se,re,1)^Yo(se,re,8)^qv(se,re,7),pe=Zo(se,re,1)^Zo(se,re,8)^$v(se,re,7),we=ca[K-2]|0,X=ua[K-2]|0,Z=Yo(we,X,19)^Mf(we,X,61)^qv(we,X,6),ae=Zo(we,X,19)^Bf(we,X,61)^$v(we,X,6),ce=RR(pe,ae,ua[K-7],ua[K-16]),N=CR(ce,te,Z,ca[K-7],ca[K-16]);
vendor: 4,209 bytes, line 33
33ca[K]=N|0,ua[K]=ce|0}let{Ah:i,Al:o,Bh:l,Bl:u,Ch:f,Cl:h,Dh:y,Dl:_,Eh:A,El:D,Fh:U,Fl:L,Gh:k,Gl:j,Hh:M,Hl:W}=this;for(let K=0;K<80;K++){const se=Yo(A,D,14)^Yo(A,D,18)^Mf(A,D,41),re=Zo(A,D,14)^Zo(A,D,18)^Bf(A,D,41),te=A&U^~A&k,pe=D&L^~D&j,we=MR(W,re,pe,kR[K],ua[K]),X=BR(we,M,se,te,NR[K],ca[K]),Z=we|0,ae=Yo(i,o,28)^Mf(i,o,34)^Mf(i,o,39),ce=Zo(i,o,28)^Bf(i,o,34)^Bf(i,o,39),N=i&l^i&f^l&f,g=o&u^o&h^u&h;M=k|0,W=j|0,k=U|0,j=L|0,U=A|0,L=D|0,{h:A,l:D}=xs(y|0,_|0,X|0,Z|0),y=f|0,_=h|0,f=l|0,h=u|0,l=i|0,u=o|0;const v=IR(Z,ce,g);i=TR(v,X,ae,N),o=v|0}({h:i,l:o}=xs(this.Ah|0,this.Al|0,i|0,o|0)),{h:l,l:u}=xs(this.Bh|0,this.Bl|0,l|0,u|0),{h:f,l:h}=xs(this.Ch|0,this.Cl|0,f|0,h|0),{h:y,l:_}=xs(this.Dh|0,this.Dl|0,y|0,_|0),{h:A,l:D}=xs(this.Eh|0,this.El|0,A|0,D|0),{h:U,l:L}=xs(this.Fh|0,this.Fl|0,U|0,L|0),{h:k,l:j}=xs(this.Gh|0,this.Gl|0,k|0,j|0),{h:M,l:W}=xs(this.Hh|0,this.Hl|0,M|0,W|0),this.set(i,o,l,u,f,h,y,_,A,D,U,L,k,j,M,W)}roundClean(){hl(ca,ua)}destroy(){hl(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class UR extends S1{constructor(){super(48),this.Ah=Cr[0]|0,this.Al=Cr[1]|0,this.Bh=Cr[2]|0,this.Bl=Cr[3]|0,this.Ch=Cr[4]|0,this.Cl=Cr[5]|0,this.Dh=Cr[6]|0,this.Dl=Cr[7]|0,this.Eh=Cr[8]|0,this.El=Cr[9]|0,this.Fh=Cr[10]|0,this.Fl=Cr[11]|0,this.Gh=Cr[12]|0,this.Gl=Cr[13]|0,this.Hh=Cr[14]|0,this.Hl=Cr[15]|0}}const Br=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class jR extends S1{constructor(){super(32),this.Ah=Br[0]|0,this.Al=Br[1]|0,this.Bh=Br[2]|0,this.Bl=Br[3]|0,this.Ch=Br[4]|0,this.Cl=Br[5]|0,this.Dh=Br[6]|0,this.Dl=Br[7]|0,this.Eh=Br[8]|0,this.El=Br[9]|0,this.Fh=Br[10]|0,this.Fl=Br[11]|0,this.Gh=Br[12]|0,this.Gl=Br[13]|0,this.Hh=Br[14]|0,this.Hl=Br[15]|0}}const ou=kd(()=>new OR),LR=kd(()=>new S1),pN=kd(()=>new UR),gN=kd(()=>new jR);const A1=BigInt(0),kg=BigInt(1);function so(e,t=""){if(typeof e!="boolean"){const n=t&&`"${t}"`;throw new Error(n+"expected boolean, got type="+typeof e)}return e}function Pi(e,t,n=""){const i=au(e),o=e?.length,l=t!==void 0;if(!i||l&&o!==t){const u=n&&`"${n}" `,f=l?` of length ${t}`:"",h=i?`length=${o}`:`type=${typeof e}`;throw new Error(u+"expected Uint8Array"+f+", got "+h)}return e}function Df(e){const t=e.toString(16);return t.length&1?"0"+t:t}function P3(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?A1:BigInt("0x"+e)}function Ud(e){return P3(Qa(e))}function Fc(e){return co(e),P3(Qa(Uint8Array.from(e).reverse()))}function _1(e,t){return ad(e.toString(16).padStart(t*2,"0"))}function H3(e,t){return _1(e,t).reverse()}function Jn(e,t,n){let i;if(typeof t=="string")try{i=ad(t)}catch(l){throw new Error(e+" must be hex string or Uint8Array, cause: "+l)}else if(au(t))i=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const o=i.length;if(typeof n=="number"&&o!==n)throw new Error(e+" of length "+n+" expected, got "+o);return i}function Wv(e){return Uint8Array.from(e)}const Cp=e=>typeof e=="bigint"&&A1<=e;function zR(e,t,n){return Cp(e)&&Cp(t)&&Cp(n)&&t<=e&&e<n}function Ug(e,t,n,i){if(!zR(t,n,i))throw new Error("expected valid "+e+": "+n+" <= n < "+i+", got "+t)}function V3(e){let t;for(t=0;e>A1;e>>=kg,t+=1);return t}const lu=e=>(kg<<BigInt(e))-kg;function PR(e,t,n){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 n!="function")throw new Error("hmacFn must be a function");const i=U=>new Uint8Array(U),o=U=>Uint8Array.of(U);let l=i(e),u=i(e),f=0;const h=()=>{l.fill(1),u.fill(0),f=0},y=(...U)=>n(u,l,...U),_=(U=i(0))=>{u=y(o(0),U),l=y(),U.length!==0&&(u=y(o(1),U),l=y())},A=()=>{if(f++>=1e3)throw new Error("drbg: tried 1000 values");let U=0;const L=[];for(;U<t;){l=y();const k=l.slice();L.push(k),U+=l.length}return Zi(...L)};return(U,L)=>{h(),_(U);let k;for(;!(k=L(A()));)_();return h(),k}}function cu(e,t,n={}){if(!e||typeof e!="object")throw new Error("expected valid options object");function i(o,l,u){const f=e[o];if(u&&f===void 0)return;const h=typeof f;if(h!==l||f===null)throw new Error(`param "${o}
33" is invalid: expected ${l}, got ${h}`)}Object.entries(t).forEach(([o,l])=>i(o,l,!1)),Object.entries(n).forEach(([o,l])=>i(o,l,!0))}function od(e){const t=new WeakMap;return(n,...i)=>{const o=t.get(n);if(o!==void 0)return o;const l=e(n,...i);return t.set(n,l),l}}const ri=BigInt(0),Ir=BigInt(1),Ga=BigInt(2),F3=BigInt(3),K3=BigInt(4),q3=BigInt(5),HR=BigInt(7),$3=BigInt(8),VR=BigInt(9),W3=BigInt(16);function cr(e,t){const n=e%t;return n>=ri?n:t+n}function Zn(e,t,n){let i=e;for(;t-- >ri;)i*=i,i%=n;return i}function Gv(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 n=cr(e,t),i=t,o=ri,l=Ir;for(;n!==ri;){const f=i/n,h=i%n,y=o-l*f;i=n,n=h,o=l,l=y}if(i!==Ir)throw new Error("invert: does not exist");return cr(o,t)}function I1(e,t,n){if(!e.eql(e.sqr(t),n))throw new Error("Cannot find square root")}function G3(e,t){const n=(e.ORDER+Ir)/K3,i=e.pow(t,n);return I1(e,i,t),i}function FR(e,t){const n=(e.ORDER-q3)/$3,i=e.mul(t,Ga),o=e.pow(i,n),l=e.mul(t,o),u=e.mul(e.mul(l,Ga),o),f=e.mul(l,e.sub(u,e.ONE));return I1(e,f,t),f}function KR(e){const t=uo(e),n=Y3(e),i=n(t,t.neg(t.ONE)),o=n(t,i),l=n(t,t.neg(i)),u=(e+HR)/W3;return(f,h)=>{let y=f.pow(h,u),_=f.mul(y,i);const A=f.mul(y,o),D=f.mul(y,l),U=f.eql(f.sqr(_),h),L=f.eql(f.sqr(A),h);y=f.cmov(y,_,U),_=f.cmov(D,A,L);const k=f.eql(f.sqr(_),h),j=f.cmov(y,_,k);return I1(f,j,h),j}}function Y3(e){if(e<F3)throw new Error("sqrt is not defined for small field");let t=e-Ir,n=0;for(;t%Ga===ri;)t/=Ga,n++;let i=Ga;const o=uo(e);for(;Yv(o,i)===1;)if(i++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return G3;let l=o.pow(i,t);const u=(t+Ir)/Ga;return function(h,y){if(h.is0(y))return y;if(Yv(h,y)!==1)throw new Error("Cannot find square root");let _=n,A=h.mul(h.ONE,l),D=h.pow(y,t),U=h.pow(y,u);for(;!h.eql(D,h.ONE);){if(h.is0(D))return h.ZERO;let L=1,k=h.sqr(D);for(;!h.eql(k,h.ONE);)if(L++,k=h.sqr(k),L===_)throw new Error("Cannot find square root");const j=Ir<<BigInt(_-L-1),M=h.pow(A,j);_=L,A=h.sqr(M),D=h.mul(D,A),U=h.mul(U,M)}return U}}function qR(e){return e%K3===F3?G3:e%$3===q3?FR:e%W3===VR?KR(e):Y3(e)}const $R=(e,t)=>(cr(e,t)&Ir)===Ir,WR=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function GR(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=WR.reduce((i,o)=>(i[o]="function",i),t);return cu(e,n),e}function YR(e,t,n){if(n<ri)throw new Error("invalid exponent, negatives unsupported");if(n===ri)return e.ONE;if(n===Ir)return t;let i=e.ONE,o=t;for(;n>ri;)n&Ir&&(i=e.mul(i,o)),o=e.sqr(o),n>>=Ir;return i}function Z3(e,t,n=!1){const i=new Array(t.length).fill(n?e.ZERO:void 0),o=t.reduce((u,f,h)=>e.is0(f)?u:(i[h]=u,e.mul(u,f)),e.ONE),l=e.inv(o);return t.reduceRight((u,f,h)=>e.is0(f)?u:(i[h]=e.mul(u,i[h]),e.mul(u,f)),l),i}function Yv(e,t){const n=(e.ORDER-Ir)/Ga,i=e.pow(t,n),o=e.eql(i,e.ONE),l=e.eql(i,e.ZERO),u=e.eql(i,e.neg(e.ONE));if(!o&&!l&&!u)throw new Error("invalid Legendre symbol result");return o?1:l?0:-1}function J3(e,t){t!==void 0&&Ng(t);const n=t!==void 0?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function uo(e,t,n=!1,i={}){if(e<=ri)throw new Error("invalid field: expected ORDER > 0, got "+e);let o,l,u=!1,f;if(typeof t=="object"&&t!=null){if(i.sqrt||n)throw new Error("cannot specify opts in two arguments");const D=t;D.BITS&&(o=D.BITS),D.sqrt&&(l=D.sqrt),typeof D.isLE=="boolean"&&(n=D.isLE),typeof D.modFromBytes=="boolean"&&(u=D.modFromBytes),f=D.allowedLengths}else typeof t=="number"&&(o=t),i.sqrt&&(l=i.sqrt);const{nBitLength:h,nByteLength:y}=J3(e,o);if(y>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let _;const A=Object.freeze({ORDER:e,isLE:n,BITS:h,BYTES:y,MASK:lu(h),ZERO:ri,ONE:Ir,allowedLengths:f,create:D=>cr(D,e),isValid:D=>{if(typeof D!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof D);return ri<=D&&D<e},is0:D=>D===ri,isValidNot0:D=>!A.is0(D)&&A.isValid(D),isOdd:D=>(D&Ir)===Ir,neg:D=>cr(-D,e),eql:(D,U)=>D===U,sqr:D=>cr(D*D,e),add:(D,U)=>cr(D+U,e),sub:(D,U)=>cr(D-U,e),mul:(D,U)=>cr(D*U,e),pow:(D,U)=>YR(A,D,U),div:(D,U)=>cr(D*Gv(U,e),e),sqrN:D=>D*D,addN:(D,U)=>D+U,subN:(D,U)=>D-U,mulN:(D,U)=>D*U,inv:D=>Gv(D,e),sqrt:l||(D=>(_||(_=qR(e)),_(A,D))),toBytes:D=>n?H3(D,y):_1(D,y),fromBytes:(D,U=!0)=>
vendor: 3,160 bytes, line 33
33{if(f){if(!f.includes(D.length)||D.length>y)throw new Error("Field.fromBytes: expected "+f+" bytes, got "+D.length);const k=new Uint8Array(y);k.set(D,n?0:k.length-D.length),D=k}if(D.length!==y)throw new Error("Field.fromBytes: expected "+y+" bytes, got "+D.length);let L=n?Fc(D):Ud(D);if(u&&(L=cr(L,e)),!U&&!A.isValid(L))throw new Error("invalid field element: outside of range 0..ORDER");return L},invertBatch:D=>Z3(A,D),cmov:(D,U,L)=>L?U:D});return Object.freeze(A)}function X3(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Q3(e){const t=X3(e);return t+Math.ceil(t/2)}function ZR(e,t,n=!1){const i=e.length,o=X3(t),l=Q3(t);if(i<16||i<l||i>1024)throw new Error("expected "+l+"-1024 bytes of input, got "+i);const u=n?Fc(e):Ud(e),f=cr(u,t-Ir)+Ir;return n?H3(f,o):_1(f,o)}const pl=BigInt(0),Ya=BigInt(1);function ld(e,t){const n=t.negate();return e?n:t}function Za(e,t){const n=Z3(e.Fp,t.map(i=>i.Z));return t.map((i,o)=>e.fromAffine(i.toAffine(n[o])))}function e2(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Mp(e,t){e2(e,t);const n=Math.ceil(t/e)+1,i=2**(e-1),o=2**e,l=lu(e),u=BigInt(e);return{windows:n,windowSize:i,mask:l,maxNumber:o,shiftBy:u}}function Zv(e,t,n){const{windowSize:i,mask:o,maxNumber:l,shiftBy:u}=n;let f=Number(e&o),h=e>>u;f>i&&(f-=l,h+=Ya);const y=t*i,_=y+Math.abs(f)-1,A=f===0,D=f<0,U=t%2!==0;return{nextN:h,offset:_,isZero:A,isNeg:D,isNegF:U,offsetF:y}}function JR(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,i)=>{if(!(n instanceof t))throw new Error("invalid point at index "+i)})}function XR(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,i)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+i)})}const Bp=new WeakMap,t2=new WeakMap;function Dp(e){return t2.get(e)||1}function Jv(e){if(e!==pl)throw new Error("invalid wNAF")}class n2{constructor(t,n){this.BASE=t.BASE,this.ZERO=t.ZERO,this.Fn=t.Fn,this.bits=n}_unsafeLadder(t,n,i=this.ZERO){let o=t;for(;n>pl;)n&Ya&&(i=i.add(o)),o=o.double(),n>>=Ya;return i}precomputeWindow(t,n){const{windows:i,windowSize:o}=Mp(n,this.bits),l=[];let u=t,f=u;for(let h=0;h<i;h++){f=u,l.push(f);for(let y=1;y<o;y++)f=f.add(u),l.push(f);u=f.double()}return l}wNAF(t,n,i){if(!this.Fn.isValid(i))throw new Error("invalid scalar");let o=this.ZERO,l=this.BASE;const u=Mp(t,this.bits);for(let f=0;f<u.windows;f++){const{nextN:h,offset:y,isZero:_,isNeg:A,isNegF:D,offsetF:U}=Zv(i,f,u);i=h,_?l=l.add(ld(D,n[U])):o=o.add(ld(A,n[y]))}return Jv(i),{p:o,f:l}}wNAFUnsafe(t,n,i,o=this.ZERO){const l=Mp(t,this.bits);for(let u=0;u<l.windows&&i!==pl;u++){const{nextN:f,offset:h,isZero:y,isNeg:_}=Zv(i,u,l);if(i=f,!y){const A=n[h];o=o.add(_?A.negate():A)}}return Jv(i),o}getPrecomputes(t,n,i){let o=Bp.get(n);return o||(o=this.precomputeWindow(n,t),t!==1&&(typeof i=="function"&&(o=i(o)),Bp.set(n,o))),o}cached(t,n,i){const o=Dp(t);return this.wNAF(o,this.getPrecomputes(o,t,i),n)}unsafe(t,n,i,o){const l=Dp(t);return l===1?this._unsafeLadder(t,n,o):this.wNAFUnsafe(l,this.getPre
33computes(l,t,i),n,o)}createCache(t,n){e2(n,this.bits),t2.set(t,n),Bp.delete(t)}hasCache(t){return Dp(t)!==1}}function QR(e,t,n,i){let o=t,l=e.ZERO,u=e.ZERO;for(;n>pl||i>pl;)n&Ya&&(l=l.add(o)),i&Ya&&(u=u.add(o)),o=o.double(),n>>=Ya,i>>=Ya;return{p1:l,p2:u}}function r2(e,t,n,i){JR(n,e),XR(i,t);const o=n.length,l=i.length;if(o!==l)throw new Error("arrays of points and scalars must have equal length");const u=e.ZERO,f=V3(BigInt(o));let h=1;f>12?h=f-3:f>4?h=f-2:f>0&&(h=2);const y=lu(h),_=new Array(Number(y)+1).fill(u),A=Math.floor((t.BITS-1)/h)*h;let D=u;for(let U=A;U>=0;U-=h){_.fill(u);for(let k=0;k<l;k++){const j=i[k],M=Number(j>>BigInt(U)&y);_[M]=_[M].add(n[k])}let L=u;for(let k=_.length-1,j=u;k>0;k--)j=j.add(_[k]),L=L.add(j);if(D=D.add(L),U!==0)for(let k=0;k<h;k++)D=D.double()}return D}function Xv(e,t,n){if(t){if(t.ORDER!==e)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return GR(t),t}else return uo(e,{isLE:n})}function i2(e,t,n={},i){if(i===void 0&&(i=e==="edwards"),!t||typeof t!="object")throw new Error(`expected valid ${e} CURVE object`);for(const h of["p","n","h"]){const y=t[h];if(!(typeof y=="bigint"&&y>pl))throw new Error(`CURVE.${h} must be positive bigint`)}const o=Xv(t.p,n.Fp,i),l=Xv(t.n,n.Fn,i),f=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(const h of f)if(!o.isValid(t[h]))throw new Error(`CURVE.${h} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:o,Fn:l}}const fa=BigInt(0),pr=BigInt(1),Op=BigInt(2),e7=BigInt(8);function t7(e,t,n,i){const o=e.sqr(n),l=e.sqr(i),u=e.add(e.mul(t.a,o),l),f=e.add(e.ONE,e.mul(t.d,e.mul(o,l)));return e.eql(u,f)}function n7(e,t={}){const n=i2("edwards",e,t,t.FpFnLE),{Fp:i,Fn:o}=n;let l=n.CURVE;const{h:u}=l;cu(t,{},{uvRatio:"function"});const f=Op<<BigInt(o.BYTES*8)-pr,h=j=>i.create(j),y=t.uvRatio||((j,M)=>{try{return{isValid:!0,value:i.sqrt(i.div(j,M))}}catch{return{isValid:!1,value:fa}}});if(!t7(i,l,l.Gx,l.Gy))throw new Error("bad curve params: generator point");function _(j,M,W=!1){const K=W?pr:fa;return Ug("coordinate "+j,M,K,f),M}function A(j){if(!(j instanceof L))throw new Error("ExtendedPoint expected")}const D=od((j,M)=>{const{X:W,Y:K,Z:se}=j,re=j.is0();M==null&&(M=re?e7:i.inv(se));const te=h(W*M),pe=h(K*M),we=i.mul(se,M);if(re)return{x:fa,y:pr};if(we!==pr)throw new Error("invZ was invalid");return{x:te,y:pe}}),U=od(j=>{const{a:M,d:W}=l;if(j.is0())throw new Error("bad point: ZERO");const{X:K,Y:se,Z:re,T:te}=j,pe=h(K*K),we=h(se*se),X=h(re*re),Z=h(X*X),ae=h(pe*M),ce=h(X*h(ae+we)),N=h(Z+h(W*h(pe*we)));if(ce!==N)throw new Error("bad point: equation left != right (1)");const g=h(K*se),v=h(re*te);if(g!==v)throw new Error("bad point: equation left != right (2)");return!0});class L{constructor(M,W,K,se){this.X=_("x",M),this.Y=_("y",W),this.Z=_("z",K,!0),this.T=_("t",se),Object.freeze(this)}static CURVE(){return l}static fromAffine(M){if(M instanceof L)throw new Error("extended point not allowed");const{x:W,y:K}=M||{};return _("x",W),_("y",K),new L(W,K,pr,h(W*K))}static fromBytes(M,W=!1){const K=i.BYTES,{a:se,d:re}=l;M=Wv(Pi(M,K,"point")),so(W,"zip215");const te=Wv(M),pe=M[K-1];te[K-1]=pe&-129;const we=Fc(te),X=W?f:i.ORDER;Ug("point.y",we,fa,X);const Z=h(we*we),ae=h(Z-pr),ce=h(re*Z-se);let{isValid:N,value:g}=y(ae,ce);if(!N)throw new Error("bad point: invalid y coordinate");const v=(g&pr)===pr,E=(pe&128)!==0;if(!W&&g===fa&&E)throw new Error("bad point: x=0 and x_0=1");return E!==v&&(g=h(-g)),L.fromAffine({x:g,y:we})}static fromHex(M,W=!1){return L.fromBytes(Jn("point",M),W)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(M=8,W=!0){return k.createCache(this,M),W||this.multiply(Op),this}assertValidity(){U(this)}equals(M){A(M);const{X:W,Y:K,Z:se}=this,{X:re,Y:te,Z:pe}=M,we=h(W*pe),X=h(re*se),Z=h(K*pe),ae=h(te*se);return we===X&&Z===ae}is0(){return this.equals(L.ZERO)}negate(){return new L(h(-this.X),this.Y,this.Z,h(-this.T))}double(){const{a:M}=l,{X:W,Y:K,Z:se}=this,re=h(W*W),te=h(K*K),pe=h(Op*h(se*se)),we=h(M*re),X=W+K,Z=h(h(X*X)-re-te),ae=we+te,ce=ae-pe,N=we-te,g=h(Z*ce),v=h(ae*N),E=h(Z*N),B=h(ce*ae);return new L(g,v,B,E)}add(M){A(M);const{a:W,d:K}=l,{X:se,Y:re,Z:te,T:pe}=this,{X:we,Y:X,Z,T:ae}=M,ce=h(se*we),N=h(re*X),g=h(pe*K*ae),v=h(te*Z),E=h((se+re)*(we+X)-ce-N),B=v-g,z=v+g,G=h(N-W*ce),J=h(E*B),T=h(z*G),m=h(E*G),b=h(B*z);return new L(J,T,b,m)}subtract(M){return this.add(M.negate())}multiply(M){if(!o.isValidNot0(M))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:W,f:K}=k.cached(this,M,se=>Za(L,se));return Za(L,[W,K])[0]}multiplyUnsafe(M,W=L.ZERO){if(!o.isValid(M))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return M===fa?L.ZERO:this.is0()||M===pr?this:k.unsafe(this,M,K=>Za(L,K),W)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return k.unsafe(this,l.n).is0()}toAffine(M){return D(this,M)}clearCofactor(){return u===pr?this:this.multiplyUnsafe(u)}toBytes(){const{x:M,y:W}=this.toAffine(),K=i.toBytes(W);return K[K.length-1]|=M&pr?128:0,K}toHex(){return Qa(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(M){return Za(L,M)}static msm(M,W){return r2(L,o,M,W)}
33_setWindowSize(M){this.precompute(M)}toRawBytes(){return this.toBytes()}}L.BASE=new L(l.Gx,l.Gy,pr,h(l.Gx*l.Gy)),L.ZERO=new L(fa,pr,pr,fa),L.Fp=i,L.Fn=o;const k=new n2(L,o.BITS);return L.BASE.precompute(8),L}function r7(e,t,n={}){if(typeof t!="function")throw new Error('"hash" function param is required');cu(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:i}=n,{BASE:o,Fp:l,Fn:u}=e,f=n.randomBytes||E1,h=n.adjustScalarBytes||(X=>X),y=n.domain||((X,Z,ae)=>{if(so(ae,"phflag"),Z.length||ae)throw new Error("Contexts/pre-hash are not supported");return X});function _(X){return u.create(Fc(X))}function A(X){const Z=K.secretKey;X=Jn("private key",X,Z);const ae=Jn("hashed private key",t(X),2*Z),ce=h(ae.slice(0,Z)),N=ae.slice(Z,2*Z),g=_(ce);return{head:ce,prefix:N,scalar:g}}function D(X){const{head:Z,prefix:ae,scalar:ce}=A(X),N=o.multiply(ce),g=N.toBytes();return{head:Z,prefix:ae,scalar:ce,point:N,pointBytes:g}}function U(X){return D(X).pointBytes}function L(X=Uint8Array.of(),...Z){const ae=Zi(...Z);return _(t(y(ae,Jn("context",X),!!i)))}function k(X,Z,ae={}){X=Jn("message",X),i&&(X=i(X));const{prefix:ce,scalar:N,pointBytes:g}=D(Z),v=L(ae.context,ce,X),E=o.multiply(v).toBytes(),B=L(ae.context,E,g,X),z=u.create(v+B*N);if(!u.isValid(z))throw new Error("sign failed: invalid s");const G=Zi(E,u.toBytes(z));return Pi(G,K.signature,"result")}const j={zip215:!0};function M(X,Z,ae,ce=j){const{context:N,zip215:g}=ce,v=K.signature;X=Jn("signature",X,v),Z=Jn("message",Z),ae=Jn("publicKey",ae,K.publicKey),g!==void 0&&so(g,"zip215"),i&&(Z=i(Z));const E=v/2,B=X.subarray(0,E),z=Fc(X.subarray(E,v));let G,J,T;try{G=e.fromBytes(ae,g),J=e.fromBytes(B,g),T=o.multiplyUnsafe(z)}catch{return!1}if(!g&&G.isSmallOrder())return!1;const m=L(N,J.toBytes(),G.toBytes(),Z);return J.add(G.multiplyUnsafe(m)).subtract(T).clearCofactor().is0()}const W=l.BYTES,K={secretKey:W,publicKey:W,signature:2*W,seed:W};function se(X=f(K.seed)){return Pi(X,K.seed,"seed")}function re(X){const Z=we.randomSecretKey(X);return{secretKey:Z,publicKey:U(Z)}}function te(X){return au(X)&&X.length===u.BYTES}function pe(X,Z){try{return!!e.fromBytes(X,Z)}catch{return!1}}const we={getExtendedPublicKey:D,randomSecretKey:se,isValidSecretKey:te,isValidPublicKey:pe,toMontgomery(X){const{y:Z}=e.fromBytes(X),ae=K.publicKey,ce=ae===32;if(!ce&&ae!==57)throw new Error("only defined for 25519 and 448");const N=ce?l.div(pr+Z,pr-Z):l.div(Z-pr,Z+pr);return l.toBytes(N)},toMontgomerySecret(X){const Z=K.secretKey;Pi(X,Z);const ae=t(X.subarray(0,Z));return h(ae).subarray(0,Z)},randomPrivateKey:se,precompute(X=8,Z=e.BASE){return Z.precompute(X,!1)}};return Object.freeze({keygen:re,getPublicKey:U,sign:k,verify:M,utils:we,Point:e,lengths:K})}function i7(e){const t={a:e.a,d:e.d,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp,i=uo(t.n,e.nBitLength,!0),o={Fp:n,Fn:i,uvRatio:e.uvRatio},l={randomBytes:e.randomBytes,adjustScalarBytes:e.adjustScalarBytes,domain:e.domain,prehash:e.prehash,mapToCurve:e.mapToCurve};return{CURVE:t,curveOpts:o,hash:e.hash,eddsaOpts:l}}function s7(e,t){const n=t.Point;return Object.assign({},t,{ExtendedPoint:n,CURVE:e,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function a7(e){const{CURVE:t,curveOpts:n,hash:i,eddsaOpts:o}=i7(e),l=n7(t,n),u=r7(l,i,o);return s7(e,u)}const o7=BigInt(1),Qv=BigInt(2);BigInt(3);const l7=BigInt(5),c7=BigInt(8),T1=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),s2={p:T1,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:c7,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function u7(e){const t=BigInt(10),n=BigInt(20),i=BigInt(40),o=BigInt(80),l=T1,f=e*e%l*e%l,h=Zn(f,Qv,l)*f%l,y=Zn(h,o7,l)*e%l,_=Zn(y,l7,l)*y%l,A=Zn(_,t,l)*_%l,D=Zn(A,n,l)*A%l,U=Zn(D,i,l)*D%l,L=Zn(U,o,l)*U%l,k=Zn(L,o,l)*U%l,j=Zn(k,t,l)*_%l;return{pow_p_5_8:Zn(j,Qv,l)*e%l,b2:f}}
vendor: 44,996 bytes, line 33
33function f7(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const ex=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function d7(e,t){const n=T1,i=cr(t*t*t,n),o=cr(i*i*t,n),l=u7(e*o).pow_p_5_8;let u=cr(e*i*l,n);const f=cr(t*u*u,n),h=u,y=cr(u*ex,n),_=f===e,A=f===cr(-e,n),D=f===cr(-e*ex,n);return _&&(u=h),(A||D)&&(u=y),$R(u,n)&&(u=cr(-u,n)),{isValid:_||A,value:u}}const h7=uo(s2.p,{isLE:!0}),p7={...s2,Fp:h7,hash:LR,adjustScalarBytes:f7,uvRatio:d7},_l=a7(p7);var Wf={exports:{}},g7=Wf.exports,tx;function a2(){return tx||(tx=1,(function(e){(function(t,n){function i(N,g){if(!N)throw new Error(g||"Assertion failed")}function o(N,g){N.super_=g;var v=function(){};v.prototype=g.prototype,N.prototype=new v,N.prototype.constructor=N}function l(N,g,v){if(l.isBN(N))return N;this.negative=0,this.words=null,this.length=0,this.red=null,N!==null&&((g==="le"||g==="be")&&(v=g,g=10),this._init(N||0,g||10,v||"be"))}typeof t=="object"?t.exports=l:n.BN=l,l.BN=l,l.wordSize=26;var u;try{typeof window<"u"&&typeof window.Buffer<"u"?u=window.Buffer:u=qE.Buffer}catch{}l.isBN=function(g){return g instanceof l?!0:g!==null&&typeof g=="object"&&g.constructor.wordSize===l.wordSize&&Array.isArray(g.words)},l.max=function(g,v){return g.cmp(v)>0?g:v},l.min=function(g,v){return g.cmp(v)<0?g:v},l.prototype._init=function(g,v,E){if(typeof g=="number")return this._initNumber(g,v,E);if(typeof g=="object")return this._initArray(g,v,E);v==="hex"&&(v=16),i(v===(v|0)&&v>=2&&v<=36),g=g.toString().replace(/\s+/g,"");var B=0;g[0]==="-"&&(B++,this.negative=1),B<g.length&&(v===16?this._parseHex(g,B,E):(this._parseBase(g,v,B),E==="le"&&this._initArray(this.toArray(),v,E)))},l.prototype._initNumber=function(g,v,E){g<0&&(this.negative=1,g=-g),g<67108864?(this.words=[g&67108863],this.length=1):g<4503599627370496?(this.words=[g&67108863,g/67108864&67108863],this.length=2):(i(g<9007199254740992),this.words=[g&67108863,g/67108864&67108863,1],this.length=3),E==="le"&&this._initArray(this.toArray(),v,E)},l.prototype._initArray=function(g,v,E){if(i(typeof g.length=="number"),g.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(g.length/3),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var z,G,J=0;if(E==="be")for(B=g.length-1,z=0;B>=0;B-=3)G=g[B]|g[B-1]<<8|g[B-2]<<16,this.words[z]|=G<<J&67108863,this.words[z+1]=G>>>26-J&67108863,J+=24,J>=26&&(J-=26,z++);else if(E==="le")for(B=0,z=0;B<g.length;B+=3)G=g[B]|g[B+1]<<8|g[B+2]<<16,this.words[z]|=G<<J&67108863,this.words[z+1]=G>>>26-J&67108863,J+=24,J>=26&&(J-=26,z++);return this._strip()};function f(N,g){var v=N.charCodeAt(g);if(v>=48&&v<=57)return v-48;if(v>=65&&v<=70)return v-55;if(v>=97&&v<=102)return v-87;i(!1,"Invalid character in "+N)}function h(N,g,v){var E=f(N,v);return v-1>=g&&(E|=f(N,v-1)<<4),E}l.prototype._parseHex=function(g,v,E){this.length=Math.ceil((g.length-v)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var z=0,G=0,J;if(E==="be")for(B=g.length-1;B>=v;B-=2)J=h(g,v,B)<<z,this.words[G]|=J&67108863,z>=18?(z-=18,G+=1,this.words[G]|=J>>>26):z+=8;else{var T=g.length-v;for(B=T%2===0?v+1:v;B<g.length;B+=2)J=h(g,v,B)<<z,this.words[G]|=J&67108863,z>=18?(z-=18,G+=1,this.words[G]|=J>>>26):z+=8}this._strip()};function y(N,g,v,E){for(var B=0,z=0,G=Math.min(N.length,v),J=g;J<G;J++){var T=N.charCodeAt(J)-48;B*=E,T>=49?z=T-49+10:T>=17?z=T-17+10:z=T,i(T>=0&&z<E,"Invalid character"),B+=z}return B}l.prototype._parseBase=function(g,v,E){this.words=[0],this.length=1;for(var B=0,z=1;z<=67108863;z*=v)B++;B--,z=z/v|0;for(var G=g.length-E,J=G%B,T=Math.min(G,G-J)+E,m=0,b=E;b<T;b+=B)m=y(g,b,b+B,v),this.imuln(z),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(J!==0){var O=1;for(m=y(g,b,g.length,v),b=0;b<J;b++)O*=v;this.imuln(O),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},l.prototype.copy=function(g){g.words=new Array(this.length);for(var v=0;v<this.length;v++)g.words[v]=this.words[v];g.length=this.length,g.negative=this.negative,g.red=this.red};function _(N,g){N.words=g.words,N.length=g.length,N.negative=g.negative,N.red=g.red}if(l.prototype._move=function(g){_(g,this)},l.prototype.clone=function(){var g=new l(null);return this.copy(g),g},l.prototype._expand=function(g){for(;this.length<g;)this.words[this.length++]=0;return this},l.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},l.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{l.prototype[Symbol.for("nodejs.util.inspect.custom")]=A}catch{l.prototype.inspect=A}else l.prototype.inspect=A;function A(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var D=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],U=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],L=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];l.prototype.toString=function(g,v){g=g||10,v=v|0||1;var E;if(g===16||g==="hex"){E="";for(var B=0,z=0,G=0;G<this.length;G++){var J=this.words[G],T=((J<<B|z)&16777215).toString(16);z=J>>>24-B&16777215,B+=2,B>=26&&(B-=26,G--),z!==0||G!==this.length-1?E=D[6-T.length]+T+E:E=T+E}for(z!==0&&(E=z.toString(16)+E);E.length%v!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(g===(g|0)&&g>=2&&g<=36){var m=U[g],b=L[g];E="";var O=this.clone();for(O.negative=0;!O.isZero();){var P=O.modrn(b).toString(g);O=O.idivn(b),O.isZero()?E=P+E:E=D[m-P.length]+P+E}for(this.isZero()&&(E="0"+E);E.length%v!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}i(!1,"Base should be between 2 and 36")},l.prototype.toNumber=function(){var g=this.words[0];return this.length===2?g+=this.words[1]*67108864:this.length===3&&this.words[2]===1?g+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-g:g},l.prototype.toJSON=function(){return this.toString(16,2)},u&&(l.prototype.toBuffer=function(g,v){return this.toArrayLike(u,g,v)}),l.prototype.toArray=function(g,v){return this.toArrayLike(Array,g,v)};var k=function(g,v){return g.allocUnsafe?g.allocUnsafe(v):new g(v)};l.prototype.toArrayLike=function(g,v,E){this._strip();var B=this.byteLength(),z=E||Math.max(1,B);i(B<=z,"byte array longer than desired length"),i(z>0,"Requested array length <= 0");var G=k(g,z),J=v==="le"?"LE":"BE";return this["_toArrayLike"+J](G,B),G},l.prototype._toArrayLikeLE=function(g,v){for(var E=0,B=0,z=0,G=0;z<this.length;z++){var J=this.words[z]<<G|B;g[E++]=J&255,E<g.length&&(g[E++]=J>>8&255),E<g.length&&(g[E++]=J>>16&255),G===6?(E<g.length&&(g[E++]=J>>24&255),B=0,G=0):(B=J>>>24,G+=2)}if(E<g.length)for(g[E++]=B;E<g.length;)g[E++]=0},l.prototype._toArrayLikeBE=function(g,v){for(var E=g.length-1,B=0,z=0,G=0;z<this.length;z++){var J=this.words[z]<<G|B;g[E--]=J&255,E>=0&&(g[E--]=J>>8&255),E>=0&&(g[E--]=J>>16&255),G===6?(E>=0&&(g[E--]=J>>24&255),B=0,G=0):(B=J>>>24,G+=2)}if(E>=0)for(g[E--]=B;E>=0;)g[E--]=0},Math.clz32?l.prototype._countBits=function(g){return 32-Math.clz32(g)}:l.prototype._countBits=function(g){var v=g,E=0;return v>=4096&&(E+=13,v>>>=13),v>=64&&(E+=7,v>>>=7),v>=8&&(E+=4,v>>>=4),v>=2&&(E+=2,v>>>=2),E+v},l.prototype._zeroBits=function(g){if(g===0)return 26;var v=g,E=0;return(v&8191)===0&&(E+=13,v>>>=13),(v&127)===0&&(E+=7,v>>>=7),(v&15)===0&&(E+=4,v>>>=4),(v&3)===0&&(E+=2,v>>>=2),(v&1)===0&&E++,E},l.prototype.bitLength=function(){var g=this.words[this.length-1],v=this._countBits(g);return(this.length-1)*26+v};function j(N){for(var g=new Array(N.bitLength()),v=0;v<g.length;v++){var E=v/26|0,B=v%26;g[v]=N.words[E]>>>B&1}return g}l.prototype.zeroBits=function(){if(this.isZero())return 0;for(var g=0,v=0;v<this.length;v++){var E=this._zeroBits(this.words[v]);if(g+=E,E!==26)break}return g},l.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},l.prototype.toTwos=function(g){return this.negative!==0?this.abs().inotn(g).iaddn(1):this.clone()},l.prototype.fromTwos=function(g){return this.testn(g-1)?this.notn(g).iaddn(1).ineg():this.clone()},l.prototype.isNeg=function(){return this.negative!==0},l.prototype.neg=function(){return this.clone().ineg()},l.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},l.prototype.iuor=function(g){for(;this.length<g.length;)this.words[this.length++]=0;for(var v=0;v<g.length;v++)this.words[v]=this.words[v]|g.words[v];return this._strip()},l.prototype.ior=function(g){return i((this.negative|g.negative)===0),this.iuor(g)},l.prototype.or=function(g){return this.length>g.length?this.clone().ior(g):g.clone().ior(this)},l.prototype.uor=function(g){return this.length>g.length?this.clone().iuor(g):g.clone().iuor(this)},l.prototype.iuand=function(g){var v;this.length>g.length?v=g:v=this;for(var E=0;E<v.length;E++)this.words[E]=this.words[E]&g.words[E];return this.length=v.length,this._strip()},l.prototype.iand=function(g){return i((this.negative|g.negative)===0),this.iuand(g)},l.prototype.and=function(g){return this.length>g.length?this.clone().iand(g):g.clone().iand(this)},l.prototype.uand=function(g){return this.length>g.length?this.clone().iuand(g):g.clone().iuand(this)},l.prototype.iuxor=function(g){var v,E;this.length>g.length?(v=this,E=g):(v=g,E=this);for(var B=0;B<E.length;B++)this.words[B]=v.words[B]^E.words[B];if(this!==v)for(;B<v.length;B++)this.words[B]=v.words[B];return this.length=v.length,this._strip()},l.prototype.ixor=function(g){return i((this.negative|g.negative)===0),this.iuxor(g)},l.prototype.xor=function(g){return this.length>g.length?this.clone().ixor(g):g.clone().ixor(this)},l.prototype.uxor=function(g){return this.length>g.length?this.clone().iuxor(g):g.clone().iuxor(this)},l.prototype.inotn=function(g){i(typeof g=="number"&&g>=0);var v=Math.ceil(g/26)|0,E=g%26;this._expand(v),E>0&&v--;for(var B=0;B<v;B++)this.words[B]=~this.words[B]&67108863;return E>0&&(this.words[B]=~this.words[B]&67108863>>26-E),this._strip()},l.prototype.notn=function(g){return this.clone().inotn(g)},l.prototype.setn=function(g,v){i(typeof g=="number"&&g>=0);var E=g/26|0,B=g%26;return this._expand(E+1),v?this.words[E]=this.words[E]|1<<B:this.words[E]=this.words[E]&~(1<<B),this._strip()},l.prototype.iadd=function(g){var v;if(this.negative!==0&&g.negative===0)return this.negative=0,v=this.isub(g),this.negative^=1,this._normSign();if(this.negative===0&&g.negative!==0)return g.negative=0,v=this.isub(g),g.negative=1,v._normSign();var E,B;this.length>g.length?(E=this,B=g):(E=g,B=this);for(var z=0,G=0;G<B.length;G++)v=(E.words[G]|0)+(B.words[G]|0)+z,this.words[G]=v&67108863,z=v>>>26;for(;z!==0&&G<E.length;G++)v=(E.words[G]|0)+z,this.words[G]=v&67108863,z=v>>>26;if(this.length=E.length,z!==0)this.words[this.length]=z,this.length++;else if(E!==this)for(;G<E.length;G++)this.words[G]=E.words[G];return this},l.prototype.add=function(g){var v;return g.negative!==0&&this.negative===0?(g.negative=0,v=this.sub(g),g.negative^=1,v):g.negative===0&&this.negative!==0?(this.negative=0,v=g.sub(this),this.negative=1,v):this.length>g.length?this.clone().iadd(g):g.clone().iadd(this)},l.prototype.isub=function(g){if(g.negative!==0){g.negative=0;var v=this.iadd(g);return g.negative=1,v._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(g),this.negative=1,this._normSign();var E=this.cmp(g);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,z;E>0?(B=this,z=g):(B=g,z=this);for(var G=0,J=0;J<z.length;J++)v=(B.words[J]|0)-(z.words[J]|0)+G,G=v>>26,this.words[J]=v&67108863;for(;G!==0&&J<B.length;J++)v=(B.words[J]|0)+G,G=v>>26,this.words[J]=v&67108863;if(G===0&&J<B.length&&B!==this)for(;J<B.length;J++)this.words[J]=B.words[J];return this.length=Math.max(this.length,J),B!==this&&(this.negative=1),this._strip()},l.prototype.sub=function(g){return this.clone().isub(g)};function M(N,g,v){v.negative=g.negative^N.negative;var E=N.length+g.length|0;v.length=E,E=E-1|0;var B=N.words[0]|0,z=g.words[0]|0,G=B*z,J=G&67108863,T=G/67108864|0;v.words[0]=J;for(var m=1;m<E;m++){for(var b=T>>>26,O=T&67108863,P=Math.min(m,g.length-1),ne=Math.max(0,m-N.length+1);ne<=P;ne++){var ue=m-ne|0;B=N.words[ue]|0,z=g.words[ne]|0,G=B*z+O,b+=G/67108864|0,O=G&67108863}v.words[m]=O|0,T=b|0}return T!==0?v.words[m]=T|0:v.length--,v._strip()}var W=function(g,v,E){var B=g.words,z=v.words,G=E.words,J=0,T,m,b,O=B[0]|0,P=O&8191,ne=O>>>13,ue=B[1]|0,Te=ue&8191,ve=ue>>>13,Xe=B[2]|0,mt=Xe&8191,He=Xe>>>13,At=B[3]|0,tt=At&8191,Rt=At>>>13,qn=B[4]|0,Bt=qn&8191,Ze=qn>>>13,an=B[5]|0,jt=an&8191,Lt=an>>>13,jn=B[6]|0,Fe=jn&8191,qe=jn>>>13,Yt=B[7]|0,Wt=Yt&8191,H=Yt>>>13,S=B[8]|0,I=S&8191,Y=S>>>13,ge=B[9]|0,be=ge&8191,Re=ge>>>13,ft=z[0]|0,dt=ft&8191,rt=ft>>>13,Zt=z[1]|0,pt=Zt&8191,gn=Zt>>>13,Di=z[2]|0,vn=Di&8191,In=Di>>>13,yi=z[3]|0,on=yi&8191,un=yi>>>13,Oi=z[4]|0,Tn=Oi&8191,xn=Oi>>>13,Ni=z[5]|0,Ln=Ni&8191,Xt=Ni>>>13,Os=z[6]|0,C=Os&8191,V=Os>>>13,F=z[7]|0,x=F&8191,$=F>>>13,me=z[8]|0,he=me&8191,Ie=me>>>13,Ve=z[9]|0,$e=Ve&8191,Ke=Ve>>>13;E.negative=g.negative^v.negative,E.length=19,T=Math.imul(P,dt),m=Math.imul(P,rt),m=m+Math.imul(ne,dt)|0,b=Math.imul(ne,rt);var Gt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,T=Math.imul(Te,dt),m=Math.imul(Te,rt),m=m+Math.imul(ve,dt)|0,b=Math.imul(ve,rt),T=T+Math.imul(P,pt)|0,m=m+Math.imul(P,gn)|0,m=m+Math.imul(ne,pt)|0,b=b+Math.imul(ne,gn)|0;var et=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(et>>>26)|0,et&=67108863,T=Math.imul(mt,dt),m=Math.imul(mt,rt),m=m+Math.imul(He,dt)|0,b=Math.imul(He,rt),T=T+Math.imul(Te,pt)|0,m=m+Math.imul(Te,gn)|0,m=m+Math.imul(ve,pt)|0,b=b+Math.imul(ve,gn)|0,T=T+Math.imul(P,vn)|0,m=m+Math.imul(P,In)|0,m=m+Math.imul(ne,vn)|0,b=b+Math.imul(ne,In)|0;var gt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(gt>>>26)|0,gt&=67108863,T=Math.imul(tt,dt),m=Math.imul(tt,rt),m=m+Math.imul(Rt,dt)|0,b=Math.imul(Rt,rt),T=T+Math.imul(mt,pt)|0,m=m+Math.imul(mt,gn)|0,m=m+Math.imul(He,pt)|0,b=b+Math.imul(He,gn)|0,T=T+Math.imul(Te,vn)|0,m=m+Math.imul(Te,In)|0,m=m+Math.imul(ve,vn)|0,b=b+Math.imul(ve,In)|0,T=T+Math.imul(P,on)|0,m=m+Math.imul(P,un)|0,m=m+Math.imul(ne,on)|0,b=b+Math.imul(ne,un)|0;var xt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(xt>>>26)|0,xt&=67108863,T=Math.imul(Bt,dt),m=Math.imul(Bt,rt),m=m+Math.imul(Ze,dt)|0,b=Math.imul(Ze,rt),T=T+Math.imul(tt,pt)|0,m=m+Math.imul(tt,gn)|0,m=m+Math.imul(Rt,pt)|0,b=b+Math.imul(Rt,gn)|0,T=T+Math.imul(mt,vn)|0,m=m+Math.imul(mt,In)|0,m=m+Math.imul(He,vn)|0,b=b+Math.imul(He,In)|0,T=T+Math.imul(Te,on)|0,m=m+Math.imul(Te,un)|0,m=m+Math.imul(ve,on)|0,b=b+Math.imul(ve,un)|0,T=T+Math.imul(P,Tn)|0,m=m+Math.imul(P,xn)|0,m=m+Math.imul(ne,Tn)|0,b=b+Math.imul(ne,xn)|0;var _t=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(_t>>>26)|0,_t&=67108863,T=Math.imul(jt,dt),m=Math.imul(jt,rt),m=m+Math.imul(Lt,dt)|0,b=Math.imul(Lt,rt),T=T+Math.imul(Bt,pt)|0,m=m+Math.imul(Bt,gn)|0,m=m+Math.imul(Ze,pt)|0,b=b+Math.imul(Ze,gn)|0,T=T+Math.imul(tt,vn)|0,m=m+Math.imul(tt,In)|0,m=m+Math.imul(Rt,vn)|0,b=b+Math.imul(Rt,In)|0,T=T+Math.imul(mt,on)|0,m=m+Math.imul(mt,un)|0,m=m+Math.imul(He,on)|0,b=b+Math.imul(He,un)|0,T=T+Math.imul(Te,Tn)|0,m=m+Math.imul(Te,xn)|0,m=m+Math.imul(ve,Tn)|0,b=b+Math.imul(ve,xn)|0,T=T+Math.imul(P,Ln)|0,m=m+Math.imul(P,Xt)|0,m=m+Math.imul(ne,Ln)|0,b=b+Math.imul(ne,Xt)|0;var Et=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Et>>>26)|0,Et&=67108863,T=Math.imul(Fe,dt),m=Math.imul(Fe,rt),m=m+Math.imul(qe,dt)|0,b=Math.imul(qe,rt),T=T+Math.imul(jt,pt)|0,m=m+Math.imul(jt,gn)|0,m=m+Math.imul(Lt,pt)|0,b=b+Math.imul(Lt,gn)|0,T=T+Math.imul(Bt,vn)|0,m=m+Math.imul(Bt,In)|0,m=m+Math.imul(Ze,vn)|0,b=b+Math.imul(Ze,In)|0,T=T+Math.imul(tt,on)|0,m=m+Math.imul(tt,un)|0,m=m+Math.imul(Rt,on)|0,b=b+Math.imul(Rt,un)|0,T=T+Math.imul(mt,Tn)|0,m=m+Math.imul(mt,xn)|0,m=m+Math.imul(He,Tn)|0,b=b+Math.imul(He,xn)|0,T=T+Math.imul(Te,Ln)|0,m=m+Math.imul(Te,Xt)|0,m=m+Math.imul(ve,Ln)|0,b=b+Math.imul(ve,Xt)|0,T=T+Math.imul(P,C)|0,m=m+Math.imul(P,V)|0,m=m+Math.imul(ne,C)|0,b=b+Math.imul(ne,V)|0;var yt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(yt>>>26)|0,yt&=67108863,T=Math.imul(Wt,dt),m=Math.imul(Wt,rt),m=m+Math.imul(H,dt)|0,b=Math.imul(H,rt),T=T+Math.imul(Fe,pt)|0,m=m+Math.imul(Fe,gn)|0,m=m+Math.imul(qe,pt)|0,b=b+Math.imul(qe,gn)|0,T=T+Math.imul(jt,vn)|0,m=m+Math.imul(jt,In)|0,m=m+Math.imul(Lt,vn)|0,b=b+Math.imul(Lt,In)|0,T=T+Math.imul(Bt,on)|0,m=m+Math.imul(Bt,un)|0,m=m+Math.imul(Ze,on)|0,b=b+Math.imul(Ze,un)|0,T=T+Math.imul(tt,Tn)|0,m=m+Math.imul(tt,xn)|0,m=m+Math.imul(Rt,Tn)|0,b=b+Math.imul(Rt,xn)|0,T=T+Math.imul(mt,Ln)|0,m=m+Math.imul(mt,Xt)|0,m=m+Math.imul(He,Ln)|0,b=b+Math.imul(He,Xt)|0,T=T+Math.imul(Te,C)|0,m=m+Math.imul(Te,V)|0,m=m+Math.imul(ve,C)|0,b=b+Math.imul(ve,V)|0,T=T+Math.imul(P,x)|0,m=m+Math.imul(P,$)|0,m=m+Math.imul(ne,x)|0,b=b+Math.imul(ne,$)|0;var wt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(wt>>>26)|0,wt&=67108863,T=Math.imul(I,dt),m=Math.imul(I,rt),m=m+Math.imul(Y,dt)|0,b=Math.imul(Y,rt),T=T+Math.imul(Wt,pt)|0,m=m+Math.imul(Wt,gn)|0,m=m+Math.imul(H,pt)|0,b=b+Math.imul(H,gn)|0,T=T+Math.imul(Fe,vn)|0,m=m+Math.imul(Fe,In)|0,m=m+Math.imul(qe,vn)|0,b=b+Math.imul(qe,In)|0,T=T+Math.imul(jt,on)|0,m=m+Math.imul(jt,un)|0,m=m+Math.imul(Lt,on)|0,b=b+Math.imul(Lt,un)|0,T=T+Math.imul(Bt,Tn)|0,m=m+Math.imul(Bt,xn)|0,m=m+Math.imul(Ze,Tn)|0,b=b+Math.imul(Ze,xn)|0,T=T+Math.imul(tt,Ln)|0,m=m+Math.imul(tt,Xt)|0,m=m+Math.imul(Rt,Ln)|0,b=b+Math.imul(Rt,Xt)|0,T=T+Math.imul(mt,C)|0,m=m+Math.imul(mt,V)|0,m=m+Math.imul(He,C)|0,b=b+Math.imul(He,V)|0,T=T+Math.imul(Te,x)|0,m=m+Math.imul(Te,$)|0,m=m+Math.imul(ve,x)|0,b=b+Math.imul(ve,$)|0,T=T+Math.imul(P,he)|0,m=m+Math.imul(P,Ie)|0,m=m+Math.imul(ne,he)|0,b=b+Math.imul(ne,Ie)|0;var st=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(st>>>26)|0,st&=67108863,T=Math.imul(be,dt),m=Math.imul(be,rt),m=m+Math.imul(Re,dt)|0,b=Math.imul(Re,rt),T=T+Math.imul(I,pt)|0,m=m+Math.imul(I,gn)|0,m=m+Math.imul(Y,pt)|0,b=b+Math.imul(Y,gn)|0,T=T+Math.imul(Wt,vn)|0,m=m+Math.imul(Wt,In)|0,m=m+Math.imul(H,vn)|0,b=b+Math.imul(H,In)|0,T=T+Math.imul(Fe,on)|0,m=m+Math.imul(Fe,un)|0,m=m+Math.imul(qe,on)|0,b=b+Math.imul(qe,un)|0,T=T+Math.imul(jt,Tn)|0,m=m+Math.imul(jt,xn)|0,m=m+Math.imul(Lt,Tn)|0,b=b+Math.imul(Lt,xn)|0,T=T+Math.imul(Bt,Ln)|0,m=m+Math.imul(Bt,Xt)|0,m=m+Math.imul(Ze,Ln)|0,b=b+Math.imul(Ze,Xt)|0,T=T+Math.imul(tt,C)|0,m=m+Math.imul(tt,V)|0,m=m+Math.imul(Rt,C)|0,b=b+Math.imul(Rt,V)|0,T=T+Math.imul(mt,x)|0,m=m+Math.imul(mt,$)|0,m=m+Math.imul(He,x)|0,b=b+Math.imul(He,$)|0,T=T+Math.imul(Te,he)|0,m=m+Math.imul(Te,Ie)|0,m=m+Math.imul(ve,he)|0,b=b+Math.imul(ve,Ie)|0,T=T+Math.imul(P,$e)|0,m=m+Math.imul(P,Ke)|0,m=m+Math.imul(ne,$e)|0,b=b+Math.imul(ne,Ke)|0;var nt=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(nt>>>26)|0,nt&=67108863,T=Math.imul(be,pt),m=Math.imul(be,gn),m=m+Math.imul(Re,pt)|0,b=Math.imul(Re,gn),T=T+Math.imul(I,vn)|0,m=m+Math.imul(I,In)|0,m=m+Math.imul(Y,vn)|0,b=b+Math.imul(Y,In)|0,T=T+Math.imul(Wt,on)|0,m=m+Math.imul(Wt,un)|0,m=m+Math.imul(H,on)|0,b=b+Math.imul(H,un)|0,T=T+Math.imul(Fe,Tn)|0,m=m+Math.imul(Fe,xn)|0,m=m+Math.imul(qe,Tn)|0,b=b+Math.imul(qe,xn)|0,T=T+Math.imul(jt,Ln)|0,m=m+Math.imul(jt,Xt)|0,m=m+Math.imul(Lt,Ln)|0,b=b+Math.imul(Lt,Xt)|0,T=T+Math.imul(Bt,C)|0,m=m+Math.imul(Bt,V)|0,m=m+Math.imul(Ze,C)|0,b=b+Math.imul(Ze,V)|0,T=T+Math.imul(tt,x)|0,m=m+Math.imul(tt,$)|0,m=m+Math.imul(Rt,x)|0,b=b+Math.imul(Rt,$)|0,T=T+Math.imul(mt,he)|0,m=m+Math.imul(mt,Ie)|0,m=m+Math.imul(He,he)|0,b=b+Math.imul(He,Ie)|0,T=T+Math.imul(Te,$e)|0,m=m+Math.imul(Te,Ke)|0,m=m+Math.imul(ve,$e)|0,b=b+Math.imul(ve,Ke)|0;var ut=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(ut>>>26)|0,ut&=67108863,T=Math.imul(be,vn),m=Math.imul(be,In),m=m+Math.imul(Re,vn)|0,b=Math.imul(Re,In),T=T+Math.imul(I,on)|0,m=m+Math.imul(I,un)|0,m=m+Math.imul(Y,on)|0,b=b+Math.imul(Y,un)|0,T=T+Math.imul(Wt,Tn)|0,m=m+Math.imul(Wt,xn)|0,m=m+Math.imul(H,Tn)|0,b=b+Math.imul(H,xn)|0,T=T+Math.imul(Fe,Ln)|0,m=m+Math.imul(Fe,Xt)|0,m=m+Math.imul(qe,Ln)|0,b=b+Math.imul(qe,Xt)|0,T=T+Math.imul(jt,C)|0,m=m+Math.imul(jt,V)|0,m=m+Math.imul(Lt,C)|0,b=b+Math.imul(Lt,V)|0,T=T+Math.imul(Bt,x)|0,m=m+Math.imul(Bt,$)|0,m=m+Math.imul(Ze,x)|0,b=b+Math.imul(Ze,$)|0,T=T+Math.imul(tt,he)|0,m=m+Math.imul(tt,Ie)|0,m=m+Math.imul(Rt,he)|0,b=b+Math.imul(Rt,Ie)|0,T=T+Math.imul(mt,$e)|0,m=m+Math.imul(mt,Ke)|0,m=m+Math.imul(He,$e)|0,b=b+Math.imul(He,Ke)|0;var Ge=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,T=Math.imul(be,on),m=Math.imul(be,un),m=m+Math.imul(Re,on)|0,b=Math.imul(Re,un),T=T+Math.imul(I,Tn)|0,m=m+Math.imul(I,xn)|0,m=m+Math.imul(Y,Tn)|0,b=b+Math.imul(Y,xn)|0,T=T+Math.imul(Wt,Ln)|0,m=m+Math.imul(Wt,Xt)|0,m=m+Math.imul(H,Ln)|0,b=b+Math.imul(H,Xt)|0,T=T+Math.imul(Fe,C)|0,m=m+Math.imul(Fe,V)|0,m=m+Math.imul(qe,C)|0,b=b+Math.imul(qe,V)|0,T=T+Math.imul(jt,x)|0,m=m+Math.imul(jt,$)|0,m=m+Math.imul(Lt,x)|0,b=b+Math.imul(Lt,$)|0,T=T+Math.imul(Bt,he)|0,m=m+Math.imul(Bt,Ie)|0,m=m+Math.imul(Ze,he)|0,b=b+Math.imul(Ze,Ie)|0,T=T+Math.imul(tt,$e)|0,m=m+Math.imul(tt,Ke)|0,m=m+Math.imul(Rt,$e)|0,b=b+Math.imul(Rt,Ke)|0;var Qe=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,T=Math.imul(be,Tn),m=Math.imul(be,xn),m=m+Math.imul(Re,Tn)|0,b=Math.imul(Re,xn),T=T+Math.imul(I,Ln)|0,m=m+Math.imul(I,Xt)|0,m=m+Math.imul(Y,Ln)|0,b=b+Math.imul(Y,Xt)|0,T=T+Math.imul(Wt,C)|0,m=m+Math.imul(Wt,V)|0,m=m+Math.imul(H,C)|0,b=b+Math.imul(H,V)|0,T=T+Math.imul(Fe,x)|0,m=m+Math.imul(Fe,$)|0,m=m+Math.imul(qe,x)|0,b=b+Math.imul(qe,$)|0,T=T+Math.imul(jt,he)|0,m=m+Math.imul(jt,Ie)|0,m=m+Math.imul(Lt,he)|0,b=b+Math.imul(Lt,Ie)|0,T=T+Math.imul(Bt,$e)|0,m=m+Math.imul(Bt,Ke)|0,m=m+Math.imul(Ze,$e)|0,b=b+Math.imul(Ze,Ke)|0;var at=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(at>>>26)|0,at&=67108863,T=Math.imul(be,Ln),m=Math.imul(be,Xt),m=m+Math.imul(Re,Ln)|0,b=Math.imul(Re,Xt),T=T+Math.imul(I,C)|0,m=m+Math.imul(I,V)|0,m=m+Math.imul(Y,C)|0,b=b+Math.imul(Y,V)|0,T=T+Math.imul(Wt,x)|0,m=m+Math.imul(Wt,$)|0,m=m+Math.imul(H,x)|0,b=b+Math.imul(H,$)|0,T=T+Math.imul(Fe,he)|0,m=m+Math.imul(Fe,Ie)|0,m=m+Math.imul(qe,he)|0,b=b+Math.imul(qe,Ie)|0,T=T+Math.imul(jt,$e)|0,m=m+Math.imul(jt,Ke)|0,m=m+Math.imul(Lt,$e)|0,b=b+Math.imul(Lt,Ke)|0;var Ye=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Ye>>>26)|0,Ye&=67108863,T=Math.imul(be,C),m=Math.imul(be,V),m=m+Math.imul(Re,C)|0,b=Math.imul(Re,V),T=T+Math.imul(I,x)|0,m=m+Math.imul(I,$)|0,m=m+Math.imul(Y,x)|0,b=b+Math.imul(Y,$)|0,T=T+Math.imul(Wt,he)|0,m=m+Math.imul(Wt,Ie)|0,m=m+Math.imul(H,he)|0,b=b+Math.imul(H,Ie)|0,T=T+Math.imul(Fe,$e)|0,m=m+Math.imul(Fe,Ke)|0,m=m+Math.imul(qe,$e)|0,b=b+Math.imul(qe,Ke)|0;var Ce=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,T=Math.imul(be,x),m=Math.imul(be,$),m=m+Math.imul(Re,x)|0,b=Math.imul(Re,$),T=T+Math.imul(I,he)|0,m=m+Math.imul(I,Ie)|0,m=m+Math.imul(Y,he)|0,b=b+Math.imul(Y,Ie)|0,T=T+Math.imul(Wt,$e)|0,m=m+Math.imul(Wt,Ke)|0,m=m+Math.imul(H,$e)|0,b=b+Math.imul(H,Ke)|0;var Be=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Be>>>26)|0,Be&=67108863,T=Math.imul(be,he),m=Math.imul(be,Ie),m=m+Math.imul(Re,he)|0,b=Math.imul(Re,Ie),T=T+Math.imul(I,$e)|0,m=m+Math.imul(I,Ke)|0,m=m+Math.imul(Y,$e)|0,b=b+Math.imul(Y,Ke)|0;var Le=(J+T|0)+((m&8191)<<13)|0;J=(b+(m>>>13)|0)+(Le>>>26)|0,Le&=67108863,T=Math.imul(be,$e),m=Math.imul(be,Ke),m=m+Math.imul(Re,$e)|0,b=Math.imul(Re,Ke);var Ne=(J+T|0)+((m&8191)<<13)|0;return J=(b+(m>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,G[0]=Gt,G[1]=et,G[2]=gt,G[3]=xt,G[4]=_t,G[5]=Et,G[6]=yt,G[7]=wt,G[8]=st,G[9]=nt,G[10]=ut,G[11]=Ge,G[12]=Qe,G[13]=at,G[14]=Ye,G[15]=Ce,G[16]=Be,G[17]=Le,G[18]=Ne,J!==0&&(G[19]=J,E.length++),E};Math.imul||(W=M);function K(N,g,v){v.negative=g.negative^N.negative,v.length=N.length+g.length;for(var E=0,B=0,z=0;z<v.length-1;z++){var G=B;B=0;for(var J=E&67108863,T=Math.min(z,g.length-1),m=Math.max(0,z-N.length+1);m<=T;m++){var b=z-m,O=N.words[b]|0,P=g.words[m]|0,ne=O*P,ue=ne&67108863;G=G+(ne/67108864|0)|0,ue=ue+J|0,J=ue&67108863,G=G+(ue>>>26)|0,B+=G>>>26,G&=67108863}v.words[z]=J,E=G,G=B}return E!==0?v.words[z]=E:v.length--,v._strip()}function se(N,g,v){return K(N,g,v)}l.prototype.mulTo=function(g,v){var E,B=this.length+g.length;return this.length===10&&g.length===10?E=W(this,g,v):B<63?E=M(this,g,v):B<1024?E=K(this,g,v):E=se(this,g,v),E},l.prototype.mul=function(g){var v=new l(null);return v.words=new Array(this.length+g.length),this.mulTo(g,v)},l.prototype.mulf=function(g){var v=new l(null);return v.words=new Array(this.length+g.length),se(this,g,v)},l.prototype.imul=function(g){return this.clone().mulTo(g,this)},l.prototype.imuln=function(g){var v=g<0;v&&(g=-g),i(typeof g=="number"),i(g<67108864);for(var E=0,B=0;B<this.length;B++){var z=(this.words[B]|0)*g,G=(z&67108863)+(E&67108863);E>>=26,E+=z/67108864|0,E+=G>>>26,this.words[B]=G&67108863}return E!==0&&(this.words[B]=E,this.length++),this.length=g===0?1:this.length,v?this.ineg():this},l.prototype.muln=function(g){return this.clone().imuln(g)},l.prototype.sqr=function(){return this.mul(this)},l.prototype.isqr=function(){return this.imul(this.clone())},l.prototype.pow=function(g){var v=j(g);if(v.length===0)return new l(1);for(var E=this,B=0;B<v.length&&v[B]===0;B++,E=E.sqr());if(++B<v.length)for(var z=E.sqr();B<v.length;B++,z=z.sqr())v[B]!==0&&(E=E.mul(z));return E},l.prototype.iushln=function(g){i(typeof g=="number"&&g>=0);var v=g%26,E=(g-v)/26,B=67108863>>>26-v<<26-v,z;if(v!==0){var G=0;for(z=0;z<this.length;z++){var J=this.words[z]&B,T=(this.words[z]|0)-J<<v;this.words[z]=T|G,G=J>>>26-v}G&&(this.words[z]=G,this.length++)}if(E!==0){for(z=this.length-1;z>=0;z--)this.words[z+E]=this.words[z];for(z=0;z<E;z++)this.words[z]=0;this.length+=E}return this._strip()},l.prototype.ishln=function(g){return i(this.negative===0),this.iushln(g)},l.prototype.iushrn=function(g,v,E){i(typeof g=="number"&&g>=0);var B;v?B=(v-v%26)/26:B=0;var z=g%26,G=Math.min((g-z)/26,this.length),J=67108863^67108863>>>z<<z,T=E;if(B-=G,B=Math.max(0,B),T){for(var m=0;m<G;m++)T.words[m]=this.words[m];T.length=G}if(G!==0)if(this.length>G)for(this.length-=G,m=0;m<this.length;m++)this.words[m]=this.words[m+G];else this.words[0]=0,this.length=1;var b=0;for(m=this.length-1;m>=0&&(b!==0||m>=B);m--){var O=this.words[m]|0;this.words[m]=b<<26-z|O>>>z,b=O&J}return T&&b!==0&&(T.words[T.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},l.prototype.ishrn=function(g,v,E){return i(this.negative===0),this.iushrn(g,v,E)},l.prototype.shln=function(g){return this.clone().ishln(g)},l.prototype.ushln=function(g){return this.clone().iushln(g)},l.prototype.shrn=function(g){return this.clone().ishrn(g)},l.prototype.ushrn=function(g){return this.clone().iushrn(g)},l.prototype.testn=function(g){i(typeof g=="number"&&g>=0);var v=g%26,E=(g-v)/26,B=1<<v;if(this.length<=E)return!1;var z=this.words[E];return!!(z&B)},l.prototype.imaskn=function(g){i(typeof g=="number"&&g>=0);var v=g%26,E=(g-v)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(v!==0&&E++,this.length=Math.min(E,this.length),v!==0){var B=67108863^67108863>>>v<<v;this.words[this.length-1]&=B}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},l.prototype.maskn=function(g){return this.clone().imaskn(g)},l.prototype.iaddn=function(g){return i(typeof g=="number"),i(g<67108864),g<0?this.isubn(-g):this.negative!==0?this.length===1&&(this.words[0]|0)<=g?(this.words[0]=g-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(g),this.negative=1,this):this._iaddn(g)},l.prototype._iaddn=function(g){this.words[0]+=g;for(var v=0;v<this.length&&this.words[v]>=67108864;v++)this.words[v]-=67108864,v===this.length-1?this.words[v+1]=1:this.words[v+1]++;return this.length=Math.max(this.length,v+1),this},l.prototype.isubn=function(g){if(i(typeof g=="number"),i(g<67108864),g<0)return this.iaddn(-g);if(this.negative!==0)return this.negative=0,this.iaddn(g),this.negative=1,this;if(this.words[0]-=g,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var v=0;v<this.length&&this.words[v]<0;v++)this.words[v]+=67108864,this.words[v+1]-=1;return this._strip()},l.prototype.addn=function(g){return this.clone().iaddn(g)},l.prototype.subn=function(g){return this.clone().isubn(g)},l.prototype.iabs=function(){return this.negative=0,this},l.prototype.abs=function(){return this.clone().iabs()},l.prototype._ishlnsubmul=function(g,v,E){var B=g.length+E,z;this._expand(B);var G,J=0;for(z=0;z<g.length;z++){G=(this.words[z+E]|0)+J;var T=(g.words[z]|0)*v;G-=T&67108863,J=(G>>26)-(T/67108864|0),this.words[z+E]=G&67108863}for(;z<this.length-E;z++)G=(this.words[z+E]|0)+J,J=G>>26,this.words[z+E]=G&67108863;if(J===0)return this._strip();for(i(J===-1),J=0,z=0;z<this.length;z++)G=-(this.words[z]|0)+J,J=G>>26,this.words[z]=G&67108863;return this.negative=1,this._strip()},l.prototype._wordDiv=function(g,v){var E=this.length-g.length,B=this.clone(),z=g,G=z.words[z.length-1]|0,J=this._countBits(G);E=26-J,E!==0&&(z=z.ushln(E),B.iushln(E),G=z.words[z.length-1]|0);var T=B.length-z.length,m;if(v!=="mod"){m=new l(null),m.length=T+1,m.words=new Array(m.length);for(var b=0;b<m.length;b++)m.words[b]=0}var O=B.clone()._ishlnsubmul(z,1,T);O.negative===0&&(B=O,m&&(m.words[T]=1));for(var P=T-1;P>=0;P--){var ne=(B.words[z.length+P]|0)*67108864+(B.words[z.length+P-1]|0);for(ne=Math.min(ne/G|0,67108863),B._ishlnsubmul(z,ne,P);B.negative!==0;)ne--,B.negative=0,B._ishlnsubmul(z,1,P),B.isZero()||(B.negative^=1);m&&(m.words[P]=ne)}return m&&m._strip(),B._strip(),v!=="div"&&E!==0&&B.iushrn(E),{div:m||null,mod:B}},l.prototype.divmod=function(g,v,E){if(i(!g.isZero()),this.isZero())return{div:new l(0),mod:new l(0)};var B,z,G;return this.negative!==0&&g.negative===0?(G=this.neg().divmod(g,v),v!=="mod"&&(B=G.div.neg()),v!=="div"&&(z=G.mod.neg(),E&&z.negative!==0&&z.iadd(g)),{div:B,mod:z}):this.negative===0&&g.negative!==0?(G=this.divmod(g.neg(),v),v!=="mod"&&(B=G.div.neg()),{div:B,mod:G.mod}):(this.negative&g.negative)!==0?(G=this.neg().divmod(g.neg(),v),v!=="div"&&(z=G.mod.neg(),E&&z.negative!==0&&z.isub(g)),{div:G.div,mod:z}):g.length>this.length||this.cmp(g)<0?{div:new l(0),mod:this}:g.length===1?v==="div"?{div:this.divn(g.words[0]),mod:null}:v==="mod"?{div:null,mod:new l(this.modrn(g.words[0]))}:{div:this.divn(g.words[0]),mod:new l(this.modrn(g.words[0]))}:this._wordDiv(g,v)},l.prototype.div=function(g){return this.divmod(g,"div",!1).div},l.prototype.mod=function(g){return this.divmod(g,"mod",!1).mod},l.prototype.umod=function(g){return this.divmod(g,"mod",!0).mod},l.prototype.divRound=function(g){var v=this.divmod(g);if(v.mod.isZero())return v.div;var E=v.div.negative!==0?v.mod.isub(g):v.mod,B=g.ushrn(1),z=g.andln(1),G=E.cmp(B);return G<0||z===1&&G===0?v.div:v.div.negative!==0?v.div.isubn(1):v.div.iaddn(1)},l.prototype.modrn=function(g){var v=g<0;v&&(g=-g),i(g<=67108863);for(var E=(1<<26)%g,B=0,z=this.length-1;z>=0;z--)B=(E*B+(this.words[z]|0))%g;return v?-B:B},l.prototype.modn=function(g){return this.modrn(g)},l.prototype.idivn=function(g){var v=g<0;v&&(g=-g),i(g<=67108863);for(var E=0,B=this.length-1;B>=0;B--){var z=(this.words[B]|0)+E*67108864;this.words[B]=z/g|0,E=z%g}return this._strip(),v?this.ineg():this},l.prototype.divn=function(g){return this.clone().idivn(g)},l.prototype.egcd=function(g){i(g.negative===0),i(!g.isZero());var v=this,E=g.clone();v.negative!==0?v=v.umod(g):v=v.clone();for(var B=new l(1),z=new l(0),G=new l(0),J=new l(1),T=0;v.isEven()&&E.isEven();)v.iushrn(1),E.iushrn(1),++T;for(var m=E.clone(),b=v.clone();!v.isZero();){for(var O=0,P=1;(v.words[0]&P)===0&&O<26;++O,P<<=1);if(O>0)for(v.iushrn(O);O-- >0;)(B.isOdd()||z.isOdd())&&(B.iadd(m),z.isub(b)),B.iushrn(1),z.iushrn(1);for(var ne=0,ue=1;(E.words[0]&ue)===0&&ne<26;++ne,ue<<=1);if(ne>0)for(E.iushrn(ne);ne-- >0;)(G.isOdd()||J.isOdd())&&(G.iadd(m),J.isub(b)),G.iushrn(1),J.iushrn(1);v.cmp(E)>=0?(v.isub(E),B.isub(G),z.isub(J)):(E.isub(v),G.isub(B),J.isub(z))}return{a:G,b:J,gcd:E.iushln(T)}},l.prototype._invmp=function(g){i(g.negative===0),i(!g.isZero());var v=this,E=g.clone();v.negative!==0?v=v.umod(g):v=v.clone();for(var B=new l(1),z=new l(0),G=E.clone();v.cmpn(1)>0&&E.cmpn(1)>0;){for(var J=0,T=1;(v.words[0]&T)===0&&J<26;++J,T<<=1);if(J>0)for(v.iushrn(J);J-- >0;)B.isOdd()&&B.iadd(G),B.iushrn(1);for(var m=0,b=1;(E.words[0]&b)===0&&m<26;++m,b<<=1);if(m>0)for(E.iushrn(m);m-- >0;)z.isOdd()&&z.iadd(G),z.iushrn(1);v.cmp(E)>=0?(v.isub(E),B.isub(z)):(E.isub(v),z.isub(B))}var O;return v.cmpn(1)===0?O=B:O=z,O.cmpn(0)<0&&O.iadd(g),O},l.prototype.gcd=function(g){if(this.isZero())return g.abs();if(g.isZero())return this.abs();var v=this.clone(),E=g.clone();v.negative=0,E.negative=0;for(var B=0;v.isEven()&&E.isEven();B++)v.iushrn(1),E.iushrn(1);do{for(;v.isEven();)v.iushrn(1);for(;E.isEven();)E.iushrn(1);var z=v.cmp(E);if(z<0){var G=v;v=E,E=G}else if(z===0||E.cmpn(1)===0)break;v.isub(E)}while(!0);return E.iushln(B)},l.prototype.invm=function(g){return this.egcd(g).a.umod(g)},l.prototype.isEven=function(){return(this.words[0]&1)===0},l.prototype.isOdd=function(){return(this.words[0]&1)===1},l.prototype.andln=function(g){return this.words[0]&g},l.prototype.bincn=function(g){i(typeof g=="number");var v=g%26,E=(g-v)/26,B=1<<v;if(this.length<=E)return this._expand(E+1),this.words[E]|=B,this;for(var z=B,G=E;z!==0&&G<this.length;G++){var J=this.words[G]|0;J+=z,z=J>>>26,J&=67108863,this.words[G]=J}return z!==0&&(this.words[G]=z,this.length++),this},l.prototype.isZero=function(){return this.length===1&&this.words[0]===0},l.prototype.cmpn=function(g){var v=g<0;if(this.negative!==0&&!v)return-1;if(this.negative===0&&v)return 1;this._strip();var E;if(this.length>1)E=1;else{v&&(g=-g),i(g<=67108863,"Number is too big");var B=this.words[0]|0;E=B===g?0:B<g?-1:1}return this.negative!==0?-E|0:E},l.prototype.cmp=function(g){if(this.negative!==0&&g.negative===0)return-1;if(this.negative===0&&g.negative!==0)return 1;var v=this.ucmp(g);return this.negative!==0?-v|0:v},l.prototype.ucmp=function(g){if(this.length>g.length)return 1;if(this.length<g.length)return-1;for(var v=0,E=this.length-1;E>=0;E--){var B=this.words[E]|0,z=g.words[E]|0;if(B!==z){B<z?v=-1:B>z&&(v=1);break}}return v},l.prototype.gtn=function(g){return this.cmpn(g)===1},l.prototype.gt=function(g){return this.cmp(g)===1},l.prototype.gten=function(g){return this.cmpn(g)>=0},l.prototype.gte=function(g){return this.cmp(g)>=0},l.prototype.ltn=function(g){return this.cmpn(g)===-1},l.prototype.lt=function(g){return this.cmp(g)===-1},l.prototype.lten=function(g){return this.cmpn(g)<=0},l.prototype.lte=function(g){return this.cmp(g)<=0},l.prototype.eqn=function(g){return this.cmpn(g)===0},l.prototype.eq=function(g){return this.cmp(g)===0},l.red=function(g){return new ae(g)},l.prototype.toRed=function(g){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),g.convertTo(this)._forceRed(g)},l.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},l.prototype._forceRed=function(g){return this.red=g,this},l.prototype.forceRed=function(g){return i(!this.red,"Already a number in reduction context"),this._forceRed(g)},l.prototype.redAdd=function(g){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,g)},l.prototype.redIAdd=function(g){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,g)},l.prototype.redSub=function(g){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,g)},l.prototype.redISub=function(g){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,g)},l.prototype.redShl=function(g){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,g)},l.prototype.redMul=function(g){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.mul(this,g)},l.prototype.redIMul=function(g){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,g),this.red.imul(this,g)},l.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},l.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},l.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},l.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},l.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},l.prototype.redPow=function(g){return i(this.red&&!g.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,g)};var re={k256:null,p224:null,p192:null,p25519:null};function te(N,g){this.name=N,this.p=new l(g,16),this.n=this.p.bitLength(),this.k=new l(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}te.prototype._tmp=function(){var g=new l(null);return g.words=new Array(Math.ceil(this.n/13)),g},te.prototype.ireduce=function(g){var v=g,E;do this.split(v,this.tmp),v=this.imulK(v),v=v.iadd(this.tmp),E=v.bitLength();while(E>this.n);var B=E<this.n?-1:v.ucmp(this.p);return B===0?(v.words[0]=0,v.length=1):B>0?v.isub(this.p):v.strip!==void 0?v.strip():v._strip(),v},te.prototype.split=function(g,v){g.iushrn(this.n,0,v)},te.prototype.imulK=function(g){return g.imul(this.k)};function pe(){te.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}o(pe,te),pe.prototype.split=function(g,v){for(var E=4194303,B=Math.min(g.length,9),z=0;z<B;z++)v.words[z]=g.words[z];if(v.length=B,g.length<=9){g.words[0]=0,g.length=1;return}var G=g.words[9];for(v.words[v.length++]=G&E,z=10;z<g.length;z++){var J=g.words[z]|0;g.words[z-10]=(J&E)<<4|G>>>22,G=J}G>>>=22,g.words[z-10]=G,G===0&&g.length>10?g.length-=10:g.length-=9},pe.prototype.imulK=function(g){g.words[g.length]=0,g.words[g.length+1]=0,g.length+=2;for(var v=0,E=0;E<g.length;E++){var B=g.words[E]|0;v+=B*977,g.words[E]=v&67108863,v=B*64+(v/67108864|0)}return g.words[g.length-1]===0&&(g.length--,g.words[g.length-1]===0&&g.length--),g};function we(){te.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}o(we,te);function X(){te.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}o(X,te);function Z(){te.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}o(Z,te),Z.prototype.imulK=function(g){for(var v=0,E=0;E<g.length;E++){var B=(g.words[E]|0)*19+v,z=B&67108863;B>>>=26,g.words[E]=z,v=B}return v!==0&&(g.words[g.length++]=v),g},l._prime=function(g){if(re[g])return re[g];var v;if(g==="k256")v=new pe;else if(g==="p224")v=new we;else if(g==="p192")v=new X;else if(g==="p25519")v=new Z;else throw new Error("Unknown prime "+g);return re[g]=v,v};function ae(N){if(typeof N=="string"){var g=l._prime(N);this.m=g.p,this.prime=g}else i(N.gtn(1),"modulus must be greater than 1"),this.m=N,this.prime=null}ae.prototype._verify1=function(g){i(g.negative===0,"red works only with positives"),i(g.red,"red works only with red numbers")},ae.prototype._verify2=function(g,v){i((g.negative|v.negative)===0,"red works only with positives"),i(g.red&&g.red===v.red,"red works only with red numbers")},ae.prototype.imod=function(g){return this.prime?this.prime.ireduce(g)._forceRed(this):(_(g,g.umod(this.m)._forceRed(this)),g)},ae.prototype.neg=function(g){return g.isZero()?g.clone():this.m.sub(g)._forceRed(this)},ae.prototype.add=function(g,v){this._verify2(g,v);var E=g.add(v);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},ae.prototype.iadd=function(g,v){this._verify2(g,v);var E=g.iadd(v);return E.cmp(this.m)>=0&&E.isub(this.m),E},ae.prototype.sub=function(g,v){this._verify2(g,v);var E=g.sub(v);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},ae.prototype.isub=function(g,v){this._verify2(g,v);var E=g.isub(v);return E.cmpn(0)<0&&E.iadd(this.m),E},ae.prototype.shl=function(g,v){return this._verify1(g),this.imod(g.ushln(v))},ae.prototype.imul=function(g,v){return this._verify2(g,v),this.imod(g.imul(v))},ae.prototype.mul=function(g,v){return this._verify2(g,v),this.imod(g.mul(v))},ae.prototype.isqr=function(g){return this.imul(g,g.clone())},ae.prototype.sqr=function(g){return this.mul(g,g)},ae.prototype.sqrt=function(g){if(g.isZero())return g.clone();var v=this.m.andln(3);if(i(v%2===1),v===3){var E=this.m.add(new l(1)).iushrn(2);return this.pow(g,E)}for(var B=this.m.subn(1),z=0;!B.isZero()&&B.andln(1)===0;)z++,B.iushrn(1);i(!B.isZero());var G=new l(1).toRed(this),J=G.redNeg(),T=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new l(2*m*m).toRed(this);this.pow(m,T).cmp(J)!==0;)m.redIAdd(J);for(var b=this.pow(m,B),O=this.pow(g,B.addn(1).iushrn(1)),P=this.pow(g,B),ne=z;P.cmp(G)!==0;){for(var ue=P,Te=0;ue.cmp(G)!==0;Te++)ue=ue.redSqr();i(Te<ne);var ve=this.pow(b,new l(1).iushln(ne-Te-1));O=O.redMul(ve),b=ve.redSqr(),P=P.redMul(b),ne=Te}return O},ae.prototype.invm=function(g){var v=g._invmp(this.m);return v.negative!==0?(v.negative=0,this.imod(v).redNeg()):this.imod(v)},ae.prototype.pow=function(g,v){if(v.isZero())return new l(1).toRed(this);if(v.cmpn(1)===0)return g.clone();var E=4,B=new Array(1<<E);B[0]=new l(1).toRed(this),B[1]=g;for(var z=2;z<B.length;z++)B[z]=this.mul(B[z-1],g);var G=B[0],J=0,T=0,m=v.bitLength()%26;for(m===0&&(m=26),z=v.length-1;z>=0;z--){for(var b=v.words[z],O=m-1;O>=0;O--){var P=b>>O&1;if(G!==B[0]&&(G=this.sqr(G)),P===0&&J===0){T=0;continue}J<<=1,J|=P,T++,!(T!==E&&(z!==0||O!==0))&&(G=this.mul(G,B[J]),T=0,J=0)}m=26}return G},ae.prototype.convertTo=function(g){var v=g.umod(this.m);return v===g?v.clone():v},ae.prototype.convertFrom=function(g){var v=g.clone();return v.red=null,v},l.mont=function(g){return new ce(g)};function ce(N){ae.call(this,N),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new l(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}o(ce,ae),ce.prototype.convertTo=function(g){return this.imod(g.ushln(this.shift))},ce.prototype.convertFrom=function(g){var v=this.imod(g.mul(this.rinv));return v.red=null,v},ce.prototype.imul=function(g,v){if(g.isZero()||v.isZero())return g.words[0]=0,g.length=1,g;var E=g.imul(v),B=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),z=E.isub(B).iushrn(this.shift),G=z;return z.cmp(this.m)>=0?G=z.isub(this.m):z.cmpn(0)<0&&(G=z.iadd(this.m)),G._forceRed(this)},ce.prototype.mul=function(g,v){if(g.isZero()||v.isZero())return new l(0)._forceRed(this);var E=g.mul(v),B=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),z=E.isub(B).iushrn(this.shift),G=z;return z.cmp(this.m)>=0?G=z.isub(this.m):z.cmpn(0)<0&&(G=z.iadd(this.m)),G._forceRed(this)},ce.prototype.invm=function(g){var v=this.imod(g._invmp(this.m).mul(this.r2));return v._forceRed(this)}})(e,g7)})(Wf)),Wf.exports}var m7=a2();const nx=Xc(m7);var Of={exports:{}};var rx;function o2(){return rx||(rx=1,(function(e,t){var n=e1(),i=n.Buffer;function o(u,f){for(var h in u)f[h]=u[h]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=l);function l(u,f,h){return i(u,f,h)}l.prototype=Object.create(i.prototype),o(i,l),l.from=function(u,f,h){if(typeof u=="number")throw new TypeError("Argument must not be a number");return i(u,f,h)},l.alloc=function(u,f,h){if(typeof u!="number")throw new TypeError("Argument must be a number");var y=i(u);return f!==void 0?typeof h=="string"?y.fill(f,h):y.fill(f):y.fill(0),y},l.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return i(u)},l.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(u)}})(Of,Of.exports)),Of.exports}var Np,ix;function y7(){if(ix)return Np;ix=1;var e=o2().Buffer;function t(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var i=new Uint8Array(256),o=0;o<i.length;o++)i[o]=255;for(var l=0;l<n.length;l++){var u=n.charAt(l),f=u.charCodeAt(0);if(i[f]!==255)throw new TypeError(u+" is ambiguous");i[f]=l}var h=n.length,y=n.charAt(0),_=Math.log(h)/Math.log(256),A=Math.log(256)/Math.log(h);function D(k){if((Array.isArray(k)||k instanceof Uint8Array)&&(k=e.from(k)),!e.isBuffer(k))throw new TypeError("Expected Buffer");if(k.length===0)return"";for(var j=0,M=0,W=0,K=k.length;W!==K&&k[W]===0;
33)W++,j++;for(var se=(K-W)*A+1>>>0,re=new Uint8Array(se);W!==K;){for(var te=k[W],pe=0,we=se-1;(te!==0||pe<M)&&we!==-1;we--,pe++)te+=256*re[we]>>>0,re[we]=te%h>>>0,te=te/h>>>0;if(te!==0)throw new Error("Non-zero carry");M=pe,W++}for(var X=se-M;X!==se&&re[X]===0;)X++;for(var Z=y.repeat(j);X<se;++X)Z+=n.charAt(re[X]);return Z}function U(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return e.alloc(0);for(var j=0,M=0,W=0;k[j]===y;)M++,j++;for(var K=(k.length-j)*_+1>>>0,se=new Uint8Array(K);j<k.length;){var re=k.charCodeAt(j);if(re>255)return;var te=i[re];if(te===255)return;for(var pe=0,we=K-1;(te!==0||pe<W)&&we!==-1;we--,pe++)te+=h*se[we]>>>0,se[we]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");W=pe,j++}for(var X=K-W;X!==K&&se[X]===0;)X++;var Z=e.allocUnsafe(M+(K-X));Z.fill(0,0,M);for(var ae=M;X!==K;)Z[ae++]=se[X++];return Z}function L(k){var j=U(k);if(j)return j;throw new Error("Non-base"+h+" character")}return{encode:D,decodeUnsafe:U,decode:L}}return Np=t,Np}var kp,sx;function w7(){if(sx)return kp;sx=1;var e=y7(),t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return kp=e(t),kp}var b7=w7();const $r=Xc(b7),ax=ou;var bn={},Up,ox;function v7(){if(ox)return Up;ox=1;var e=o2().Buffer;function t(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var i=new Uint8Array(256),o=0;o<i.length;o++)i[o]=255;for(var l=0;l<n.length;l++){var u=n.charAt(l),f=u.charCodeAt(0);if(i[f]!==255)throw new TypeError(u+" is ambiguous");i[f]=l}var h=n.length,y=n.charAt(0),_=Math.log(h)/Math.log(256),A=Math.log(256)/Math.log(h);function D(k){if((Array.isArray(k)||k instanceof Uint8Array)&&(k=e.from(k)),!e.isBuffer(k))throw new TypeError("Expected Buffer");if(k.length===0)return"";for(var j=0,M=0,W=0,K=k.length;W!==K&&k[W]===0;)W++,j++;for(var se=(K-W)*A+1>>>
vendor: 4,810 bytes, line 33
330,re=new Uint8Array(se);W!==K;){for(var te=k[W],pe=0,we=se-1;(te!==0||pe<M)&&we!==-1;we--,pe++)te+=256*re[we]>>>0,re[we]=te%h>>>0,te=te/h>>>0;if(te!==0)throw new Error("Non-zero carry");M=pe,W++}for(var X=se-M;X!==se&&re[X]===0;)X++;for(var Z=y.repeat(j);X<se;++X)Z+=n.charAt(re[X]);return Z}function U(k){if(typeof k!="string")throw new TypeError("Expected String");if(k.length===0)return e.alloc(0);for(var j=0,M=0,W=0;k[j]===y;)M++,j++;for(var K=(k.length-j)*_+1>>>0,se=new Uint8Array(K);j<k.length;){var re=k.charCodeAt(j);if(re>255)return;var te=i[re];if(te===255)return;for(var pe=0,we=K-1;(te!==0||pe<W)&&we!==-1;we--,pe++)te+=h*se[we]>>>0,se[we]=te%256>>>0,te=te/256>>>0;if(te!==0)throw new Error("Non-zero carry");W=pe,j++}for(var X=K-W;X!==K&&se[X]===0;)X++;var Z=e.allocUnsafe(M+(K-X));Z.fill(0,0,M);for(var ae=M;X!==K;)Z[ae++]=se[X++];return Z}function L(k){var j=U(k);if(j)return j;throw new Error("Non-base"+h+" character")}return{encode:D,decodeUnsafe:U,decode:L}}return Up=t,Up}var jp,lx;function x7(){if(lx)return jp;lx=1;var e=v7(),t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return jp=e(t),jp}function Is(e,t,n){return t<=e&&e<=n}function jd(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function E7(e){for(var t=String(e),n=t.length,i=0,o=[];i<n;){var l=t.charCodeAt(i);if(l<55296||l>57343)o.push(l);else if(56320<=l&&l<=57343)o.push(65533);else if(55296<=l&&l<=56319)if(i===n-1)o.push(65533);else{var u=e.charCodeAt(i+1);if(56320<=u&&u<=57343){var f=l&1023,h=u&1023;o.push(65536+(f<<10)+h),i+=1}else o.push(65533)}i+=1}return o}function S7(e){for(var t="",n=0;n<e.length;++n){var i=e[n];i<=65535?t+=String.fromCharCode(i):(i-=65536,t+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return t}var cd=-1;function R1(e){this.tokens=[].slice.call(e)}R1.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():cd},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}};var gl=-1;function Lp(e,t){if(e)throw TypeError("Decoder error");return t||65533}var ud="utf-8";function fd(e,t){if(!(this instanceof fd))return new fd(e,t);if(e=e!==void 0?String(e).toLowerCase():ud,e!==ud)throw new Error("Encoding not supported. Only utf-8 is supported");t=jd(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}fd.prototype={decode:function(t,n){var i;typeof t=="object"&&t instanceof ArrayBuffer?i=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?i=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):i=new Uint8Array(0),n=jd(n),this._streaming||(this._decoder=new A7({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var o=new R1(i),l=[],u;!o.endOfStream()&&(u=this._decoder.handler(o,o.read()),u!==gl);)u!==null&&(Array.isArray(u)?l.push.apply(l,u):l.push(u));if(!this._streaming){do{if(u=this._decoder.handler(o,o.read()),u===gl)break;u!==null&&(Array.isArray(u)?l.push.apply(l,u):l.push(u))}while(!o.endOfStream());this._decoder=null}return l.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(l[0]===65279?(this._BOMseen=!0,l.shift()):this._BOMseen=!0),S7(l)}};function dd(e,t){if(!(this instanceof dd))return new dd(e,t);if(e=e!==void 0?String(e).toLowerCase():ud,e!==ud)throw new Error("Encoding not supported. Only utf-8 is supported");t=jd(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}dd.prototype={encode:function(t,n){t=t?String(t):"",n=jd(n),this._streaming||(this._encoder=new _7(this._options)),this._streaming=!!n.stream;for(var i=[],o=new R1(E7(t)),l;!o.endOfStream()&&(l=this._encoder.handler(o,o.read()),l!==gl);)Array.isArray(l)?i.push.apply(i,l):i.push(l);if(!this._streaming){for(;l=this._encoder.handler(o,o.read()),l!==gl;)Array.isArray(l)?i.push.apply(i,l):i.push(l);this._encoder=null}return new Uint8Array(i)}};function A7(e){var t=e.fatal,n=0,i=0,o=0,l=128,u=191;this.handler=function(f,h){if(h===cd&&o!==0)return o=0,Lp(t);if(h===cd)return gl;if(o===0){if(Is(h,0,127))return h;if(Is(h,194,223))o=1,n=h-192;else if(Is(h,224,239))h===224&&(l=160),h===237&&(u=159),o=2,n=h-224;else if(Is(h,240,244))h===240&&(l=144),h===244&&(u=143),o=3,n=h-240;else return Lp(t);return n=n<<6*o,null}if(!Is(h,l,u))return n=o=i=0,l=128,u=191,f.prepend(h),Lp(t);
33if(l=128,u=191,i+=1,n+=h-128<<6*(o-i),i!==o)return null;var y=n;return n=o=i=0,y}}function _7(e){e.fatal,this.handler=function(t,n){if(n===cd)return gl;if(Is(n,0,127))return n;var i,o;Is(n,128,2047)?(i=1,o=192):Is(n,2048,65535)?(i=2,o=224):Is(n,65536,1114111)&&(i=3,o=240);for(var l=[(n>>6*i)+o];i>0;){var u=n>>6*(i-1);l.push(128|u&63),i-=1}return l}}const I7=Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:fd,TextEncoder:dd},Symbol.toStringTag,{value:"Module"})),T7=Qg(I7);var cx;function R7(){if(cx)return bn;cx=1;var e=bn&&bn.__createBinding||(Object.create?(function(X,Z,ae,ce){ce===void 0&&(ce=ae),Object.defineProperty(X,ce,{enumerable:!0,get:function(){return Z[ae]}})}):(function(X,Z,ae,ce){ce===void 0&&(ce=ae),X[ce]=Z[ae]})),t=bn&&bn.__setModuleDefault||(Object.create?(function(X,Z){Object.defineProperty(X,"default",{enumerable:!0,value:Z})}):function(X,Z){X.default=Z}),n=bn&&bn.__decorate||function(X,Z,ae,ce){var N=arguments.length,g=N<3?Z:ce===null?ce=Object.getOwnPropertyDescriptor(Z,ae):ce,v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(X,Z,ae,ce);else for(var E=X.length-1;E>=0;E--)(v=X[E])&&(g=(N<3?v(g):N>3?v(Z,ae,g):v(Z,ae))||g);return N>3&&g&&Object.defineProperty(Z,ae,g),g},i=bn&&bn.__importStar||function(X){if(X&&X.__esModule)return X;var Z={};if(X!=null)for(var ae in X)ae!=="default"&&Object.hasOwnProperty.call(X,ae)&&e(Z,X,ae);return t(Z,X),Z},o=bn&&bn.__importDefault||function(X){return X&&X.__esModule?X:{default:X}};Object.defineProperty(bn,"__esModule",{value:!0}),bn.deserializeUnchecked=bn.deserialize=bn.serialize=bn.BinaryReader=bn.BinaryWriter=bn.BorshError=bn.baseDecode=bn.baseEncode=void 0;const l=o(a2()),u=o(x7()),f=i(T7),h=typeof TextDecoder!="function"?f.TextDecoder:TextDecoder,y=new h("utf-8",{fatal:!0});function _(X){return typeof X=="string"&&(X=Buffer.from(X,"utf8")),u.default.encode(Buffer.from(X))}bn.baseEncode=_;function A(X){return Buffer.from(u.default.decode(X))}bn.baseDecode=A;const D=1024;class U extends Error{constructor(Z){super(Z),this.fieldPath=[],this.originalMessage=Z}addToFieldPath(Z){this.fieldPath.splice(0,0,Z),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}bn.BorshError=U;class L{constructor(){this.buf=Buffer.alloc(D),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(D)]))}writeU8(Z){this.maybeResize(),this.buf.writeUInt8(Z,this.length),this.length+=1}writeU16(Z){this.maybeResize(),this.buf.writeUInt16LE(Z,this.length),this.length+=2}writeU32(Z){this.maybeResize(),this.buf.writeUInt32LE(Z,this.length),this.length+=4}writeU64(Z){this.maybeResize(),this.writeBuffer(Buffer.from(new l.default(Z).toArray("le",8)))}writeU128(Z){this.maybeResize(),this.writeBuffer(Buffer.from(new l.default(Z).toArray("le",16)))}writeU256(Z){this.maybeResize(),this.writeBuffer(Buffer.from(new l.default(Z).toArray("le",32)))}writeU512(Z){this.maybeResize(),this.writeBuffer(Buffer.from(new l.default(Z).toArray("le",64)))}writeBuffer(Z){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),Z,Buffer.alloc(D)]),this.length+=Z.length}writeString(Z){this.maybeResize();const ae=Buffer.from(Z,"utf8");this.writeU32(ae.length),this.writeBuffer(ae)}writeFixedArray(Z){this.writeBuffer(Buffer.from(Z))}writeArray(Z,ae){this.maybeResize(),this.writeU32(Z.length);for(const ce of Z)this.maybeResize(),ae(ce)}toArray(){return this.buf.subarray(0,this.length)}}bn.BinaryWriter=L;function k(X,Z,ae){const ce=ae.value;ae.value=function(...N){try{return ce.apply(this,N)}catch(g){if(g instanceof RangeError){const v=g.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(v)>=0)throw new U("Reached the end of buffer when deserializing")}throw g}}}class j{constructor(Z){this.buf=Z,this.offset=0}readU8(){const Z=this.buf.readUInt8(this.offset);return this.offset+=1,Z}readU16(){const Z=this.buf.readUInt16LE(this.offset);return this.offset+=2,Z}readU32(){const Z=this.buf.readUInt32LE(this.offset);return this.offset+=4,Z}readU64(){const Z=this.readBuffer(8);return new l.default(Z,"le")}readU128(){const Z=this.readBuffer(16);return new l.default(Z,"le")}readU256(){const Z=this.readBuffer(32);return new l.default(Z,"le")}readU512(){const Z=this.readBuffer(64);return new l.default(Z,"le")}readBuffer(Z){if(this.offset+Z>this.buf.length)throw new U(`Expected buffer length ${Z} isn't within bounds`);const ae=this.buf.slice(this.offset,this.offset+Z);return this.offset+=Z,ae}readString(){const Z=this.readU32(),ae=this.readBuffer(Z);try{return y.decode(ae)}catch(ce){throw new U(`Error decoding UTF-8 string: ${ce}`)}}readFixedArray(Z){return new Uint8Array(this.readBuffer(Z))}readArray(Z){const ae=this.readU32(),ce=Array();for(let N=0;N<ae;++N)ce.push(Z());return ce}}n([k],j.prototype,"readU8",null),n([k],j.prototype,"readU16",null),n([k],j.prototype,"readU32",null),n([k],j.prototype,"readU64",null),n([k],j.prototype,"readU128",null),n([k],j.prototype,"readU256",null),n([k],j.prototype,"readU512",null),n([k],j.prototype,"readString",null),n([k],j.prototype,"readFixedArray",null),n([k],j.prototype,"readArray",null),bn.BinaryReader=j;function M(X){return X.charAt(0).toUpperCase()+X.slice(1)}function W(X,Z,ae,ce,N){try{if(typeof ce=="string")N[`write${M(ce)}`](ae);else if(ce instanceof Array)if(typeof ce[0]=="number"){if(ae.length!==ce[0])throw new U(`Expecting byte array of length ${ce[0]}, but got ${ae.length} bytes`);N.writeFixedArray(ae)}else if(ce.length===2&&typeof ce[1]=="number"){if(ae.length!==ce[1])throw new U(`Expecting byte array of length ${ce[1]}, but got ${ae.length} bytes`);for(let g=0;g<ce[1];g++)W(X,null,ae[g],ce[0],N)}else N.writeArray(ae,g=>{W(X,Z,g,ce[0],N)});else if(ce.kind!==void 0)switch(ce.kind){case"option":{ae==null?N.writeU8(0):(N.writeU8(1),W(X,Z,ae,ce.type,N));break}case"map":{N.writeU32(ae.size),ae.forEach((g,v)=>{W(X,Z,v,ce.key,N),W(X,Z,g,ce.value,N)});break}default:throw new U(`FieldType ${ce} unrecognized`)}else K(X,ae,N)}catch(g){throw g instanceof U&&g.addToFieldPath(Z),g}}function K(X,Z,ae){if(typeof Z.borshSerialize=="function"){Z.borshSerialize(ae);return}const ce=X.get(Z.constructor);if(!ce)throw new U(`Class ${Z.constructor.name} is missing in schema`);if(ce.kind==="struct")ce.fields.map(([N,g])=>{W(X,N,Z[N],g,ae)});else if(ce.kind==="enum"){const N=Z[ce.field];for(let g=0;g<ce.values.length;++g){const[v,E]=ce.values[g];if(v===N){ae.writeU8(g),W(X,v,Z[v],E,ae);break}}}else throw new U(`Unexpected schema kind: ${ce.kind} for ${Z.constructor.name}`)}function se(X,Z,ae=L){const ce=new ae;return K(X,Z,ce),ce.toArray()}bn.serialize=se;function re(X,Z,ae,ce){try{if(typeof ae=="string")return ce[`read${M(ae)}`]();if(ae instanceof Array){if(typeof ae[0]=="number")return ce.readFixedArray(ae[0]);if(typeof ae[1]=="number"){const N=[];for(let g=0;g<ae[1];g++)N.push(re(X,null,ae[0],ce));return N}else return ce.readArray(()=>re(X,Z,ae[0],ce))}if(ae.kind==="option")return ce.readU8()?re(X,Z,ae.type,ce):void 0;if(ae.kind==="map"){let N=new Map;const g=ce.readU32();for(let v=0;v<g;v++){const E=re(X,Z,ae.key,ce),B=re(X,Z,ae.value,ce);N.set(E,B)}return N}return te(X,ae,ce)}catch(N){throw N instanceof U&&N.addToFieldPath(Z),N}}function te(X,Z,ae){if(typeof Z.borshDeserialize=="function")return Z.borshDeserialize(ae);const ce=X.get(Z);if(!ce)throw new U(`Class ${Z.name} is missing in schema`);if(ce.kind==="struct"){const N={};for(const[g,v]of X.get(Z).fields)N[g]=re(X,g,v,ae);return new Z(N)}if(ce.kind==="enum"){const N=ae.readU8();if(N>=ce.values.length)throw new U(`Enum index: ${N} is out of range`);const[g,v]=ce.values[N],E=re(X,g,v,ae);return new Z({[g]:E})}throw new U(`Unexpected schema kind: ${ce.kind} for ${Z.constructor.name}`)}function pe(X,Z,ae,ce=j){const N=new ce(ae),g=te(X,Z,N);if(N.offset<ae.length)throw new U(`Unexpected ${ae.length-N.offset} bytes after deserialized data`);return g}bn.deserialize=pe;function we(X,Z,ae,ce=j){const N=new ce(ae);return te(X,Z,N)}return bn.deserializeUnchecked=we,bn}var zp=R7(),_e={},ux;function C7(){if(ux)return _e;
33ux=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.s16=_e.s8=_e.nu64be=_e.u48be=_e.u40be=_e.u32be=_e.u24be=_e.u16be=_e.nu64=_e.u48=_e.u40=_e.u32=_e.u24=_e.u16=_e.u8=_e.offset=_e.greedy=_e.Constant=_e.UTF8=_e.CString=_e.Blob=_e.Boolean=_e.BitField=_e.BitStructure=_e.VariantLayout=_e.Union=_e.UnionLayoutDiscriminator=_e.UnionDiscriminator=_e.Structure=_e.Sequence=_e.DoubleBE=_e.Double=_e.FloatBE=_e.Float=_e.NearInt64BE=_e.NearInt64=_e.NearUInt64BE=_e.NearUInt64=_e.IntBE=_e.Int=_e.UIntBE=_e.UInt=_e.OffsetLayout=_e.GreedyCount=_e.ExternalLayout=_e.bindConstructorLayout=_e.nameWithProperty=_e.Layout=_e.uint8ArrayToBuffer=_e.checkUint8Array=void 0,_e.constant=_e.utf8=_e.cstr=_e.blob=_e.unionLayoutDiscriminator=_e.union=_e.seq=_e.bits=_e.struct=_e.f64be=_e.f64=_e.f32be=_e.f32=_e.ns64be=_e.s48be=_e.s40be=_e.s32be=_e.s24be=_e.s16be=_e.ns64=_e.s48=_e.s40=_e.s32=_e.s24=void 0;const e=e1();function t(m){if(!(m instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}_e.checkUint8Array=t;function n(m){return t(m),e.Buffer.from(m.buffer,m.byteOffset,m.length)}_e.uint8ArrayToBuffer=n;let i=class{constructor(b,O){if(!Number.isInteger(b))throw new TypeError("span must be an integer");this.span=b,this.property=O}makeDestinationObject(){return{}}getSpan(b,O){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(b){const O=Object.create(this.constructor.prototype);return Object.assign(O,this),O.property=b,O}fromArray(b){}};_e.Layout=i;function o(m,b){return b.property?m+"["+b.property+"]":m}_e.nameWithProperty=o;function l(m,b){if(typeof m!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(m,"layout_"))throw new Error("Class is already bound to a layout");if(!(b&&b instanceof i))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(b,"boundConstructor_"))throw new Error("layout is already bound to a constructor");m.layout_=b,b.boundConstructor_=m,b.makeDestinationObject=(()=>new m),Object.defineProperty(m.prototype,"encode",{value(O,P){return b.encode(this,O,P)},writable:!0}),Object.defineProperty(m,"decode",{value(O,P){return b.decode(O,P)},writable:!0})}_e.bindConstructorLayout=l;class u extends i{isCount(){throw new Error("ExternalLayout is abstract")}}_e.ExternalLayout=u;class f extends u{constructor(b=1,O){if(!Number.isInteger(b)||0>=b)throw new TypeError("elementSpan must be a (positive) integer");super(-1,O),this.elementSpan=b}isCount(){return!0}decode(b,O=0){t(b);const P=b.length-O;return Math.floor(P/this.elementSpan)}encode(b,O,P){return 0}}_e.GreedyCount=f;class h extends u{constructor(b,O=0,P){if(!(b instanceof i))throw new TypeError("layout must be a Layout");if(!Number.isInteger(O))throw new TypeError("offset must be integer or undefined");super(b.span,P||b.property),this.layout=b,this.offset=O}isCount(){return this.layout instanceof y||this.layout instanceof _}decode(b,O=0){return this.layout.decode(b,O+this.offset)}encode(b,O,P=0){return this.layout.encode(b,O,P+this.offset)}}_e.OffsetLayout=h;class y extends i{constructor(b,O){if(super(b,O),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(b,O=0){return n(b).readUIntLE(O,this.span)}encode(b,O,P=0){return n(O).writeUIntLE(b,P,this.span),this.span}}_e.UInt=y;class _ extends i{constructor(b,O){if(super(b,O),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(b,O=0){return n(b).readUIntBE(O,this.span)}encode(b,O,P=0){return n(O).writeUIntBE(b,P,this.span),this.span}}_e.UIntBE=_;class A extends i{constructor(b,O){if(super(b,O),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(b,O=0){return n(b).readIntLE(O,this.span)}encode(b,O,P=0){return n(O).writeIntLE(b,P,this.span),this.span}}_e.Int=A;class D extends i{constructor(b,O){if(super(b,O),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(b,O=0){return n(b).readIntBE(O,this.span)}encode(b,O,P=0){return n(O).writeIntBE(b,P,this.span),this.span}}_e.IntBE=D;const U=Math.pow(2,32);function L(m){const b=Math.floor(m/U),O=m-b*U;return{hi32:b,lo32:O}}function k(m,b){return m*U+b}class j extends i{constructor(b){super(8,b)}decode(b,O=0){const P=n(b),ne=P.readUInt32LE(O),ue=P.readUInt32LE(O+4);return k(ue,ne)}encode(b,O,P=0){const ne=L(b),ue=n(O);return ue.writeUInt32LE(ne.lo32,P),ue.writeUInt32LE(ne.hi32,P+4),8}}_e.NearUInt64=j;class M extends i{constructor(b){super(8,b)}decode(b,O=0){const P=n(b),ne=P.readUInt32BE(O),ue=P.readUInt32BE(O+4);return k(ne,ue)}encode(b,O,P=0){const ne=L(b),ue=n(O);return ue.writeUInt32BE(ne.hi32,P),ue.writeUInt32BE(ne.lo32,P+4),8}}_e.NearUInt64BE=M;class W extends i{constructor(b){super(8,b)}decode(b,O=0){const P=n(b),ne=P.readUInt32LE(O),ue=P.readInt32LE(O+4);return k(ue,ne)}encode(b,O,P=0){const ne=L(b),ue=n(O);return ue.writeUInt32LE(ne.lo32,P),ue.writeInt32LE(ne.hi32,P+4),8}}_e.NearInt64=W;class K extends i{constructor(b){super(8,b)}decode(b,O=0){const P=n(b),ne=P.readInt32BE(O),ue=P.readUInt32BE(O+4);return k(ne,ue)}encode(b,O,P=0){const ne=L(b),ue=n(O);return ue.writeInt32BE(ne.hi32,P),ue.writeUInt32BE(ne.lo32,P+4),8}}_e.NearInt64BE=K;class se extends i{constructor(b){super(4,b)}decode(b,O=0){return n(b).readFloatLE(O)}encode(b,O,P=0){return n(O).writeFloatLE(b,P),4}}_e.Float=se;class re extends i{constructor(b){super(4,b)}decode(b,O=0){return n(b).readFloatBE(O)}encode(b,O,P=0){return n(O).writeFloatBE(b,P),4}}_e.FloatBE=re;class te extends i{constructor(b){super(8,b)}decode(b,O=0){return n(b).readDoubleLE(O)}encode(b,O,P=0){return n(O).writeDoubleLE(b,P),8}}_e.Double=te;class pe extends i{constructor(b){super(8,b)}decode(b,O=0){return n(b).readDoubleBE(O)}encode(b,O,P=0){return n(O).writeDoubleBE(b,P),8}}_e.DoubleBE=pe;class we extends i{constructor(b,O,P){if(!(b instanceof i))throw new TypeError("elementLayout must be a Layout");if(!(O instanceof u&&O.isCount()||Number.isInteger(O)&&0<=O))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let ne=-1;!(O instanceof u)&&0<b.span&&(ne=O*b.span),super(ne,P),this.elementLayout=b,this.count=O}getSpan(b,O=0){if(0<=this.span)return this.span;let P=0,ne=this.count;if(ne instanceof u&&(ne=ne.decode(b,O)),0<this.elementLayout.span)P=ne*this.elementLayout.span;else{let ue=0;for(;ue<ne;)P+=this.elementLayout.getSpan(b,O+P),++ue}return P}decode(b,O=0){const P=[];let ne=0,ue=this.count;for(ue instanceof u&&(ue=ue.decode(b,O));ne<ue;)P.push(this.elementLayout.decode(b,O)),O+=this.elementLayout.getSpan(b,O),ne+=1;return P}encode(b,O,P=0){const ne=this.elementLayout,ue=b.reduce((Te,ve)=>Te+ne.encode(ve,O,P+Te),0);return this.count instanceof u&&this.count.encode(b.length,O,P),ue}}_e.Sequence=we;class X extends i{constructor(b,O,P){if(!(Array.isArray(b)&&b.reduce((ue,Te)=>ue&&Te instanceof i,!0)))throw new TypeError("fields must be array of Layout instances");typeof O=="boolean"&&P===void 0&&(P=O,O=void 0);for(const ue of b)if(0>ue.span&&ue.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let ne=-1;try{ne=b.reduce((ue,Te)=>ue+Te.getSpan(),0)}catch{}super(ne,O),this.fields=b,this.decodePrefixes=!!P}getSpan(b,O=0){if(0<=this.span)return this.span;let P=0;try{P=this.fields.reduce((ne,ue)=>{const Te=ue.getSpan(b,O);return O+=Te,ne+Te},0)}catch{throw new RangeError("indeterminate span")}return P}decode(b,O=0){t(b);const P=this.makeDestinationObject();for(const ne of this.fields)if(ne.property!==void 0&&(P[ne.property]=ne.decode(b,O)),O+=ne.getSpan(b,O),this.decodePrefixes&&b.length===O)break;return P}encode(b,O,P=0){const ne=P;let ue=0,Te=0;for(const ve of this.fields){let Xe=ve.span;if(Te=0<Xe?Xe:0,ve.property!==void 0){const mt=b[ve.property];mt!==void 0&&(Te=ve.encode(mt,O,P),0>Xe&&(Xe=ve.getSpan(O,P)))}ue=P,P+=Xe}return ue+Te-ne}fromArray(b){const O=this.makeDestinationObject();for(const P of this.fields)P.property!==void 0&&0<b.length&&(O[P.property]=b.shift());return O}layoutFor(b){if(typeof b!="string")throw new TypeError("property must be string");for(const O of this.fields)if(O.property===b)return O}offsetOf(b){if(typeof b!="string")throw new TypeError("property must be string");let O=0;for(const P of this.fields){if(P.property===b)return O;0>P.span?O=-1:0<=O&&(O+=P.span)}}}_e.Structure=X;class Z{constructor(b){this.property=b}decode(b,O){throw new Error("UnionDiscriminator is abstract")}encode(b,O,P){throw new Error("UnionDiscriminator is abstract")}}_e.UnionDiscriminator=Z;class ae extends Z{constructor(b,O){if(!(b instanceof u&&b.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");
33super(O||b.property||"variant"),this.layout=b}decode(b,O){return this.layout.decode(b,O)}encode(b,O,P){return this.layout.encode(b,O,P)}}_e.UnionLayoutDiscriminator=ae;class ce extends i{constructor(b,O,P){let ne;if(b instanceof y||b instanceof _)ne=new ae(new h(b));else if(b instanceof u&&b.isCount())ne=new ae(b);else if(b instanceof Z)ne=b;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(O===void 0&&(O=null),!(O===null||O instanceof i))throw new TypeError("defaultLayout must be null or a Layout");if(O!==null){if(0>O.span)throw new Error("defaultLayout must have constant span");O.property===void 0&&(O=O.replicate("content"))}let ue=-1;O&&(ue=O.span,0<=ue&&(b instanceof y||b instanceof _)&&(ue+=ne.layout.span)),super(ue,P),this.discriminator=ne,this.usesPrefixDiscriminator=b instanceof y||b instanceof _,this.defaultLayout=O,this.registry={};let Te=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(ve){return Te(ve)},this.configGetSourceVariant=function(ve){Te=ve.bind(this)}}getSpan(b,O=0){if(0<=this.span)return this.span;const P=this.getVariant(b,O);if(!P)throw new Error("unable to determine span for unrecognized variant");return P.getSpan(b,O)}defaultGetSourceVariant(b){if(Object.prototype.hasOwnProperty.call(b,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(b,this.defaultLayout.property))return;const O=this.registry[b[this.discriminator.property]];if(O&&(!O.layout||O.property&&Object.prototype.hasOwnProperty.call(b,O.property)))return O}else for(const O in this.registry){const P=this.registry[O];if(P.property&&Object.prototype.hasOwnProperty.call(b,P.property))return P}throw new Error("unable to infer src variant")}decode(b,O=0){let P;const ne=this.discriminator,ue=ne.decode(b,O),Te=this.registry[ue];if(Te===void 0){const ve=this.defaultLayout;let Xe=0;this.usesPrefixDiscriminator&&(Xe=ne.layout.span),P=this.makeDestinationObject(),P[ne.property]=ue,P[ve.property]=ve.decode(b,O+Xe)}else P=Te.decode(b,O);return P}encode(b,O,P=0){const ne=this.getSourceVariant(b);if(ne===void 0){const ue=this.discriminator,Te=this.defaultLayout;let ve=0;return this.usesPrefixDiscriminator&&(ve=ue.layout.span),ue.encode(b[ue.property],O,P),ve+Te.encode(b[Te.property],O,P+ve)}return ne.encode(b,O,P)}addVariant(b,O,P){const ne=new N(this,b,O,P);return this.registry[b]=ne,ne}getVariant(b,O=0){let P;return b instanceof Uint8Array?P=this.discriminator.decode(b,O):P=b,this.registry[P]}}_e.Union=ce;class N extends i{constructor(b,O,P,ne){if(!(b instanceof ce))throw new TypeError("union must be a Union");if(!Number.isInteger(O)||0>O)throw new TypeError("variant must be a (non-negative) integer");if(typeof P=="string"&&ne===void 0&&(ne=P,P=null),P){if(!(P instanceof i))throw new TypeError("layout must be a Layout");if(b.defaultLayout!==null&&0<=P.span&&P.span>b.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof ne!="string")throw new TypeError("variant must have a String property")}let ue=b.span;0>b.span&&(ue=P?P.span:0,0<=ue&&b.usesPrefixDiscriminator&&(ue+=b.discriminator.layout.span)),super(ue,ne),this.union=b,this.variant=O,this.layout=P||null}getSpan(b,O=0){if(0<=this.span)return this.span;let P=0;this.union.usesPrefixDiscriminator&&(P=this.union.discriminator.layout.span);let ne=0;return this.layout&&(ne=this.layout.getSpan(b,O+P)),P+ne}decode(b,O=0){const P=this.makeDestinationObject();if(this!==this.union.getVariant(b,O))throw new Error("variant mismatch");let ne=0;return this.union.usesPrefixDiscriminator&&(ne=this.union.discriminator.layout.span),this.layout?P[this.property]=this.layout.decode(b,O+ne):this.property?P[this.property]=!0:this.union.usesPrefixDiscriminator&&(P[this.union.discriminator.property]=this.variant),P}encode(b,O,P=0){let ne=0;if(this.union.usesPrefixDiscriminator&&(ne=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(b,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,O,P);let ue=ne;if(this.layout&&(this.layout.encode(b[this.property],O,P+ne),ue+=this.layout.getSpan(O,P+ne),0<=this.union.span&&ue>this.union.span))throw new Error("encoded variant overruns containing union");return ue}fromArray(b){if(this.layout)return this.layout.fromArray(b)}}_e.VariantLayout=N;function g(m){return 0>m&&(m+=4294967296),m}class v extends i{constructor(b,O,P){if(!(b instanceof y||b instanceof _))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof O=="string"&&P===void 0&&(P=O,O=!1),4<b.span)throw new RangeError("word cannot exceed 32 bits");super(b.span,P),this.word=b,this.msb=!!O,this.fields=[];let ne=0;this._packedSetValue=function(ue){return ne=g(ue),this},this._packedGetValue=function(){return ne}}decode(b,O=0){const P=this.makeDestinationObject(),ne=this.word.decode(b,O);this._packedSetValue(ne);for(const ue of this.fields)ue.property!==void 0&&(P[ue.property]=ue.decode(b));return P}encode(b,O,P=0){const ne=this.word.decode(O,P);this._packedSetValue(ne);for(const ue of this.fields)if(ue.property!==void 0){const Te=b[ue.property];Te!==void 0&&ue.encode(Te)}return this.word.encode(this._packedGetValue(),O,P)}addField(b,O){const P=new E(this,b,O);return this.fields.push(P),P}addBoolean(b){const O=new B(this,b);return this.fields.push(O),O}fieldFor(b){if(typeof b!="string")throw new TypeError("property must be string");for(const O of this.fields)if(O.property===b)return O}}_e.BitStructure=v;class E{constructor(b,O,P){if(!(b instanceof v))throw new TypeError("container must be a BitStructure");
33if(!Number.isInteger(O)||0>=O)throw new TypeError("bits must be positive integer");const ne=8*b.span,ue=b.fields.reduce((Te,ve)=>Te+ve.bits,0);if(O+ue>ne)throw new Error("bits too long for span remainder ("+(ne-ue)+" of "+ne+" remain)");this.container=b,this.bits=O,this.valueMask=(1<<O)-1,O===32&&(this.valueMask=4294967295),this.start=ue,this.container.msb&&(this.start=ne-ue-O),this.wordMask=g(this.valueMask<<this.start),this.property=P}decode(b,O){const P=this.container._packedGetValue();return g(P&this.wordMask)>>>this.start}encode(b){if(typeof b!="number"||!Number.isInteger(b)||b!==g(b&this.valueMask))throw new TypeError(o("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const O=this.container._packedGetValue(),P=g(b<<this.start);this.container._packedSetValue(g(O&~this.wordMask)|P)}}_e.BitField=E;class B extends E{constructor(b,O){super(b,1,O)}decode(b,O){return!!super.decode(b,O)}encode(b){typeof b=="boolean"&&(b=+b),super.encode(b)}}_e.Boolean=B;class z extends i{constructor(b,O){if(!(b instanceof u&&b.isCount()||Number.isInteger(b)&&0<=b))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let P=-1;b instanceof u||(P=b),super(P,O),this.length=b}getSpan(b,O){let P=this.span;return 0>P&&(P=this.length.decode(b,O)),P}decode(b,O=0){let P=this.span;return 0>P&&(P=this.length.decode(b,O)),n(b).slice(O,O+P)}encode(b,O,P){let ne=this.length;if(this.length instanceof u&&(ne=b.length),!(b instanceof Uint8Array&&ne===b.length))throw new TypeError(o("Blob.encode",this)+" requires (length "+ne+") Uint8Array as src");if(P+ne>O.length)throw new RangeError("encoding overruns Uint8Array");const ue=n(b);return n(O).write(ue.toString("hex"),P,ne,"hex"),this.length instanceof u&&this.length.encode(ne,O,P),ne}}_e.Blob=z;class G extends i{constructor(b){super(-1,b)}getSpan(b,O=0){t(b);let P=O;for(;P<b.length&&b[P]!==0;)P+=1;return 1+P-O}decode(b,O=0){const P=this.getSpan(b,O);return n(b).slice(O,O+P-1).toString("utf-8")}encode(b,O,P=0){typeof b!="string"&&(b=String(b));const ne=e.Buffer.from(b,"utf8"),ue=ne.length;if(P+ue>O.length)throw new RangeError("encoding overruns Buffer");const Te=n(O);return ne.copy(Te,P),Te[P+ue]=0,ue+1}}_e.CString=G;class J extends i{constructor(b,O){if(typeof b=="string"&&O===void 0&&(O=b,b=void 0),b===void 0)b=-1;else if(!Number.isInteger(b))throw new TypeError("maxSpan must be an integer");super(-1,O),this.maxSpan=b}getSpan(b,O=0){return t(b),b.length-O}decode(b,O=0){const P=this.getSpan(b,O);
33if(0<=this.maxSpan&&this.maxSpan<P)throw new RangeError("text length exceeds maxSpan");return n(b).slice(O,O+P).toString("utf-8")}encode(b,O,P=0){typeof b!="string"&&(b=String(b));const ne=e.Buffer.from(b,"utf8"),ue=ne.length;if(0<=this.maxSpan&&this.maxSpan<ue)throw new RangeError("text length exceeds maxSpan");if(P+ue>O.length)throw new RangeError("encoding overruns Buffer");return ne.copy(n(O),P),ue}}_e.UTF8=J;class T extends i{constructor(b,O){super(0,O),this.value=b}decode(b,O){return this.value}encode(b,O,P){return 0}}return _e.Constant=T,_e.greedy=((m,b)=>new f(m,b)),_e.offset=((m,b,O)=>new h(m,b,O)),_e.u8=(m=>new y(1,m)),_e.u16=(m=>new y(2,m)),_e.u24=(m=>new y(3,m)),_e.u32=(m=>new y(4,m)),_e.u40=(m=>new y(5,m)),_e.u48=(m=>new y(6,m)),_e.nu64=(m=>new j(m)),_e.u16be=(m=>new _(2,m)),_e.u24be=(m=>new _(3,m)),_e.u32be=(m=>new _(4,m)),_e.u40be=(m=>new _(5,m)),_e.u48be=(m=>new _(6,m)),_e.nu64be=(m=>new M(m)),_e.s8=(m=>new A(1,m)),_e.s16=(m=>new A(2,m)),_e.s24=(m=>new A(3,m)),_e.s32=(m=>new A(4,m)),_e.s40=(m=>new A(5,m)),_e.s48=(m=>
33new A(6,m)),_e.ns64=(m=>new W(m)),_e.s16be=(m=>new D(2,m)),_e.s24be=(m=>new D(3,m)),_e.s32be=(m=>new D(4,m)),_e.s40be=(m=>new D(5,m)),_e.s48be=(m=>new D(6,m)),_e.ns64be=(m=>new K(m)),_e.f32=(m=>new se(m)),_e.f32be=(m=>new re(m)),_e.f64=(m=>new te(m)),_e.f64be=(m=>new pe(m)),_e.struct=((m,b,O)=>new X(m,b,O)),_e.bits=((m,b,O)=>new v(m,b,O)),_e.seq=((m,b,O)=>new we(m,b,O)),_e.union=((m,b,O)=>new ce(m,b,O)),_e.unionLayoutDiscriminator=((m,b)=>new ae(m,b)),_e.blob=((m,b)=>new z(m,b)),_e.cstr=(m=>new G(m)),_e.utf8=((m,b)=>new J(m,b)),_e.constant=((m,b)=>new T(m,b)),_e}var le=C7();class M7 extends TypeError{constructor(t,n){let i;const{message:o,explanation:l,...u}=t,{path:f}=t,h=f.length===0?o:`At path: ${f.join(".")} -- ${o}`;super(l??h),l!=null&&(this.cause=h),Object.assign(this,u),this.name=this.constructor.name,this.failures=()=>i??(i=[t,...n()])}}function B7(e){return uu(e)&&typeof e[Symbol.iterator]=="function"}function uu(e){return typeof e=="object"&&e!=null}function hd(e){return uu(e)&&!Array.isArray(e)}function Vi(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function D7(e){const{done:t,value:n}=e.next();return t?void 0:n}function O7(e,t,n,i){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:o,branch:l}=t,{type:u}=n,{refinement:f,message:h=`Expected a value of type \`${u}\`${f?` with refinement \`${f}\``:""}, but received: \`${Vi(i)}\``}=e;return{value:i,type:u,refinement:f,key:o[o.length-1],path:o,branch:l,...e,message:h}}function*fx(e,t,n,i){B7(e)||(e=[e]);for(const o of e){const l=O7(o,t,n,i);l&&(yield l)}}function*C1(e,t,n={}){const{path:i=[],branch:o=[e],coerce:l=!1,mask:u=!1}=n,f={path:i,branch:o,mask:u};l&&(e=t.coercer(e,f));let h="valid";for(const y of t.validator(e,f))y.explanation=n.message,h="not_valid",yield[y,void 0];for(let[y,_,A]of t.entries(e,f)){const D=C1(_,A,{path:y===void 0?i:[...i,y],branch:y===void 0?o:[...o,_],coerce:l,mask:u,message:n.message});for(const U of D)U[0]?(h=U[0].refinement!=null?"not_refined":"not_valid",yield[U[0],void 0]):l&&(_=U[1],y===void 0?e=_:e instanceof Map?e.set(y,_):e instanceof Set?e.add(_):uu(e)&&(_!==void 0||y in e)&&(e[y]=_))}if(h!=="not_valid")for(const y of t.refiner(e,f))y.explanation=n.message,h="not_refined",yield[y,void 0];h==="valid"&&(yield[void 0,e])}let ts=class{constructor(t){const{type:n,schema:i,validator:o,refiner:l,coercer:u=h=>h,entries:f=function*(){}}=t;this.type=n,this.schema=i,this.entries=f,this.coercer=u,o?this.validator=(h,y)=>{const _=o(h,y);return fx(_,y,this,h)}:this.validator=()=>[],l?this.refiner=(h,y)=>{const _=l(h,y);return fx(_,y,this,h)}:this.refiner=()=>[]}assert(t,n){return N7(t,this,n)}create(t,n){return Kc(t,this,n)}is(t){return l2(t,this)}mask(t,n){return k7(t,this,n)}validate(t,n={}){return fu(t,this,n)}};function N7(e,t,n){const i=fu(e,t,{message:n});if(i[0])throw i[0]}function Kc(e,t,n){const i=fu(e,t,{coerce:!0,message:n});if(i[0])throw i[0];return i[1]}function k7(e,t,n){const i=fu(e,t,{coerce:!0,mask:!0,message:n});if(i[0])throw i[0];return i[1]}function l2(e,t){return!fu(e,t)[0]}function fu(e,t,n={}){const i=C1(e,t,n),o=D7(i);return o[0]?[new M7(o[0],function*(){for(const u of i)u[0]&&(yield u[0])}),void 0]:[void 0,o[1]]}function fo(e,t){return new ts({type:e,schema:null,validator:t})}function U7(){return fo("any",()=>!0)}function ot(e){return new ts({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[n,i]of t.entries())yield[n,i,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${Vi(t)}`}})}function Qi(){return fo("boolean",e=>typeof e=="boolean")}function M1(e){return fo("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${Vi(t)}`)}function Fn(e){const t=Vi(e),n=typeof e;return new ts({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?e:null,validator(i){return i===e||`Expected the literal \`${t}\`, but received: ${Vi(i)}`}})}function j7(){return fo("never",()=>!1)}function lt(e){return new ts({...e,validator:(t,n)=>t===null||e.validator(t,n),refiner:(t,n)=>t===null||e.refiner(t,n)})}function Ae(){return fo("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${Vi(e)}`)}function St(e){return new ts({...e,validator:(t,n)=>t===void 0||e.validator(t,n),refiner:(t,n)=>t===void 0||e.refiner(t,n)})}function c2(e,t){return new ts({type:"record",schema:null,*entries(n){if(uu(n))for(const i in n){const o=n[i];yield[i,i,e],yield[i,o,t]}},validator(n){return hd(n)||`Expected an object, but received: ${Vi(n)}`},coercer(n){return hd(n)?{...n}:n}})}function We(){return fo("string",e=>typeof e=="string"||`Expected a string, but received: ${Vi(e)}`)}function B1(e){const t=j7();return new ts({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const i=Math.max(e.length,n.length);for(let o=0;o<i;o++)yield[o,n[o],e[o]||t]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${Vi(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function Pe(e){const t=Object.keys(e);return new ts({type:"type",schema:e,*entries(n){if(uu(n))for(const i of t)yield[i,n[i],e[i]]},validator(n){return hd(n)||`Expected an object, but received: ${Vi(n)}`},coercer(n){return hd(n)?{...n}:n}})}function Wr(e){const t=e.map(n=>n.type).join(" | ");return new ts({type:"union",schema:null,coercer(n,i){for(const o of e){const[l,u]=o.val
vendor: 8,272 bytes, line 33
33idate(n,{coerce:!0,mask:i.mask});if(!l)return u}return n},validator(n,i){const o=[];for(const l of e){const[...u]=C1(n,l,i),[f]=u;if(f[0])for(const[h]of u)h&&o.push(h);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${Vi(n)}`,...o]}})}function Il(){return fo("unknown",()=>!0)}function du(e,t,n){return new ts({...e,coercer:(i,o)=>l2(i,t)?e.coercer(n(i,o),o):e.coercer(i,o)})}var Nf,L7=new Uint8Array(16);function u2(){if(!Nf&&(Nf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Nf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Nf(L7)}const z7=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ld(e){return typeof e=="string"&&z7.test(e)}var Er=[];for(var Pp=0;Pp<256;++Pp)Er.push((Pp+256).toString(16).substr(1));function zd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(Er[e[t+0]]+Er[e[t+1]]+Er[e[t+2]]+Er[e[t+3]]+"-"+Er[e[t+4]]+Er[e[t+5]]+"-"+Er[e[t+6]]+Er[e[t+7]]+"-"+Er[e[t+8]]+Er[e[t+9]]+"-"+Er[e[t+10]]+Er[e[t+11]]+Er[e[t+12]]+Er[e[t+13]]+Er[e[t+14]]+Er[e[t+15]]).toLowerCase();if(!Ld(n))throw TypeError("Stringified UUID is invalid");return n}var dx,Hp,Vp=0,Fp=0;function P7(e,t,n){var i=t&&n||0,o=t||new Array(16);e=e||{};var l=e.node||dx,u=e.clockseq!==void 0?e.clockseq:Hp;if(l==null||u==null){var f=e.random||(e.rng||u2)();l==null&&(l=dx=[f[0]|1,f[1],f[2],f[3],f[4],f[5]]),u==null&&(u=Hp=(f[6]<<8|f[7])&16383)}var h=e.msecs!==void 0?e.msecs:Date.now(),y=e.nsecs!==void 0?e.nsecs:Fp+1,_=h-Vp+(y-Fp)/1e4;if(_<0&&e.clockseq===void 0&&(u=u+1&16383),(_<0||h>Vp)&&e.nsecs===void 0&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Vp=h,Fp=y,Hp=u,h+=122192928e5;var A=((h&268435455)*1e4+y)%4294967296;o[i++]=A>>>24&255,o[i++]=A>>>16&255,o[i++]=A>>>8&255,o[i++]=A&255;var D=h/4294967296*1e4&268435455;o[i++]=D>>>8&255,o[i++]=D&255,o[i++]=D>>>24&15|16,o[i++]=D>>>16&255,o[i++]=u>>>8|128,o[i++]=u&255;for(var U=0;U<6;++U)o[i+U]=l[U];return t||zd(o)}function f2(e){if(!Ld(e))throw TypeError("Invalid UUID");var t,n=new Uint8Array(16);return n[0]=(t=parseInt(e.slice(0,8),16))>>>24,n[1]=t>>>16&255,n[2]=t>>>8&255,n[3]=t&255,n[4]=(t=parseInt(e.slice(9,13),16))>>>8,n[5]=t&255,n[6]=(t=parseInt(e.slice(14,18),16))>>>8,n[7]=t&255,n[8]=(t=parseInt(e.slice(19,23),16))>>>8,n[9]=t&255,n[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,n[11]=t/4294967296&255,n[12]=t>>>24&255,n[13]=t>>>16&255,n[14]=t>>>8&255,n[15]=t&255,n}function H7(e){e=unescape(encodeURIComponent(e));for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t}var V7="6ba7b810-9dad-11d1-80b4-00c04fd430c8",F7="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function d2(e,t,n){function i(o,l,u,f){if(typeof o=="string"&&(o=H7(o)),typeof l=="string"&&(l=f2(l)),l.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var h=new Uint8Array(16+o.length);if(h.set(l),h.set(o,l.length),h=n(h),h[6]=h[6]&15|t,h[8]=h[8]&63|128,u){f=f||0;for(var y=0;y<16;++y)u[f+y]=h[y];return u}return zd(h)}try{i.name=e}catch{}return i.DNS=V7,i.URL=F7,i}function K7(e){if(typeof e=="string"){var t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(var n=0;n<t.length;++n)e[n]=t.charCodeAt(n)}return q7($7(W7(e),e.length*8))}function q7(e){for(var t=[],n=e.length*32,i="0123456789abcdef",o=0;o<n;o+=8){var l=e[o>>5]>>>o%32&255,u=parseInt(i.charAt(l>>>4&15)+i.charAt(l&15),16);t.push(u)}return t}function h2(e){return(e+64>>>9<<4)+14+1}function $7(e,t){e[t>>5]|=128<<t%32,e[h2(t)-1]=t;for(var n=1732584193,i=-271733879,o=-1732584194,l=271733878,u=0;u<e.length;u+=16){var f=n,h=i,y=o,_=l;n=Dr(n,i,o,l,e[u],7,-680876936),l=Dr(l,n,i,o,e[u+1],12,-389564586),o=Dr(o,l,n,i,e[u+2],17,606105819),i=Dr(i,o,l,n,e[u+3],22,-1044525330),n=Dr(n,i,o,l,e[u+4],7,-176418897),l=Dr(l,n,i,o,e[u+5],12,1200080426),o=Dr(o,l,n,i,e[u+6],17,-1473231341),i=Dr(i,o,l,n,e[u+7],22,-45705983),n=Dr(n,i,o,l,e[u+8],7,1770035416),l=Dr(l,n,i,o,e[u+9],12,-1958414417),o=Dr(o,l,n,i,e[u+10],17,-42063),i=Dr(i,o,l,n,e[u+11],22,-1990404162),n=Dr(n,i,o,l,e[u+12],7,1804603682),l=Dr(l,n,i,o,e[u+13],12,-40341101),o=Dr(o,l,n,i,e[u+14],17,-1502002290),i=Dr(i,o,l,n,e[u+15],22,1236535329),n=Or(n,i,o,l,e[u+1],5,-165796510),l=Or(l,n,i,o,e[u+6],9,-1069501632),o=Or(o,l,n,i,e[u+11],14,643717713),i=Or(i,o,l,n,e[u],20,-373897302),n=Or(n,i,o,l,e[u+5],5,-701558691),l=Or(l,n,i,o,e[u+10],9,38016083),o=Or(o,l,n,i,e[u+15],14,-660478335),i=Or(i,o,l,n,e[u+4],20,-405537848),n=Or(n,i,o,l,e[u+9],5,568446438),l=Or(l,n,i,o,e[u+14],9,-1019803690),o=Or(o,l,n,i,e[u+3],14,-187363961),i=Or(i,o,l,n,e[u+8],20,1163531501),n=Or(n,i,o,l,e[u+13],5,-1444681467),l=Or(l,n,i,o,e[u+2],9,-51403784),o=Or(o,l,n,i,e[u+7],14,1735328473),i=Or(i,o,l,n,e[u+12],20,-1926607734),n=Nr(n,i,o,l,e[u+5],4,-378558),l=Nr(l,n,i,o,e[u+8],11,-2022574463),o=Nr(o,l,n,i,e[u+11],16,1839030562),i=Nr(i,o,l,n,e[u+14],23,-35309556),n=Nr(n,i,o,l,e[u+1],4,-1530992060),l=Nr(l,n,i,o,e[u+4],11,1272893353),o=Nr(o,l,n,i,e[u+7],16,-155497632),i=Nr(i,o,l,n,e[u+10],23,-1094730640),n=Nr(n,i,o,l,e[u+13],4,681279174),l=Nr(l,n,i,o,e[u],11,-358537222),o=Nr(o,l,n,i,e[u+3],16,-722521979),i=Nr(i,o,l,n,e[u+6],23,76029189),n=Nr(n,i,o,l,e[u+9],4,-640364487),l=Nr(l,n,i,o,e[u+12],11,-421815835),o=Nr(o,l,n,i,e[u+15],16,530742520),i=Nr(i,o,l,n,e[u+2],23,-995338651),n=kr(n,i,o,l,e[u],6,-198630844),l=kr(l,n,i,o,e[u+7],10,1126891415),o=kr(o,l,n,i,e[u+14],15,-1416354905),i=kr(i,o,l,n,e[u+5],21,-57434055),n=kr(n,i,o,l,e[u+12],6,1700485571),l=kr(l,n,i,o,e[u+3],10,-1894986606),o=kr(o,l,n,i,e[u+10],15,-1051523),i=kr(i,o,l,n,e[u+1],21,-2054922799),n=kr(n,i,o,l,e[u+8],6,1873313359),l=kr(l,n,i,o,e[u+15],10,-30611744),o=kr(o,l,n,i,e[u+6],15,-1560198380),i=kr(i,o,l,n,e[u+13],21,1309151649),n=kr(n,i,o,l,e[u+4],6,-145523070),l=kr(l,n,i,o,e[u+11],10,-1120210379),o=kr(o,l,n,i,e[u+2],15,718787259),i=kr(i,o,l,n,e[u+9],21,-343485551),n=ya(n,f),i=ya(i,h),o=ya(o,y),l=ya(l,_)}return[n,i,o,l]}function W7(e){if(e.length===0)return[];for(var t=e.length*8,n=new Uint32Array(h2(t)),i=0;i<t;i+=8)n[i>>5]|=(e[i/8]&255)<<i%32;return n}function ya(e,t){var n=(e&65535)+(t&65535),i=(e>>16)+(t>>16)+(n>>16);return i<<16|n&65535}function G7(e,t){return e<<t|e>>>32-t}function Pd(e,t,n,i,o,l){return ya(G7(ya(ya(t,e),ya(i,l)),o),n)}function Dr(e,t,n,i,o,l,u){return Pd(t&n|~t&i,e,t,o,l,u)}function Or(e,t,n,i,o,l,u){return Pd(t&i|n&~i,e,t,o,l,u)}function Nr(e,t,n,i,o,l,u){return Pd(t^n^i,e,t,o,l,u)}function kr(e,t,n,i,o,l,u){return Pd(n^(t|~i),e,t,o,l,u)}var Y7=d2("v3",48,K7);function Z7(e,t,n){e=e||{};var i=e.random||(e.rng||u2)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=i[o];return t}return zd(i)}function J7(e,t,n,i){switch(e){case 0:return t&n^~t&i;case 1:return t^n^i;case 2:return t&n^t&i^n&i;case 3:return t^n^i}}function Kp(e,t){return e<<t|e>>>32-t}function X7(e){var t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){var i=unescape(encodeURIComponent(e));e=[];for(var o=0;o<i.length;++o)e.push(i.charCodeAt(o))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);for(var l=e.length/4+2,u=Math.ceil(l/16),f=new Array(u),h=0;h<u;++h){for(var y=new Uint32Array(16),_=0;_<16;++_)y[_]=e[h*64+_*4]<<24|e[h*64+_*4+1]<<16|e[h*64+_*4+2]<<8|e[h*64+_*4+3];f[h]=y}f[u-1][14]=(e.length-1)*8/Math.pow(2,32),f[u-1][14]=Math.floor(f[u-1][14]),f[u-1][15]=(e.length-1)*8&4294967295;for(var A=0;A<u;++A){for(var D=new Uint32Array(80),U=0;U<16;++U)D[U]=f[A][U];for(var L=16;L<80;++L)D[L]=Kp(D[L-3]^D[L-8]^D[L-14]^D[L-16],1);for(var k=n[0],j=n[1],M=n[2],W=n[3],K=n[4],se=0;se<80;++se){var re=Math.floor(se/20),te=Kp(k,5)+J7(re,j,M,W)+K+t[re]+D[se]>>>0;K=W,W=M,M=Kp(j,30)>>>0,j=k,k=te}n[0]=n[0]+k>>>0,n[1]=n[1]+j>>>0,n[2]=n[2]+M>>>0,n[3]=n[3]+W>>>0,n[4]=n[4]+K>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>
338&255,n[4]&255]}var Q7=d2("v5",80,X7);const eC="00000000-0000-0000-0000-000000000000";function tC(e){if(!Ld(e))throw TypeError("Invalid UUID");return parseInt(e.substr(14,1),16)}const nC=Object.freeze(Object.defineProperty({__proto__:null,NIL:eC,parse:f2,stringify:zd,v1:P7,v3:Y7,v4:Z7,v5:Q7,validate:Ld,version:tC},Symbol.toStringTag,{value:"Module"})),p2=Qg(nC);var qp,hx;function rC(){if(hx)return qp;hx=1;const e=p2.v4;return qp=function(n,i,o,l){if(typeof n!="string")throw new TypeError(n+" must be a string");l=l||{};const u=typeof l.version=="number"?l.version:2;if(u!==1&&u!==2)throw new TypeError(u+" must be 1 or 2");const f={method:n};if(u===2&&(f.jsonrpc="2.0"),i){if(typeof i!="object"&&!Array.isArray(i))throw new TypeError(i+" must be an object, array or omitted");f.params=i}if(typeof o>"u"){const h=typeof l.generator=="function"?l.generator:function(){return e()};f.id=h(f,l)}else u===2&&o===null?l.notificationIdNull&&(f.id=null):f.id=o;return f},qp}var $p,px;function iC(){if(px)return $p;px=1;const e=p2.v4,t=rC(),n=function(i,o){if(!(this instanceof n))return new n(i,o);o||(o={}),this.options={reviver:typeof o.reviver<"u"?o.reviver:null,replacer:typeof o.replacer<"u"?o.replacer:null,generator:typeof o.generator<"u"?o.generator:function(){return e()},version:typeof o.version<"u"?o.version:2,notificationIdNull:typeof o.notificationIdNull=="boolean"?o.notificationIdNull:!1},this.callServer=i};return $p=n,n.prototype.request=function(i,o,l,u){const f=this;let h=null;const y=Array.isArray(i)&&typeof o=="function";if(this.options.version===1&&y)throw new TypeError("JSON-RPC 1.0 does not support batching");if(y||!y&&i&&typeof i=="object"&&typeof o=="function")u=o,h=i;else{typeof l=="function"&&(u=l,l=void 0);const D=typeof u=="function";try{h=t(i,o,l,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(U){if(D){u(U);return}throw U}if(!D)return h}let A;try{A=JSON.stringify(h,this.options.replacer)}catch(D){u(D);return}return this.callServer(A,function(D,U){f._parseResponse(D,U,u)}),h},n.prototype._parseResponse=function(i,o,l){if(i){l(i);return}if(!o){l();return}let u;try{u=JSON.parse(o,this.options.reviver)}catch(f){l(f);return}if(l.length===3)if(Array.isArray(u)){const f=function(y){return typeof y.error<"u"},h=function(y){return!f(y)};l(null,u.filter(f),u.filter(h));return}else{l(null,u.error,u.result);return}l(null,u)},$p}iC();class g2 extends j3{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,O3(t);const i=Nd(n);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;const o=this.blockLen,l=new Uint8Array(o);l.set(i.length>o?t.create().update(i).digest():i);for(let u=0;u<l.length;u++)l[u]^=54;this.iHash.update(l),this.oHash=t.create();for(let u=0;u<l.length;u++)l[u]^=106;this.oHash.update(l),hl(l)}update(t){return sd(this),this.iHash.update(t),this}digestInto(t){sd(this),co(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:i,finished:o,destroyed:l,blockLen:u,outputLen:f}=this;return t=t,t.finished=o,t.destroyed=l,t.blockLen=u,t.outputLen=f,t.oHash=n._cloneInto(t.oHash),t.iHash=i._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const m2=(e,t,n)=>new g2(e,t).update(n).digest();m2.create=(e,t)=>new g2(e,t);const gx=(e,t)=>(e+(e>=0?t:-t)/y2)/t;function sC(e,t,n){const[[i,o],[l,u]]=t,f=gx(u*e,n),h=gx(-o*e,n);let y=e-f*i-h*l,_=-f*o-h*u;const A=y<Cs,D=_<Cs;A&&(y=-y),D&&(_=-_);const U=lu(Math.ceil(V3(n)/2))+sl;if(y<Cs||y>=U||_<Cs||_>=U)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:A,k1:y,k2neg:D,k2:_}}function jg(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function Wp(e,t){const n={};for(let i of Object.keys(t))n[i]=e[i]===void 0?t[i]:e[i];return so(n.lowS,"lowS"),so(n.prehash,"prehash"),n.format!==void 0&&jg(n.format),n}
vendor: 17,464 bytes, line 33
33class aC extends Error{constructor(t=""){super(t)}}const Ss={Err:aC,_tlv:{encode:(e,t)=>{const{Err:n}=Ss;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const i=t.length/2,o=Df(i);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const l=i>127?Df(o.length/2|128):"";return Df(e)+l+o+t},decode(e,t){const{Err:n}=Ss;let i=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new n("tlv.decode: wrong tlv");const o=t[i++],l=!!(o&128);let u=0;if(!l)u=o;else{const h=o&127;if(!h)throw new n("tlv.decode(long): indefinite length not supported");if(h>4)throw new n("tlv.decode(long): byte length is too big");const y=t.subarray(i,i+h);if(y.length!==h)throw new n("tlv.decode: length bytes not complete");if(y[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const _ of y)u=u<<8|_;if(i+=h,u<128)throw new n("tlv.decode(long): not minimal encoding")}const f=t.subarray(i,i+u);if(f.length!==u)throw new n("tlv.decode: wrong value length");return{v:f,l:t.subarray(i+u)}}},_int:{encode(e){const{Err:t}=Ss;if(e<Cs)throw new t("integer: negative integers are not allowed");let n=Df(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=Ss;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 Ud(e)}},toSig(e){const{Err:t,_int:n,_tlv:i}=Ss,o=Jn("signature",e),{v:l,l:u}=i.decode(48,o);if(u.length)throw new t("invalid signature: left bytes after parsing");const{v:f,l:h}=i.decode(2,l),{v:y,l:_}=i.decode(2,h);if(_.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(f),s:n.decode(y)}},hexFromSig(e){const{_tlv:t,_int:n}=Ss,i=t.encode(2,n.encode(e.r)),o=t.encode(2,n.encode(e.s)),l=i+o;return t.encode(48,l)}},Cs=BigInt(0),sl=BigInt(1),y2=BigInt(2),kf=BigInt(3),oC=BigInt(4);function tl(e,t){const{BYTES:n}=e;let i;if(typeof t=="bigint")i=t;else{let o=Jn("private key",t);try{i=e.fromBytes(o)}catch{throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(i))throw new Error("invalid private key: out of range [1..N-1]");return i}function lC(e,t={}){const n=i2("weierstrass",e,t),{Fp:i,Fn:o}=n;let l=n.CURVE;const{h:u,n:f}=l;cu(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:h}=t;if(h&&(!i.is0(l.a)||typeof h.beta!="bigint"||!Array.isArray(h.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const y=b2(i,o);function _(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function A(ce,N,g){const{x:v,y:E}=N.toAffine(),B=i.toBytes(v);if(so(g,"isCompressed"),g){_();const z=!i.isOdd(E);return Zi(w2(z),B)}else return Zi(Uint8Array.of(4),B,i.toBytes(E))}function D(ce){Pi(ce,void 0,"Point");const{publicKey:N,publicKeyUncompressed:g}=y,v=ce.length,E=ce[0],B=ce.subarray(1);if(v===N&&(E===2||E===3)){const z=i.fromBytes(B);if(!i.isValid(z))throw new Error("bad point: is not on curve, wrong x");const G=k(z);let J;try{J=i.sqrt(G)}catch(b){const O=b instanceof Error?": "+b.message:"";throw new Error("bad point: is not on curve, sqrt error"+O)}_();const T=i.isOdd(J);return(E&1)===1!==T&&(J=i.neg(J)),{x:z,y:J}}else if(v===g&&E===4){const z=i.BYTES,G=i.fromBytes(B.subarray(0,z)),J=i.fromBytes(B.subarray(z,z*2));if(!j(G,J))throw new Error("bad point: is not on curve");return{x:G,y:J}}else throw new Error(`bad point: got length ${v}, expected compressed=${N} or uncompressed=${g}`)}const U=t.toBytes||A,L=t.fromBytes||D;function k(ce){const N=i.sqr(ce),g=i.mul(N,ce);return i.add(i.add(g,i.mul(ce,l.a)),l.b)}function j(ce,N){const g=i.sqr(N),v=k(ce);return i.eql(g,v)}if(!j(l.Gx,l.Gy))throw new Error("bad curve params: generator point");const M=i.mul(i.pow(l.a,kf),oC),W=i.mul(i.sqr(l.b),BigInt(27));if(i.is0(i.add(M,W)))throw new Error("bad curve params: a or b");function K(ce,N,g=!1){if(!i.isValid(N)||g&&i.is0(N))throw new Error(`bad point coordinate ${ce}`);return N}function se(ce){if(!(ce instanceof X))throw new Error("ProjectivePoint expected")}function re(ce){if(!h||!h.basises)throw new Error("no endo");return sC(ce,h.basises,o.ORDER)}const te=od((ce,N)=>{const{X:g,Y:v,Z:E}=ce;if(i.eql(E,i.ONE))return{x:g,y:v};const B=ce.is0();N==null&&(N=B?i.ONE:i.inv(E));const z=i.mul(g,N),G=i.mul(v,N),J=i.mul(E,N);if(B)return{x:i.ZERO,y:i.ZERO};if(!i.eql(J,i.ONE))throw new Error("invZ was invalid");return{x:z,y:G}}),pe=od(ce=>{if(ce.is0()){if(t.allowInfinityPoint&&!i.is0(ce.Y))return;throw new Error("bad point: ZERO")}const{x:N,y:g}=ce.toAffine();if(!i.isValid(N)||!i.isValid(g))throw new Error("bad point: x or y not field elements");if(!j(N,g))throw new Error("bad point: equation left != right");if(!ce.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function we(ce,N,g,v,E){return g=new X(i.mul(g.X,ce),g.Y,g.Z),N=ld(v,N),g=ld(E,g),N.add(g)}class X{constructor(N,g,v){this.X=K("x",N),this.Y=K("y",g,!0),this.Z=K("z",v),Object.freeze(this)}static CURVE(){return l}static fromAffine(N){const{x:g,y:v}=N||{};if(!N||!i.isValid(g)||!i.isValid(v))throw new Error("invalid affine point");if(N instanceof X)throw new Error("projective point not allowed");return i.is0(g)&&i.is0(v)?X.ZERO:new X(g,v,i.ONE)}static fromBytes(N){const g=X.fromAffine(L(Pi(N,void 0,"point")));return g.assertValidity(),g}static fromHex(N){return X.fromBytes(Jn("pointHex",N))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(N=8,g=!0){return ae.createCache(this,N),g||this.multiply(kf),this}assertValidity(){pe(this)}hasEvenY(){const{y:N}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(N)}equals(N){se(N);const{X:g,Y:v,Z:E}=this,{X:B,Y:z,Z:G}=N,J=i.eql(i.mul(g,G),i.mul(B,E)),T=i.eql(i.mul(v,G),i.mul(z,E));return J&&T}negate(){return new X(this.X,i.neg(this.Y),this.Z)}double(){const{a:N,b:g}=l,v=i.mul(g,kf),{X:E,Y:B,Z:z}=this;let G=i.ZERO,J=i.ZERO,T=i.ZERO,m=i.mul(E,E),b=i.mul(B,B),O=i.mul(z,z),P=i.mul(E,B);return P=i.add(P,P),T=i.mul(E,z),T=i.add(T,T),G=i.mul(N,T),J=i.mul(v,O),J=i.add(G,J),G=i.sub(b,J),J=i.add(b,J),J=i.mul(G,J),G=i.mul(P,G),T=i.mul(v,T),O=i.mul(N,O),P=i.sub(m,O),P=i.mul(N,P),P=i.add(P,T),T=i.add(m,m),m=i.add(T,m),m=i.add(m,O),m=i.mul(m,P),J=i.add(J,m),O=i.mul(B,z),O=i.add(O,O),m=i.mul(O,P),G=i.sub(G,m),T=i.mul(O,b),T=i.add(T,T),T=i.add(T,T),new X(G,J,T)}add(N){se(N);const{X:g,Y:v,Z:E}=this,{X:B,Y:z,Z:G}=N;let J=i.ZERO,T=i.ZERO,m=i.ZERO;const b=l.a,O=i.mul(l.b,kf);let P=i.mul(g,B),ne=i.mul(v,z),ue=i.mul(E,G),Te=i.add(g,v),ve=i.add(B,z);Te=i.mul(Te,ve),ve=i.add(P,ne),Te=i.sub(Te,ve),ve=i.add(g,E);let Xe=i.add(B,G);return ve=i.mul(ve,Xe),Xe=i.add(P,ue),ve=i.sub(ve,Xe),Xe=i.add(v,E),J=i.add(z,G),Xe=i.mul(Xe,J),J=i.add(ne,ue),Xe=i.sub(Xe,J),m=i.mul(b,ve),J=i.mul(O,ue),m=i.add(J,m),J=i.sub(ne,m),m=i.add(ne,m),T=i.mul(J,m),ne=i.add(P,P),ne=i.add(ne,P),ue=i.mul(b,ue),ve=i.mul(O,ve),ne=i.add(ne,ue),ue=i.sub(P,ue),ue=i.mul(b,ue),ve=i.add(ve,ue),P=i.mul(ne,ve),T=i.add(T,P),P=i.mul(Xe,ve),J=i.mul(Te,J),J=i.sub(J,P),P=i.mul(Te,ne),m=i.mul(Xe,m),m=i.add(m,P),new X(J,T,m)}subtract(N){return this.add(N.negate())}is0(){return this.equals(X.ZERO)}multiply(N){const{endo:g}=t;if(!o.isValidNot0(N))throw new Error("invalid scalar: out of range");let v,E;const B=z=>ae.cached(this,z,G=>Za(X,G));if(g){const{k1neg:z,k1:G,k2neg:J,k2:T}=re(N),{p:m,f:b}=B(G),{p:O,f:P}=B(T);E=b.add(P),v=we(g.beta,m,O,z,J)}else{const{p:z,f:G}=B(N);v=z,E=G}return Za(X,[v,E])[0]}multiplyUnsafe(N){const{endo:g}=t,v=this;if(!o.isValid(N))throw new Error("invalid scalar: out of range");if(N===Cs||v.is0())return X.ZERO;if(N===sl)return v;if(ae.hasCache(this))return this.multiply(N);if(g){const{k1neg:E,k1:B,k2neg:z,k2:G}=re(N),{p1:J,p2:T}=QR(X,v,B,G);return we(g.beta,J,T,E,z)}else return ae.unsafe(v,N)}multiplyAndAddUnsafe(N,g,v){const E=this.multiplyUnsafe(g).add(N.multiplyUnsafe(v));return E.is0()?void 0:E}toAffine(N){return te(this,N)}isTorsionFree(){const{isTorsionFree:N}=t;return u===sl?!0:N?N(X,this):ae.unsafe(this,f).is0()}clearCofactor(){const{clearCofactor:N}=t;return u===sl?this:N?N(X,this):this.multiplyUnsafe(u)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}toBytes(N=!0){return so(N,"isCompressed"),this.assertValidity(),U(X,this,N)}toHex(N=!0){return Qa(this.toBytes(N))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(N=!0){return this.toBytes(N)}_setWindowSize(N){this.precompute(N)}static normalizeZ(N){return Za(X,N)}static msm(N,g){return r2(X,o,N,g)}static fromPrivateKey(N){return X.BASE.multiply(tl(o,N))}}X.BASE=new X(l.Gx,l.Gy,i.ONE),X.ZERO=new X(i.ZERO,i.ONE,i.ZERO),X.Fp=i,X.Fn=o;const Z=o.BITS,ae=new n2(X,t.endo?Math.ceil(Z/2):Z);return X.BASE.precompute(8),X}function w2(e){return Uint8Array.of(e?2:3)}function b2(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function cC(e,t={}){const{Fn:n}=e,i=t.randomBytes||E1,o=Object.assign(b2(e.Fp,n),{seed:Q3(n.ORDER)});function l(U){try{return!!tl(n,U)}catch{return!1}}function u(U,L){const{publicKey:k,publicKeyUncompressed:j}=o;try{const M=U.length;return L===!0&&M!==k||L===!1&&M!==j?!1:!!e.fromBytes(U)}catch{return!1}}function f(U=i(o.seed)){return ZR(Pi(U,o.seed,"seed"),n.ORDER)}function h(U,L=!0){return e.BASE.multiply(tl(n,U)).toBytes(L)}function y(U){const L=f(U);return{secretKey:L,publicKey:h(L)}}function _(U){if(typeof U=="bigint")return!1;if(U instanceof e)return!0;const{secretKey:L,publicKey:k,publicKeyUncompressed:j}=o;if(n.allowedLengths||L===k)return;const M=Jn("key",U).length;return M===k||M===j}function A(U,L,k=!0){if(_(U)===!0)throw new Error("first arg must be private key");if(_(L)===!1)throw new Error("second arg must be public key");const j=tl(n,U);return e.fromHex(L).multiply(j).toBytes(k)}return Object.freeze({getPublicKey:h,getSharedSecret:A,keygen:y,Point:e,utils:{isValidSecretKey:l,isValidPublicKey:u,randomSecretKey:f,isValidPrivateKey:l,randomPrivateKey:f,normPrivateKeyToScalar:U=>tl(n,U),precompute(U=8,L=e.BASE){return L.precompute(U,!1)}},lengths:o})}function uC(e,t,n={}){O3(t),cu(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const i=n.randomBytes||E1,o=n.hmac||((g,...v)=>m2(t,g,Zi(...v))),{Fp:l,Fn:u}=e,{ORDER:f,BITS:h}=u,{keygen:y,getPublicKey:_,getSharedSecret:A,utils:D,lengths:U}=cC(e,n),L={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},k="compact";function j(g){const v=f>>sl;return g>v}function M(g,v){if(!u.isValidNot0(v))throw new Error(`invalid signature ${g}: out of range 1..Point.Fn.ORDER`);return v}function W(g,v){jg(v);const E=U.signature,B=v==="compact"?E:v==="recovered"?E+1:void 0;return Pi(g,B,`${v} signature`)}class K{constructor(v,E,B){this.r=M("r",v),this.s=M("s",E),B!=null&&(this.recovery=B),Object.freeze(this)}static fromBytes(v,E=k){W(v,E);let B;if(E==="der"){const{r:T,s:m}=Ss.toSig(Pi(v));return new K(T,m)}E==="recovered"&&(B=v[0],E="compact",v=v.subarray(1));const z=u.BYTES,G=v.subarray(0,z),J=v.subarray(z,z*2);return new K(u.fromBytes(G),u.fromBytes(J),B)}static fromHex(v,E){return this.fromBytes(ad(v),E)}addRecoveryBit(v){return new K(this.r,this.s,v)}recoverPublicKey(v){const E=l.ORDER,{r:B,s:z,recovery:G}=this;if(G==null||![0,1,2,3].includes(G))throw new Error("recovery id invalid");if(f*y2<E&&G>1)throw new Error("recovery id is ambiguous for h>1 curve");const T=G===2||G===3?B+f:B;if(!l.isValid(T))throw new Error("recovery id 2 or 3 invalid");const m=l.toBytes(T),b=e.fromBytes(Zi(w2((G&1)===0),m)),O=u.inv(T),P=re(Jn("msgHash",v)),ne=u.create(-P*O),ue=u.create(z*O),Te=e.BASE.multiplyUnsafe(ne).add(b.multiplyUnsafe(ue));if(Te.is0())throw new Error("point at infinify");return Te.assertValidity(),Te}hasHighS(){return j(this.s)}toBytes(v=k){if(jg(v),v==="der")return ad(Ss.hexFromSig(this));const E=u.toBytes(this.r),B=u.toBytes(this.s);if(v==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Zi(Uint8Array.of(this.recovery),E,B)}return Zi(E,B)}toHex(v){return Qa(this.toBytes(v))}assertValidity(){}static fromCompact(v){return K.fromBytes(Jn("sig",v),"compact")}static fromDER(v){return K.fromBytes(Jn("sig",v),"der")}normalizeS(){return this.hasHighS()?new K(this.r,u.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return Qa(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return Qa(this.toBytes("compact"))}}const se=n.bits2int||function(v){if(v.length>8192)throw new Error("input is too large");const E=Ud(v),B=v.length*8-h;return B>0?E>>BigInt(B):E},re=n.bits2int_modN||function(v){return u.create(se(v))},te=lu(h);function pe(g){return Ug("num < 2^"+h,g,Cs,te),u.toBytes(g)}function we(g,v){return Pi(g,void 0,"message"),v?Pi(t(g),void 0,"prehashed message"):g}function X(g,v,E){if(["recovered","canonical"].some(ne=>ne in E))throw new Error("sign() legacy options not supported");const{lowS:B,prehash:z,extraEntropy:G}=Wp(E,L);g=we(g,z);const J=re(g),T=tl(u,v),m=[pe(T),pe(J)];if(G!=null&&G!==!1){const ne=G===!0?i(U.secretKey):G;m.push(Jn("extraEntropy",ne))}const b=Zi(...m),O=J;function P(ne){const ue=se(ne);if(!u.isValidNot0(ue))return;const Te=u.inv(ue),ve=e.BASE.multiply(ue).toAffine(),Xe=u.create(ve.x);if(Xe===Cs)return;const mt=u.create(Te*u.create(O+Xe*T));if(mt===Cs)return;let He=(ve.x===Xe?0:2)|Number(ve.y&sl),At=mt;return B&&j(mt)&&(At=u.neg(mt),He^=1),new K(Xe,At,He)}return{seed:b,k2sig:P}}function Z(g,v,E={}){g=Jn("message",g);const{seed:B,k2sig:z}=X(g,v,E);return PR(t.outputLen,u.BYTES,o)(B,z)}function ae(g){let v;const E=typeof g=="string"||au(g),B=!E&&g!==null&&typeof g=="object"&&typeof g.r=="bigint"&&typeof g.s=="bigint";if(!E&&!B)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(B)v=new K(g.r,g.s);else if(E){try{v=K.fromBytes(Jn("sig",g),"der")}catch(z){if(!(z instanceof Ss.Err))throw z}if(!v)try{v=K.fromBytes(Jn("sig",g),"compact")}catch{return!1}}return v||!1}function ce(g,v,E,B={}){const{lowS:z,prehash:G,format:J}=Wp(B,L);if(E=Jn("publicKey",E),v=we(Jn("message",v),G),"strict"in B)throw new Error("options.strict was renamed to lowS");const T=J===void 0?ae(g):K.fromBytes(Jn("sig",g),J);if(T===!1)return!1;try{const m=e.fromBytes(E);if(z&&T.hasHighS())return!1;const{r:b,s:O}=T,P=re(v),ne=u.inv(O),ue=u.create(P*ne),Te=u.create(b*ne),ve=e.BASE.multiplyUnsafe(ue).add(m.multiplyUnsafe(Te));return ve.is0()?!1:u.create(ve.x)===b}catch{return!1}}function N(g,v,E={}){const{prehash:B}=Wp(E,L);return v=we(v,B),K.fromBytes(g,"recovered").recoverPublicKey(v).toBytes()}return Object.freeze({keygen:y,getPublicKey:_,getSharedSecret:A,utils:D,lengths:U,Point:e,sign:Z,verify:ce,recoverPublicKey:N,Signature:K,hash:t})}function fC(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let i=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map(u=>Math.ceil(u/2)))):void 0;const o=uo(t.n,{BITS:e.nBitLength,allowedLengths:i,modFromBytes:e.wrapPrivateKey}),l={Fp:n,Fn:o,allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes};return{CURVE:t,curveOpts:l}}function dC(e){const{CURVE:t,curveOpts:n}=fC(e),i={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:i}}function hC(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,J3(n.Fn.ORDER,n.Fn.BITS))})}function pC(e){const{CURVE:t,curveOpts:n,hash:i,ecdsaOpts:o}=dC(e),l=lC(t,n),u=uC(l,i,o);return hC(e,u)}function gC(e,t){const n=i=>pC({...e,hash:i});return{...n(t),create:n}}const D1={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},mC={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},mx=BigInt(2);function yC(e){const t=D1.p,n=BigInt(3),i=BigInt(6),o=BigInt(11),l=BigInt(22),u=BigInt(23),f=BigInt(44),h=BigInt(88),y=e*e*e%t,_=y*y*e%t,A=Zn(_,n,t)*_%t,D=Zn(A,n,t)*_%t,U=Zn(D,mx,t)*y%t,L=Zn(U,o,t)*U%t,k=Zn(L,l,t)*L%t,j=Zn(k,f,t)*k%t,M=Zn(j,h,t)*j%t,W=Zn(M,f,t)*k%t,K=Zn(W,n,t)*_%t,se=Zn(K,u,t)*L%t,re=Zn(se,i,t)*y%t,te=Zn(re,mx,t);if(!Lg.eql(Lg.sqr(te),e))throw new Error("Cannot find square root");return te}const Lg=uo(D1.p,{sqrt:yC}),wC=gC({...D1,Fp:Lg,lowS:!0,endo:mC},ou);_l.utils.randomPrivateKey;const yx=()=>{const e=_l.utils.randomPrivateKey(),t=zg(e),n=new Uint8Array(64);return n.set(e),n.set(t,32),{publicKey:t,secretKey:n}},zg=_l.getPublicKey;
33function wx(e){try{return _l.ExtendedPoint.fromHex(e),!0}catch{return!1}}const v2=(e,t)=>_l.sign(e,t.slice(0,32)),bC=_l.verify,Kr=e=>Tt.Buffer.isBuffer(e)?e:e instanceof Uint8Array?Tt.Buffer.from(e.buffer,e.byteOffset,e.byteLength):Tt.Buffer.from(e);class vC{constructor(t){Object.assign(this,t)}encode(){return Tt.Buffer.from(zp.serialize(Gf,this))}static decode(t){return zp.deserialize(Gf,this,t)}static decodeUnchecked(t){return zp.deserializeUnchecked(Gf,this,t)}}const Gf=new Map;var x2;const xC=32,xa=32;function EC(e){return e._bn!==void 0}let bx=1;class Ut extends vC{constructor(t){if(super({}),this._bn=void 0,EC(t))this._bn=t._bn;else{if(typeof t=="string"){const n=$r.decode(t);if(n.length!=xa)throw new Error("Invalid public key input");this._bn=new nx(n)}else this._bn=new nx(t);if(this._bn.byteLength()>xa)throw new Error("Invalid public key input")}}static unique(){const t=new Ut(bx);return bx+=1,new Ut(t.toBuffer())}equals(t){return this._bn.eq(t._bn)}toBase58(){return $r.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const t=this.toBuffer();return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}toBuffer(){const t=this._bn.toArrayLike(Tt.Buffer);if(t.length===xa)return t;const n=Tt.Buffer.alloc(32);return t.copy(n,32-t.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(t,n,i){const o=Tt.Buffer.concat([t.toBuffer(),Tt.Buffer.from(n),i.toBuffer()]),l=ax(o);return new Ut(l)}static createProgramAddressSync(t,n){let i=Tt.Buffer.alloc(0);t.forEach(function(l){if(l.length>xC)throw new TypeError("Max seed length exceeded");i=Tt.Buffer.concat([i,Kr(l)])}),i=Tt.Buffer.concat([i,n.toBuffer(),Tt.Buffer.from("ProgramDerivedAddress")]);const o=ax(i);if(wx(o))throw new Error("Invalid seeds, address must fall off the curve");return new Ut(o)}static async createProgramAddress(t,n){return this.createProgramAddressSync(t,n)}static findProgramAddressSync(t,n){let i=255,o;for(;i!=0;){try{const l=t.concat(Tt.Buffer.from([i]));o=this.createProgramAddressSync(l,n)}catch(l){if(l instanceof TypeError)throw l;i--;continue}return[o,i]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(t,n){return this.findProgramAddressSync(t,n)}static isOnCurve(t){const n=new Ut(t);return wx(n.toBytes())}}x2=Ut;Ut.default=new x2("11111111111111111111111111111111");Gf.set(Ut,{kind:"struct",fields:[["_bn","u256"]]});new Ut("BPFLoader1111111111111111111111111111111111");const al=1232,O1=127,pd=64;class gd{constructor(t,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=t,this.accountKeysFromLookups=n}keySegments(){const t=[this.staticAccountKeys];return this.accountKeysFromLookups&&(t.push(this.accountKeysFromLookups.writable),t.push(this.accountKeysFromLookups.readonly)),t}get(t){for(const n of this.keySegments()){if(t<n.length)return n[t];t-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(t){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const i=new Map;this.keySegments().flat().forEach((l,u)=>{i.set(l.toBase58(),u)});const o=l=>{const u=i.get(l.toBase58());if(u===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return u};return t.map(l=>({programIdIndex:o(l.programId),accountKeyIndexes:l.keys.map(u=>o(u.pubkey)),data:l.data}))}}const sn=(e="publicKey")=>le.blob(32,e),SC=(e="signature")=>le.blob(64,e),nl=(e="string")=>{const t=le.struct([le.u32("length"),le.u32("lengthPadding"),le.blob(le.offset(le.u32(),-8),"chars")],e),n=t.decode.bind(t),i=t.encode.bind(t),o=t;return o.decode=(l,u)=>n(l,u).chars.toString(),o.encode=(l,u,f)=>{const h={chars:Tt.Buffer.from(l,"utf8")};return i(h,u,f)},o.alloc=l=>le.u32().span+le.u32().span+Tt.Buffer.from(l,"utf8").length,o},AC=(e="authorized")=>le.struct([sn("staker"),sn("withdrawer")],e),_C=(e="lockup")=>le.struct([le.ns64("unixTimestamp"),le.ns64("epoch"),sn("custodian")],e),IC=(e="voteInit")=>le.struct([sn("nodePubkey"),sn("authorizedVoter"),sn("authorizedWithdrawer"),le.u8("commission")],e),TC=(e="voteAuthorizeWithSeedArgs")=>le.struct([le.u32("voteAuthorizationType"),sn("currentAuthorityDerivedKeyOwnerPubkey"),nl("currentAuthorityDerivedKeySeed"),sn("newAuthorized")],e);function E2(e,t){const n=o=>
33{if(o.span>=0)return o.span;if(typeof o.alloc=="function")return o.alloc(t[o.property]);if("count"in o&&"elementLayout"in o){const l=t[o.property];if(Array.isArray(l))return l.length*n(o.elementLayout)}else if("fields"in o)return E2({layout:o},t[o.property]);return 0};let i=0;return e.layout.fields.forEach(o=>{i+=n(o)}),i}function hi(e){let t=0,n=0;for(;;){let i=e.shift();if(t|=(i&127)<<n*7,n+=1,(i&128)===0)break}return t}function pi(e,t){let n=t;for(;;){let i=n&127;if(n>>=7,n==0){e.push(i);break}else i|=128,e.push(i)}}function tr(e,t){if(!e)throw new Error(t||"Assertion failed")}class Hd{constructor(t,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=t,this.keyMetaMap=n}static compile(t,n){const i=new Map,o=u=>{const f=u.toBase58();let h=i.get(f);return h===void 0&&(h={isSigner:!1,isWritable:!1,isInvoked:!1},i.set(f,h)),h},l=o(n);l.isSigner=!0,l.isWritable=!0;for(const u of t){o(u.programId).isInvoked=!0;for(const f of u.keys){const h=o(f.pubkey);h.isSigner||=f.isSigner,h.isWritable||=f.isWritable}}return new Hd(n,i)}getMessageComponents(){const t=[...this.keyMetaMap.entries()];tr(t.length<=256,"Max static account keys length exceeded");const n=t.filter(([,h])=>h.isSigner&&h.isWritable),i=t.filter(([,h])=>h.isSigner&&!h.isWritable),o=t.filter(([,h])=>!h.isSigner&&h.isWritable),l=t.filter(([,h])=>!h.isSigner&&!h.isWritable),u={numRequiredSignatures:n.length+i.length,numReadonlySignedAccounts:i.length,numReadonlyUnsignedAccounts:l.length};{tr(n.length>0,"Expected at least one writable signer key");const[h]=n[0];tr(h===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const f=[...n.map(([h])=>new Ut(h)),...i.map(([h])=>new Ut(h)),...o.map(([h])=>new Ut(h)),...l.map(([h])=>new Ut(h))];return[u,f]}extractTableLookup(t){const[n,i]=this.drainKeysFoundInLookupTable(t.state.addresses,u=>!u.isSigner&&!u.isInvoked&&u.isWritable),[o,l]=this.drainKeysFoundInLookupTable(t.state.addresses,u=>!u.isSigner&&!u.isInvoked&&!u.isWritable);if(!(n.length===0&&o.length===0))return[{accountKey:t.key,writableIndexes:n,readonlyIndexes:o},{writable:i,readonly:l}]}drainKeysFoundInLookupTable(t,n){const i=new Array,o=new Array;for(const[l,u]of this.keyMetaMap.entries())if(n(u)){const f=new Ut(l),h=t.findIndex(y=>y.equals(f));h>=0&&(tr(h<256,"Max lookup table index exceeded"),i.push(h),o.push(f),this.keyMetaMap.delete(l))}return[i,o]}}const S2="Reached end of buffer unexpectedly";function Ts(e){if(e.length===0)throw new Error(S2);return e.shift()}function gi(e,...t){const[n]=t;if(t.length===2?n+(t[1]??0)>e.length:n>=e.length)throw new Error(S2);return e.splice(...t)}class ao{constructor(t){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=t.header,this.accountKeys=t.accountKeys.map(n=>new Ut(n)),this.recentBlockhash=t.recentBlockhash,this.instructions=t.instructions,this.instructions.forEach(n=>this.indexToProgramIds.set(n.programIdIndex,this.accountKeys[n.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(t=>({programIdIndex:t.programIdIndex,accountKeyIndexes:t.accounts,data:$r.decode(t.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new gd(this.staticAccountKeys)}static compile(t){const n=Hd.compile(t.instructions,t.payerKey),[i,o]=n.getMessageComponents(),u=new gd(o).compileInstructions(t.instructions).map(f=>({programIdIndex:f.programIdIndex,accounts:f.accountKeyIndexes,data:$r.encode(f.data)}));return new ao({header:i,accountKeys:o,recentBlockhash:t.recentBlockhash,instructions:u})}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const n=this.header.numRequiredSignatures;if(t>=this.header.numRequiredSignatures){const i=t-n,l=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return i<l}else{const i=n-this.header.numReadonlySignedAccounts;return t<i}}isProgramId(t){return this.indexToProgramIds.has(t)}programIds(){return[...this.indexToProgramIds.values()]}
33nonProgramIds(){return this.accountKeys.filter((t,n)=>!this.isProgramId(n))}serialize(){const t=this.accountKeys.length;let n=[];pi(n,t);const i=this.instructions.map(A=>{const{accounts:D,programIdIndex:U}=A,L=Array.from($r.decode(A.data));let k=[];pi(k,D.length);let j=[];return pi(j,L.length),{programIdIndex:U,keyIndicesCount:Tt.Buffer.from(k),keyIndices:D,dataLength:Tt.Buffer.from(j),data:L}});let o=[];pi(o,i.length);let l=Tt.Buffer.alloc(al);Tt.Buffer.from(o).copy(l);let u=o.length;i.forEach(A=>{const U=le.struct([le.u8("programIdIndex"),le.blob(A.keyIndicesCount.length,"keyIndicesCount"),le.seq(le.u8("keyIndex"),A.keyIndices.length,"keyIndices"),le.blob(A.dataLength.length,"dataLength"),le.seq(le.u8("userdatum"),A.data.length,"data")]).encode(A,l,u);u+=U}),l=l.slice(0,u);const f=le.struct([le.blob(1,"numRequiredSignatures"),le.blob(1,"numReadonlySignedAccounts"),le.blob(1,"numReadonlyUnsignedAccounts"),le.blob(n.length,"keyCount"),le.seq(sn("key"),t,"keys"),sn("recentBlockhash")]),h={numRequiredSignatures:Tt.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Tt.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Tt.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Tt.Buffer.from(n),keys:this.accountKeys.map(A=>Kr(A.toBytes())),recentBlockhash:$r.decode(this.recentBlockhash)};let y=Tt.Buffer.alloc(2048);const _=f.encode(h,y);return l.copy(y,_),y.slice(0,_+l.length)}static from(t){let n=[...t];const i=Ts(n);if(i!==(i&O1))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const o=Ts(n),l=Ts(n),u=hi(n);let f=[];for(let D=0;D<u;D++){const U=gi(n,0,xa);f.push(new Ut(Tt.Buffer.from(U)))}const h=gi(n,0,xa),y=hi(n);let _=[];for(let D=0;D<y;D++){const U=Ts(n),L=hi(n),k=gi(n,0,L),j=hi(n),M=gi(n,0,j),W=$r.encode(Tt.Buffer.from(M));_.push({programIdIndex:U,accounts:k,data:W})}const A={header:{numRequiredSignatures:i,numReadonlySignedAccounts:o,numReadonlyUnsignedAccounts:l},recentBlockhash:$r.encode(Tt.Buffer.from(h)),accountKeys:f,instructions:_};return new ao(A)}}class qc{constructor(t){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=t.header,this.staticAccountKeys=t.staticAccountKeys,this.recentBlockhash=t.recentBlockhash,this.compiledInstructions=t.compiledInstructions,this.addressTableLookups=t.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let t=0;for(const n of this.addressTableLookups)t+=n.readonlyIndexes.length+n.writableIndexes.length;return t}getAccountKeys(t){let n;if(t&&"accountKeysFromLookups"in t&&t.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=t.accountKeysFromLookups.writable.length+t.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=t.accountKeysFromLookups}else if(t&&"addressLookupTableAccounts"in t&&t.addressLookupTableAccounts)n=this.resolveAddressTableLookups(t.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new gd(this.staticAccountKeys,n)}isAccountSigner(t){return t<this.header.numRequiredSignatures}isAccountWritable(t){const n=this.header.numRequiredSignatures,i=this.staticAccountKeys.length;if(t>=i){const o=t-i,l=this.addressTableLookups.reduce((u,f)=>u+f.writableIndexes.length,0);return o<l}else if(t>=this.header.numRequiredSignatures){const o=t-n,u=i-n-this.header.numReadonlyUnsignedAccounts;return o<u}else{const o=n-this.header.numReadonlySignedAccounts;return t<o}}resolveAddressTableLookups(t){const n={writable:[],readonly:[]};for(const i of this.addressTableLookups){const o=t.find(l=>l.key.equals(i.accountKey));if(!o)throw new Error(`Failed to find address lookup table account for table key ${i.accountKey.toBase58()}`);for(const l of i.writableIndexes)if(l<o.state.addresses.length)n.writable.push(o.state.addresses[l]);else throw new Error(`Failed to find address for index ${l} in address lookup table ${i.accountKey.toBase58()}`);for(const l of i.readonlyIndexes)if(l<o.state.addresses.length)n.readonly.push(o.state.addresses[l]);else throw new Error(`Failed to find address for index ${l} in address lookup table ${i.accountKey.toBase58()}`)}return n}static compile(t){const n=Hd.compile(t.instructions,t.payerKey),i=new Array,o={writable:new Array,readonly:new Array},l=t.addressLookupTableAccounts||[];for(const _ of l){const A=n.extractTableLookup(_);if(A!==void 0){const[D,{writable:U,readonly:L}]=A;i.push(D),o.writable.push(...U),o.readonly.push(...L)}}const[u,f]=n.getMessageComponents(),y=new gd(f,o).compileInstructions(t.instructions);
33return new qc({header:u,staticAccountKeys:f,recentBlockhash:t.recentBlockhash,compiledInstructions:y,addressTableLookups:i})}serialize(){const t=Array();pi(t,this.staticAccountKeys.length);const n=this.serializeInstructions(),i=Array();pi(i,this.compiledInstructions.length);const o=this.serializeAddressTableLookups(),l=Array();pi(l,this.addressTableLookups.length);const u=le.struct([le.u8("prefix"),le.struct([le.u8("numRequiredSignatures"),le.u8("numReadonlySignedAccounts"),le.u8("numReadonlyUnsignedAccounts")],"header"),le.blob(t.length,"staticAccountKeysLength"),le.seq(sn(),this.staticAccountKeys.length,"staticAccountKeys"),sn("recentBlockhash"),le.blob(i.length,"instructionsLength"),le.blob(n.length,"serializedInstructions"),le.blob(l.length,"addressTableLookupsLength"),le.blob(o.length,"serializedAddressTableLookups")]),f=new Uint8Array(al),y=u.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(t),staticAccountKeys:this.staticAccountKeys.map(_=>_.toBytes()),recentBlockhash:$r.decode(this.recentBlockhash),instructionsLength:new Uint8Array(i),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(l),serializedAddressTableLookups:o},f);return f.slice(0,y)}serializeInstructions(){let t=0;const n=new Uint8Array(al);for(const i of this.compiledInstructions){const o=Array();pi(o,i.accountKeyIndexes.length);const l=Array();pi(l,i.data.length);const u=le.struct([le.u8("programIdIndex"),le.blob(o.length,"encodedAccountKeyIndexesLength"),le.seq(le.u8(),i.accountKeyIndexes.length,"accountKeyIndexes"),le.blob(l.length,"encodedDataLength"),le.blob(i.data.length,"data")]);t+=u.encode({programIdIndex:i.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(o),accountKeyIndexes:i.accountKeyIndexes,encodedDataLength:new Uint8Array(l),data:i.data},n,t)}return n.slice(0,t)}serializeAddressTableLookups(){let t=0;const n=new Uint8Array(al);for(const i of this.addressTableLookups){const o=Array();pi(o,i.writableIndexes.length);const l=Array();pi(l,i.readonlyIndexes.length);const u=le.struct([sn("accountKey"),le.blob(o.length,"encodedWritableIndexesLength"),le.seq(le.u8(),i.writableIndexes.length,"writableIndexes"),le.blob(l.length,"encodedReadonlyIndexesLength"),le.seq(le.u8(),i.readonlyIndexes.length,"readonlyIndexes")]);t+=u.encode({accountKey:i.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(o),writableIndexes:i.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(l),readonlyIndexes:i.readonlyIndexes},n,t)}return n.slice(0,t)}static deserialize(t){let n=[...t];const i=Ts(n),o=i&O1;tr(i!==o,"Expected versioned message but received legacy message");const l=o;tr(l===0,`Expected versioned message with version 0 but found version ${l}`);const u={numRequiredSignatures:Ts(n),numReadonlySignedAccounts:Ts(n),numReadonlyUnsignedAccounts:Ts(n)},f=[],h=hi(n);for(let L=0;L<h;L++)f.push(new Ut(gi(n,0,xa)));const y=$r.encode(gi(n,0,xa)),_=hi(n),A=[];for(let L=0;L<_;L++){const k=Ts(n),j=hi(n),M=gi(n,0,j),W=hi(n),K=new Uint8Array(gi(n,0,W));A.push({programIdIndex:k,accountKeyIndexes:M,data:K})}const D=hi(n),U=[];for(let L=0;L<D;L++){const k=new Ut(gi(n,0,xa)),j=hi(n),M=gi(n,0,j),W=hi(n),K=gi(n,0,W);U.push({accountKey:k,writableIndexes:M,readonlyIndexes:K})}return new qc({header:u,staticAccountKeys:f,recentBlockhash:y,compiledInstructions:A,addressTableLookups:U})}}const A2={deserializeMessageVersion(e){const t=e[0],n=t&O1;return n===t?"legacy":n},deserialize:e=>{const t=A2.deserializeMessageVersion(e);if(t==="legacy")return ao.from(e);if(t===0)return qc.deserialize(e);throw new Error(`Transaction message version ${t} deserialization is not supported`)}},RC=Tt.Buffer.alloc(pd).fill(0);class zr{constructor(t){this.keys=void 0,this.programId=void 0,this.data=Tt.Buffer.alloc(0),this.programId=t.programId,this.keys=t.keys,t.data&&(this.data=t.data)}toJSON(){return{keys:this.keys.map(({pubkey:t,isSigner:n,isWritable:i})=>({pubkey:t.toJSON(),isSigner:n,isWritable:i})),programId:this.programId.toJSON(),data:[...this.data]}}}class ml{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(t){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!t)if(t.feePayer&&(this.feePayer=t.feePayer),t.signatures&&(this.signatures=t.signatures),Object.prototype.hasOwnProperty.call(t,"nonceInfo")){const{minContextSlot:n,nonceInfo:i}=t;this.minNonceContextSlot=n,this.nonceInfo=i}else if(Object.prototype.hasOwnProperty.call(t,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:i}=t;this.recentBlockhash=n,this.lastValidBlockHeight=i}else{const{recentBlockhash:n,nonceInfo:i}=t;i&&(this.nonceInfo=i),this.recentBlockhash=n}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstru
33ction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(t=>t.toJSON()),signers:this.signatures.map(({publicKey:t})=>t.toJSON())}}add(...t){if(t.length===0)throw new Error("No instructions");return t.forEach(n=>{"instructions"in n?this.instructions=this.instructions.concat(n.instructions):"data"in n&&"programId"in n&&"keys"in n?this.instructions.push(n):this.instructions.push(new zr(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let t,n;if(this.nonceInfo?(t=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(t=this.recentBlockhash,n=this.instructions),!t)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let i;if(this.feePayer)i=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)i=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let k=0;k<n.length;k++)if(n[k].programId===void 0)throw new Error(`Transaction instruction index ${k} has undefined program id`);const o=[],l=[];n.forEach(k=>{k.keys.forEach(M=>{l.push({...M})});const j=k.programId.toString();o.includes(j)||o.push(j)}),o.forEach(k=>{l.push({pubkey:new Ut(k),isSigner:!1,isWritable:!1})});const u=[];l.forEach(k=>{const j=k.pubkey.toString(),M=u.findIndex(W=>W.pubkey.toString()===j);M>-1?(u[M].isWritable=u[M].isWritable||k.isWritable,u[M].isSigner=u[M].isSigner||k.isSigner):u.push(k)}),u.sort(function(k,j){if(k.isSigner!==j.isSigner)return k.isSigner?-1:1;if(k.isWritable!==j.isWritable)return k.isWritable?-1:1;const M={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return k.pubkey.toBase58().localeCompare(j.pubkey.toBase58(),"en",M)});const f=u.findIndex(k=>k.pubkey.equals(i));if(f>-1){const[k]=u.splice(f,1);k.isSigner=!0,k.isWritable=!0,u.unshift(k)}else u.unshift({pubkey:i,isSigner:!0,isWritable:!0});for(const k of this.signatures){const j=u.findIndex(M=>M.pubkey.equals(k.publicKey));if(j>-1)u[j].isSigner||(u[j].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${k.publicKey.toString()}`)}let h=0,y=0,_=0;const A=[],D=[];u.forEach(({pubkey:k,isSigner:j,isWritable:M})=>{j?(A.push(k.toString()),h+=1,M||(y+=1)):(D.push(k.toString()),M||(_+=1))});const U=A.concat(D),L=n.map(k=>{const{data:j,programId:M}=k;return{programIdIndex:U.indexOf(M.toString()),accounts:k.keys.map(W=>U.indexOf(W.pubkey.toString())),data:$r.encode(j)}});return L.forEach(k=>{tr(k.programIdIndex>=0),k.accounts.forEach(j=>tr(j>=0))}),new ao({header:{numRequiredSignatures:h,numReadonlySignedAccounts:y,numReadonlyUnsignedAccounts:_},accountKeys:U,recentBlockhash:t,instructions:L})}_compile(){const t=this.compileMessage(),n=t.accountKeys.slice(0,t.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((o,l)=>n[l].equals(o.publicKey))||(this.signatures=n.map(i=>({signature:null,publicKey:i}))),t}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(t){return(await t.getFeeForMessage(this.compileMessage())).value}setSigners(...t){if(t.length===0)throw new Error("No signers");const n=new Set;this.signatures=t.filter(i=>{const o=i.toString();return n.has(o)?!1:(n.add(o),!0)}).map(i=>({signature:null,publicKey:i}))}sign(...t){if(t.length===0)throw new Error("No signers");const n=new Set,i=[];for(const l of t){const u=l.publicKey.toString();n.has(u)||(n.add(u),i.push(l))}this.signatures=i.map(l=>({signature:null,publicKey:l.publicKey}));const o=this._compile();this._partialSign(o,...i)}partialSign(...t){if(t.length===0)throw new Error("No signers");const n=new Set,i=[];for(const l of t){const u=l.publicKey.toString();n.has(u)||(n.add(u),i.push(l))}const o=this._compile();this._partialSign(o,...i)}_partialSign(t,...n){const i=t.serialize();
33n.forEach(o=>{const l=v2(i,o.secretKey);this._addSignature(o.publicKey,Kr(l))})}addSignature(t,n){this._compile(),this._addSignature(t,n)}_addSignature(t,n){tr(n.length===64);const i=this.signatures.findIndex(o=>t.equals(o.publicKey));if(i<0)throw new Error(`unknown signer: ${t.toString()}`);this.signatures[i].signature=Tt.Buffer.from(n)}verifySignatures(t=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),t)}_getMessageSignednessErrors(t,n){const i={};for(const{signature:o,publicKey:l}of this.signatures)o===null?n&&(i.missing||=[]).push(l):bC(o,t,l.toBytes())||(i.invalid||=[]).push(l);return i.invalid||i.missing?i:void 0}serialize(t){const{requireAllSignatures:n,verifySignatures:i}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},t),o=this.serializeMessage();if(i){const l=this._getMessageSignednessErrors(o,n);if(l){let u="Signature verification failed.";throw l.invalid&&(u+=` 34Invalid signature for public key${l.invalid.length===1?"":"(s)"} [\`${l.invalid.map(f=>f.toBase58()).join("`, `")}\`].`),l.missing&&(u+=` 35Missing signature for public key${l.missing.length===1?"":"(s)"} [\`${l.missing.map(f=>
35f.toBase58()).join("`, `")}\`].`),new Error(u)}}return this._serialize(o)}_serialize(t){const{signatures:n}=this,i=[];pi(i,n.length);const o=i.length+n.length*64+t.length,l=Tt.Buffer.alloc(o);return tr(n.length<256),Tt.Buffer.from(i).copy(l,0),n.forEach(({signature:u},f)=>{u!==null&&(tr(u.length===64,"signature has invalid length"),Tt.Buffer.from(u).copy(l,i.length+f*64))}),t.copy(l,i.length+n.length*64),tr(l.length<=al,`Transaction too large: ${l.length} > ${al}`),l}get keys(){return tr(this.instructions.length===1),this.instructions[0].keys.map(t=>t.pubkey)}get programId(){return tr(this.instructions.length===1),this.instructions[0].programId}get data(){return tr(this.instructions.length===1),this.instructions[0].data}static from(t){let n=[...t];const i=hi(n);let o=[];for(let l=0;l<i;l++){const u=gi(n,0,pd);o.push($r.encode(Tt.Buffer.from(u)))}return ml.populate(ao.from(n),o)}static populate(t,n=[]){const i=new ml;return i.recentBlockhash=t.recentBlockhash,t.header.numRequiredSignatures>0&&(i.feePayer=t.accountKeys[0]),n.forEach((o,l)=>{const u={signature:o==$r.encode(RC)?null:$r.decode(o),publicKey:t.accountKeys[l]};i.signatures.push(u)}),t.instructions.forEach(o=>{const l=o.accounts.map(u=>{const f=t.accountKeys[u];return{pubkey:f,isSigner:i.signatures.some(h=>h.publicKey.toString()===f.toString())||t.isAccountSigner(u),isWritable:t.isAccountWritable(u)}});i.instructions.push(new zr({keys:l,programId:t.accountKeys[o.programIdIndex],data:$r.decode(o.data)}))}),i._message=t,i._json=i.toJSON(),i}}class _2{constructor(t){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=t.payerKey,this.instructions=t.instructions,this.recentBlockhash=t.recentBlockhash}static decompile(t,n){const{header:i,compiledInstructions:o,recentBlockhash:l}=t,{numRequiredSignatures:u,numReadonlySignedAccounts:f,numReadonlyUnsignedAccounts:h}=i,y=u-f;tr(y>0,"Message header is invalid");const _=t.staticAccountKeys.length-u-h;tr(_>=0,"Message header is invalid");const A=t.getAccountKeys(n),D=A.get(0);if(D===void 0)throw new Error("Failed to decompile message because no account keys were found");const U=[];for(const L of o){const k=[];for(const M of L.accountKeyIndexes){const W=A.get(M);if(W===void 0)throw new Error(`Failed to find key for account key index ${M}`);const K=M<u;let se;K?se=M<y:M<A.staticAccountKeys.length?se=M-u<_:se=M-A.staticAccountKeys.length<A.accountKeysFromLookups.writable.length,k.push({pubkey:W,isSigner:M<i.numRequiredSignatures,isWritable:se})}const j=A.get(L.programIdIndex);if(j===void 0)throw new Error(`Failed to find program id for program id index ${L.programIdIndex}`);U.push(new zr({programId:j,data:Kr(L.data),keys:k}))}return new _2({payerKey:D,instructions:U,recentBlockhash:l})}compileToLegacyMessage(){return ao.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(t){return qc.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:t})}}class yl{get version(){return this.message.version}constructor(t,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)tr(n.length===t.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const i=[];for(let o=0;o<t.header.numRequiredSignatures;o++)i.push(new Uint8Array(pd));this.signatures=i}this.message=t}serialize(){const t=this.message.serialize(),n=Array();pi(n,this.signatures.length);const i=le.struct([le.blob(n.length,"encodedSignaturesLength"),le.seq(SC(),this.signatures.length,"signatures"),le.blob(t.length,"serializedMessage")]),o=new Uint8Array(2048),l=i.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:t},o);return o.slice(0,l)}static deserialize(t){let n=[...t];const i=[],o=hi(n);for(let u=0;u<o;u++)i.push(new Uint8Array(gi(n,0,pd)));const l=A2.deserialize(new Uint8Array(n));return new yl(l,i)}sign(t){const n=this.message.serialize(),i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const o of t){const l=i.findIndex(u=>u.equals(o.publicKey));tr(l>=0,`Cannot sign with non signer key ${o.publicKey.toBase58()}`),this.signatures[l]=v2(n,o.secretKey)}}addSignature(t,n){tr(n.byteLength===64,"Signature must be 64 bytes long");const o=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(l=>l.equals(t));tr(o>=0,`Can not add signature; \`${t.toBase58()}\` is not required to sign this transaction`),this.signatures[o]=n}}new Ut("SysvarC1ock11111111111111111111111111111111");new Ut("SysvarEpochSchedu1e111111111111111111111111");new Ut("Sysvar1nstructions1111111111111111111111111");const Gp=new Ut("SysvarRecentB1ockHashes11111111111111111111"),vx=new Ut("SysvarRent111111111111111111111111111111111");new Ut("SysvarRewards111111111111111111111111111111");new Ut("SysvarS1otHashes111111111111111111111111111");new Ut("SysvarS1otHistory11111111111111111111111111");new Ut("SysvarStakeHistory1111111111111111111111111");function Lr(e,t){const n=e.layout.span>=0?e.layout.span:E2(e,t),i=Tt.Buffer.alloc(n),o=Object.assign({instruction:e.index},t);return e.layout.encode(o,i),i}const CC=le.nu64("lamportsPerSignature"),MC=le.struct([le.u32("version"),le.u32("state"),sn("authorizedPubkey"),sn("nonce"),le.struct([CC],"feeCalculator")]),xx=MC.span;function wl(e){const t=le.blob(8,e),n=t.decode.bind(t),i=t.encode.bind(t),o=t,l=yI();return o.decode=(u,f)=>{const h=n(u,f);return l.decode(h)},o.encode=(u,f,h)=>{const y=l.encode(u);return i(y,f,h)},o}const Ti=Object.freeze({Create:{index:0,layout:le.struct([le.u32("instruction"),le.ns64("lamports"),le.ns64("space"),sn("programId")])},Assign:{index:1,layout:le.struct([le.u32("instruction"),sn("programId")])},Transfer:{index:2,layout:le.struct([le.u32("instruction"),wl("lamports")])},CreateWithSeed:{index:3,layout:le.struct([le.u32("instruction"),sn("base"),nl("seed"),le.ns64("lamports"),le.ns64("space"),sn("programId")])},AdvanceNonceAccount:{index:4,layout:le.struct([le.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:le.struct([le.u32("instruction"),le.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:le.struct([le.u32("instruction"),sn("authorized")])},AuthorizeNonceAccount:{index:7,layout:le.struct([le.u32("instruction"),sn("authorized")])},Allocate:{index:8,layout:le.struct([le.u32("instruction"),le.ns64("space")])},AllocateWithSeed:{index:9,layout:le.struct([le.u32("instruction"),sn("base"),nl("seed"),le.ns64("space"),sn("programId")])},AssignWithSeed:{index:10,layout:le.struct([le.u32("instruction"),sn("base"),nl("seed"),sn("programId")])},TransferWithSeed:{index:11,layout:le.struct([le.u32("instruction"),wl("lamports"),nl("seed"),sn("programId")])},UpgradeNonceAccount:{index:12,layout:le.struct([le.u32("instruction")])}});class md{constructor(){}static createAccount(t){const n=Ti.Create,i=Lr(n,{lamports:t.lamports,space:t.space,programId:Kr(t.programId.toBuffer())});return new zr({keys:[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:i})}static transfer(t){let n,i;if("basePubkey"in t){const o=Ti.TransferWithSeed;
35n=Lr(o,{lamports:BigInt(t.lamports),seed:t.seed,programId:Kr(t.programId.toBuffer())}),i=[{pubkey:t.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}else{const o=Ti.Transfer;n=Lr(o,{lamports:BigInt(t.lamports)}),i=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0}]}return new zr({keys:i,programId:this.programId,data:n})}static assign(t){let n,i;if("basePubkey"in t){const o=Ti.AssignWithSeed;n=Lr(o,{base:Kr(t.basePubkey.toBuffer()),seed:t.seed,programId:Kr(t.programId.toBuffer())}),i=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{const o=Ti.Assign;n=Lr(o,{programId:Kr(t.programId.toBuffer())}),i=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new zr({keys:i,programId:this.programId,data:n})}static createAccountWithSeed(t){const n=Ti.CreateWithSeed,i=Lr(n,{base:Kr(t.basePubkey.toBuffer()),seed:t.seed,lamports:t.lamports,space:t.space,programId:Kr(t.programId.toBuffer())});let o=[{pubkey:t.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:t.newAccountPubkey,isSigner:!1,isWritable:!0}];return t.basePubkey.equals(t.fromPubkey)||o.push({pubkey:t.basePubkey,isSigner:!0,isWritable:!1}),new zr({keys:o,programId:this.programId,data:i})}static createNonceAccount(t){const n=new ml;"basePubkey"in t&&"seed"in t?n.add(md.createAccountWithSeed({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,basePubkey:t.basePubkey,seed:t.seed,lamports:t.lamports,space:xx,programId:this.programId})):n.add(md.createAccount({fromPubkey:t.fromPubkey,newAccountPubkey:t.noncePubkey,lamports:t.lamports,space:xx,programId:this.programId}));const i={noncePubkey:t.noncePubkey,authorizedPubkey:t.authorizedPubkey};return n.add(this.nonceInitialize(i)),n}static nonceInitialize(t){const n=Ti.InitializeNonceAccount,i=Lr(n,{authorized:Kr(t.authorizedPubkey.toBuffer())}),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Gp,isSigner:!1,isWritable:!1},{pubkey:vx,isSigner:!1,isWritable:!1}],programId:this.programId,data:i};return new zr(o)}static nonceAdvance(t){const n=Ti.AdvanceNonceAccount,i=Lr(n),o={keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Gp,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new zr(o)}static nonceWithdraw(t){const n=Ti.WithdrawNonceAccount,i=Lr(n,{lamports:t.lamports});return new zr({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Gp,isSigner:!1,isWritable:!1},{pubkey:vx,isSigner:!1,isWritable:!1},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static nonceAuthorize(t){const n=Ti.AuthorizeNonceAccount,i=Lr(n,{authorized:Kr(t.newAuthorizedPubkey.toBuffer())});return new zr({keys:[{pubkey:t.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:t.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static allocate(t){let n,i;if("basePubkey"in t){const o=Ti.AllocateWithSeed;n=Lr(o,{base:Kr(t.basePubkey.toBuffer()),seed:t.seed,space:t.space,programId:Kr(t.programId.toBuffer())}),i=[{pubkey:t.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:t.basePubkey,isSigner:!0,isWritable:!1}]}else{const o=Ti.Allocate;n=Lr(o,{space:t.space}),i=[{pubkey:t.accountPubkey,isSigner:!0,isWritable:!0}]}return new zr({keys:i,programId:this.programId,data:n})}}md.programId=new Ut("11111111111111111111111111111111");new Ut("BPFLoader2111111111111111111111111111111111");le.struct([le.u32("typeIndex"),wl("deactivationSlot"),le.nu64("lastExtendedSlot"),le.u8("lastExtendedStartIndex"),le.u8(),le.seq(sn(),le.offset(le.u8(),-1),"authority")]);const Xn=du(M1(Ut),We(),e=>new Ut(e)),I2=B1([We(),Fn("base64")]),N1=du(M1(Tt.Buffer),I2,e=>Tt.Buffer.from(e[0],"base64"));function T2(e){return Wr([Pe({jsonrpc:Fn("2.0"),id:We(),result:e}),Pe({jsonrpc:Fn("2.0"),id:We(),error:Pe({code:Il(),message:We(),data:St(U7())})})])}const BC=T2(Il());function Bn(e){return du(T2(e),BC,t=>"error"in t?t:{...t,result:Kc(t.result,e)})}function Fi(e){return Bn(Pe({context:Pe({slot:Ae()}),value:e}))}function Vd(e){return Pe({context:Pe({slot:Ae()}),value:e})}
35const DC=Pe({foundation:Ae(),foundationTerm:Ae(),initial:Ae(),taper:Ae(),terminal:Ae()});Bn(ot(lt(Pe({epoch:Ae(),effectiveSlot:Ae(),amount:Ae(),postBalance:Ae(),commission:St(lt(Ae()))}))));const OC=ot(Pe({slot:Ae(),prioritizationFee:Ae()})),NC=Pe({total:Ae(),validator:Ae(),foundation:Ae(),epoch:Ae()}),kC=Pe({epoch:Ae(),slotIndex:Ae(),slotsInEpoch:Ae(),absoluteSlot:Ae(),blockHeight:St(Ae()),transactionCount:St(Ae())}),UC=Pe({slotsPerEpoch:Ae(),leaderScheduleSlotOffset:Ae(),warmup:Qi(),firstNormalEpoch:Ae(),firstNormalSlot:Ae()}),jC=c2(We(),ot(Ae())),ho=lt(Wr([Pe({}),We()])),LC=Pe({err:ho}),zC=Fn("receivedSignature");Pe({"solana-core":We(),"feature-set":St(Ae())});const PC=Pe({program:We(),programId:Xn,parsed:Il()}),HC=Pe({programId:Xn,accounts:ot(Xn),data:We()});Fi(Pe({err:lt(Wr([Pe({}),We()])),logs:lt(ot(We())),accounts:St(lt(ot(lt(Pe({executable:Qi(),owner:We(),lamports:Ae(),data:ot(We()),rentEpoch:St(Ae())}))))),unitsConsumed:St(Ae()),returnData:St(lt(Pe({programId:We(),data:B1([We(),Fn("base64")])}))),innerInstructions:St(lt(ot(Pe({index:Ae(),instructions:ot(Wr([PC,HC]))}))))}));Fi(Pe({byIdentity:c2(We(),ot(Ae())),range:Pe({firstSlot:Ae(),lastSlot:Ae()})}));Bn(DC);Bn(NC);Bn(OC);Bn(kC);Bn(UC);Bn(jC);Bn(Ae());Fi(Pe({total:Ae(),circulating:Ae(),nonCirculating:Ae(),nonCirculatingAccounts:ot(Xn)}));const VC=Pe({amount:We(),uiAmount:lt(Ae()),decimals:Ae(),uiAmountString:St(We())});Fi(ot(Pe({address:Xn,amount:We(),uiAmount:lt(Ae()),decimals:Ae(),uiAmountString:St(We())})));Fi(ot(Pe({pubkey:Xn,account:Pe({executable:Qi(),owner:Xn,lamports:Ae(),data:N1,rentEpoch:Ae()})})));const Pg=Pe({program:We(),parsed:Il(),space:Ae()});Fi(ot(Pe({pubkey:Xn,account:Pe({executable:Qi(),owner:Xn,lamports:Ae(),data:Pg,rentEpoch:Ae()})})));Fi(ot(Pe({lamports:Ae(),address:Xn})));const k1=Pe({executable:Qi(),owner:Xn,lamports:Ae(),data:N1,rentEpoch:Ae()});Pe({pubkey:Xn,account:k1});const FC=du(Wr([M1(Tt.Buffer),Pg]),Wr([I2,Pg]),e=>Array.isArray(e)?Kc(e,N1):e),KC=Pe({executable:Qi(),owner:Xn,lamports:Ae(),data:FC,rentEpoch:Ae()});Pe({pubkey:Xn,account:KC});Pe({state:Wr([Fn("active"),Fn("inactive"),Fn("activating"),Fn("deactivating")]),active:Ae(),inactive:Ae()});Bn(ot(Pe({signature:We(),slot:Ae(),err:ho,memo:lt(We()),blockTime:St(lt(Ae()))})));Bn(ot(Pe({signature:We(),slot:Ae(),err:ho,memo:lt(We()),blockTime:St(lt(Ae()))})));Pe({subscription:Ae(),result:Vd(k1)});const qC=Pe({pubkey:Xn,account:k1});Pe({subscription:Ae(),result:Vd(qC)});const $C=Pe({parent:Ae(),slot:Ae(),root:Ae()});Pe({subscription:Ae(),result:$C});const WC=Wr([Pe({type:Wr([Fn("firstShredReceived"),Fn("completed"),Fn("optimisticConfirmation"),Fn("root")]),slot:Ae(),timestamp:Ae()}),Pe({type:Fn("createdBank"),parent:Ae(),slot:Ae(),timestamp:Ae()}),Pe({type:Fn("frozen"),slot:Ae(),timestamp:Ae(),stats:Pe({numTransactionEntries:Ae(),numSuccessfulTransactions:Ae(),numFailedTransactions:Ae(),maxTransactionsPerEntry:Ae()})}),Pe({type:Fn("dead"),slot:Ae(),timestamp:Ae(),err:We()})]);Pe({subscription:Ae(),result:WC});Pe({subscription:Ae(),result:Vd(Wr([LC,zC]))});Pe({subscription:Ae(),result:Ae()});Pe({pubkey:We(),gossip:lt(We()),tpu:lt(We()),rpc:lt(We()),version:lt(We())});const Ex=Pe({votePubkey:We(),nodePubkey:We(),activatedStake:Ae(),epochVoteAccount:Qi(),epochCredits:ot(B1([Ae(),Ae(),Ae()])),commission:Ae(),lastVote:Ae(),rootSlot:lt(Ae())});Bn(Pe({current:ot(Ex),delinquent:ot(Ex)}));const GC=Wr([Fn("processed"),Fn("confirmed"),Fn("finalized")]),YC=Pe({slot:Ae(),confirmations:lt(Ae()),err:ho,confirmationStatus:St(GC)});Fi(ot(lt(YC)));Bn(Ae());const R2=Pe({accountKey:Xn,writableIndexes:ot(Ae()),readonlyIndexes:ot(Ae())}),U1=Pe({signatures:ot(We()),message:Pe({accountKeys:ot(We()),header:Pe({numRequiredSignatures:Ae(),numReadonlySignedAccounts:Ae(),numReadonlyUnsignedAccounts:Ae()}),instructions:ot(Pe({accounts:ot(Ae()),data:We(),programIdIndex:Ae()})),recentBlockhash:We(),addressTableLookups:St(ot(R2))})}),C2=Pe({pubkey:Xn,signer:Qi(),writable:Qi(),source:St(Wr([Fn("transaction"),Fn("lookupTable")]))}),M2=Pe({accountKeys:ot(C2),signatures:ot(We())}),B2=Pe({parsed:Il(),program:We(),programId:Xn}),D2=Pe({accounts:ot(Xn),data:We(),programId:Xn}),ZC=Wr([D2,B2]),JC=Wr([Pe({parsed:Il(),program:We(),programId:We()}),Pe({accounts:ot(We()),data:We(),programId:We()})]),O2=du(ZC,JC,e=>"accounts"in e?Kc(e,D2):Kc(e,B2)),N2=Pe({signatures:ot(We()),message:Pe({accountKeys:ot
35(C2),instructions:ot(O2),recentBlockhash:We(),addressTableLookups:St(lt(ot(R2)))})}),yd=Pe({accountIndex:Ae(),mint:We(),owner:St(We()),programId:St(We()),uiTokenAmount:VC}),k2=Pe({writable:ot(Xn),readonly:ot(Xn)}),Fd=Pe({err:ho,fee:Ae(),innerInstructions:St(lt(ot(Pe({index:Ae(),instructions:ot(Pe({accounts:ot(Ae()),data:We(),programIdIndex:Ae()}))})))),preBalances:ot(Ae()),postBalances:ot(Ae()),logMessages:St(lt(ot(We()))),preTokenBalances:St(lt(ot(yd))),postTokenBalances:St(lt(ot(yd))),loadedAddresses:St(k2),computeUnitsConsumed:St(Ae()),costUnits:St(Ae())}),j1=Pe({err:ho,fee:Ae(),innerInstructions:St(lt(ot(Pe({index:Ae(),instructions:ot(O2)})))),preBalances:ot(Ae()),postBalances:ot(Ae()),logMessages:St(lt(ot(We()))),preTokenBalances:St(lt(ot(yd))),postTokenBalances:St(lt(ot(yd))),loadedAddresses:St(k2),computeUnitsConsumed:St(Ae()),costUnits:St(Ae())}),Tl=Wr([Fn(0),Fn("legacy")]),po=Pe({pubkey:We(),lamports:Ae(),postBalance:lt(Ae()),rewardType:lt(We()),commission:St(lt(Ae()))});Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),transactions:ot(Pe({transaction:U1,meta:lt(Fd),version:St(Tl)})),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),transactions:ot(Pe({transaction:M2,meta:lt(Fd),version:St(Tl)})),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),transactions:ot(Pe({transaction:N2,meta:lt(j1),version:St(Tl)})),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),transactions:ot(Pe({transaction:M2,meta:lt(j1),version:St(Tl)})),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),rewards:St(ot(po)),blockTime:lt(Ae()),blockHeight:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),transactions:ot(Pe({transaction:U1,meta:lt(Fd)})),rewards:St(ot(po)),blockTime:lt(Ae())})));Bn(lt(Pe({blockhash:We(),previousBlockhash:We(),parentSlot:Ae(),signatures:ot(We()),blockTime:lt(Ae())})));Bn(lt(Pe({slot:Ae(),meta:lt(Fd),blockTime:St(lt(Ae())),transaction:U1,version:St(Tl)})));Bn(lt(Pe({slot:Ae(),transaction:N2,meta:lt(j1),blockTime:St(lt(Ae())),version:St(Tl)})));Fi(Pe({blockhash:We(),lastValidBlockHeight:Ae()}));Fi(Qi());const XC=Pe({slot:Ae(),numTransactions:Ae(),numSlots:Ae(),samplePeriodSecs:Ae()});Bn(ot(XC));Fi(lt(Pe({feeCalculator:Pe({lamportsPerSignature:Ae()})})));Bn(We());Bn(We());const QC=Pe({err:ho,logs:ot(We()),signature:We()});Pe({result:Vd(QC),subscription:Ae()});class Yf{constructor(t){this._keypair=void 0,this._keypair=t??yx()}static generate(){return new Yf(yx())}static fromSecretKey(t,n){if(t.byteLength!==64)throw new Error("bad secret key size");const i=t.slice(32,64);if(!n||!n.skipValidation){const o=t.slice(0,32),l=zg(o);for(let u=0;u<32;u++)if(i[u]!==l[u])throw new Error("provided secretKey is invalid")}return new Yf({publicKey:i,secretKey:t})}static fromSeed(t){const n=zg(t),i=new Uint8Array(64);return i.set(t),i.set(n,32),new Yf({publicKey:n,secretKey:i})}get publicKey(){return new Ut(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}Object.freeze({CreateLookupTable:{index:0,layout:le.struct([le.u32("instruction"),wl("recentSlot"),le.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:le.struct([le.u32("instruction")])},ExtendLookupTable:{index:2,layout:le.struct([le.u32("instruction"),wl(),le.seq(sn(),le.offset(le.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:le.struct([le.u32("instruction")])},CloseLookupTable:{index:4,layout:le.struct([le.u32("instruction")])}});new Ut("AddressLookupTab1e1111111111111111111111111");const Uf=Object.freeze({RequestUnits:{index:0,layout:le.struct([le.u8("instruction"),le.u32("units"),le.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:le.struct([le.u8("instruction"),le.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:le.struct([le.u8("instruction"),le.u32("units")])},SetComputeUnitPrice:{index:3,layout:le.struct([le.u8("instruction"),wl("microLamports")])}});class eM{constructor(){}static requestUnits(t){const n=Uf.RequestUnits,i=Lr(n,t);return new zr({keys:[],programId:this.programId,data:i})}static requestHeapFrame(t){const n=Uf.RequestHeapFrame,i=Lr(n,t);return new zr({keys:[],programId:this.programId,data:i})}static setComputeUnitLimit(t){const n=Uf.SetComputeUnitLimit,i=Lr(n,t);return new zr({keys:[],programId:this.programId,data:i})}static setComputeUnitPrice(t){const n=Uf.SetComputeUnitPrice,i=Lr(n,{microLamports:BigInt(t.microLamports)});return new zr({keys:[],programId:this.programId,data:i})}}eM.programId=new Ut("ComputeBudget111111111111111111111111111111");le.struct([le.u8("numSignatures"),le.u8("padding"),le.u16("signatureOffset"),le.u16("signatureInstructionIndex"),le.u16("publicKeyOffset"),le.u16("publicKeyInstructionIndex"),le.u16("messageDataOffset"),le.u16("messageDataSize"),le.u16("messageInstructionIndex")]
35);new Ut("Ed25519SigVerify111111111111111111111111111");wC.utils.isValidPrivateKey;le.struct([le.u8("numSignatures"),le.u16("signatureOffset"),le.u8("signatureInstructionIndex"),le.u16("ethAddressOffset"),le.u8("ethAddressInstructionIndex"),le.u16("messageDataOffset"),le.u16("messageDataSize"),le.u8("messageInstructionIndex"),le.blob(20,"ethAddress"),le.blob(64,"signature"),le.u8("recoveryId")]);new Ut("KeccakSecp256k11111111111111111111111111111");var U2;new Ut("StakeConfig11111111111111111111111111111111");class j2{constructor(t,n,i){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=t,this.epoch=n,this.custodian=i}}U2=j2;j2.default=new U2(0,0,Ut.default);Object.freeze({Initialize:{index:0,layout:le.struct([le.u32("instruction"),AC(),_C()])},Authorize:{index:1,layout:le.struct([le.u32("instruction"),sn("newAuthorized"),le.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:le.struct([le.u32("instruction")])},Split:{index:3,layout:le.struct([le.u32("instruction"),le.ns64("lamports")])},Withdraw:{index:4,layout:le.struct([le.u32("instruction"),le.ns64("lamports")])},Deactivate:{index:5,layout:le.struct([le.u32("instruction")])},Merge:{index:7,layout:le.struct([le.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:le.struct([le.u32("instruction"),sn("newAuthorized"),le.u32("stakeAuthorizationType"),nl("authoritySeed"),sn("authorityOwner")])}});new Ut("Stake11111111111111111111111111111111111111");Object.freeze({InitializeAccount:{index:0,layout:le.struct([le.u32("instruction"),IC()])},Authorize:{index:1,layout:le.struct([le.u32("instruction"),sn("newAuthorized"),le.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:le.struct([le.u32("instruction"),le.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:le.struct([le.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:le.struct([le.u32("instruction"),TC()])}});new Ut("Vote111111111111111111111111111111111111111");new Ut("Va1idator1nfo111111111111111111111111111111");Pe({name:We(),website:St(We()),details:St(We()),iconUrl:St(We()),keybaseUsername:St(We())});new Ut("Vote111111111111111111111111111111111111111");le.struct([sn("nodePubkey"),sn("authorizedWithdrawer"),le.u8("commission"),le.nu64(),le.seq(le.struct([le.nu64("slot"),le.u32("confirmationCount")]),le.offset(le.u32(),-8),"votes"),le.u8("rootSlotValid"),le.nu64("rootSlot"),le.nu64(),le.seq(le.struct([le.nu64("epoch"),sn("authorizedVoter")]),le.offset(le.u32(),-8),"authorizedVoters"),le.struct([le.seq(le.struct([sn("authorizedPubkey"),le.nu64("epochOfLastAuthorizedSwitch"),le.nu64("targetEpoch")]),32,"buf"),le.nu64("idx"),le.u8("isEmpty")],"priorVoters"),le.nu64(),le.seq(le.struct([le.nu64("epoch"),le.nu64("credits"),le.nu64("prevCredits")]),le.offset(le.u32(),-8),"epochCredits"),le.struct([le.nu64("slot"),le.nu64("timestamp")],"lastTimestamp")]);function tM(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let y=0;y<t.length;y++)t[y]=255;for(let y=0;y<e.length;y++){const _=e.charAt(y),A=_.charCodeAt(0);if(t[A]!==255)throw new TypeError(_+" is ambiguous");t[A]=y}const n=e.length,i=e.charAt(0),o=Math.log(n)/Math.log(256),l=Math.log(256)/Math.log(n);function u(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";let _=0,A=0,D=0;const U=y.length;for(;D!==U&&y[D]===0;)D++,_++;const L=(U-D)*l+1>>>0,k=new Uint8Array(L);for(;D!==U;){let W=y[D],K=0;for(let se=L-1;(W!==0||K<A)&&se!==-1;se--,K++)W+=256*k[se]>>>0,k[se]=W%n>>>0,W=W/n>>>0;if(W!==0)throw new Error("Non-zero carry");A=K,D++}let j=L-A;for(;j!==L&&k[j]===0;)j++;let M=i.repeat(_);for(;j<L;++j)M+=e.charAt(k[j]);return M}function f(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;let _=0,A=0,D=0;for(;y[_]===i;)A++,_++;const U=(y.length-_)*o+1>>>0,L=new Uint8Array(U);for(;_<y.length;){const W=y.charCodeAt(_);if(W>255)return;let K=t[W];if(K===255)return;let se=0;for(let re=U-1;(K!==0||se<D)&&re!==-1;re--,se++)K+=n*L[re]>>>0,L[re]=K%256>>>0,K=K/256>>>0;if(K!==0)throw new Error("Non-zero carry");D=se,_++}let k=U-D;for(;k!==U&&L[k]===0;)k++;const j=new Uint8Array(A+(U-k));let M=A;for(;k!==U;)j[M++]=L[k++];return j}function h(y){const _=f(y);if(_)return _;throw new Error("Non-base"+n+" character")}return{encode:u,decodeUnsafe:f,decode:h}}var nM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const oo=tM(nM);function Yp(e,t){switch(t.split(":")[0].toLowerCase()){case"solana":return rM(e);case"eip155":case"ethereum":return iM(e);case"sui":return sM(e);case"bip122":case"bitcoin":return aM(e);default:return{signature:e,rawSignature:e}}}function Sx(e,t,n){let i=e;if(Tg(t))try{const o=xl(e);i="0x"+Tt.Buffer.from(o).toString("hex")}catch{i=e.startsWith("0x")?e:"0x"+e}return n?{hash:n,rawTransaction:i,blockExplorer:NA(t,"transaction",n)}:{rawTransaction:i}}function rM(e){try{const t=xl(e);return{signature:oo.encode(t),rawSignature:e}}catch{return{signature:e,rawSignature:e}}}function iM(e){const t=xl(e);return{signature:"0x"+Tt.Buffer.from(t).toString("hex"),rawSignature:e}}function sM(e){try{const t=xl(e);return{signature:Tt.Buffer.from(t).toString("base64"),rawSignature:e}}catch{return{signature:e,rawSignature:e}}}function aM(e){try{const t=xl(e);return{signature:Tt.Buffer.from(t).toString("hex"),rawSignature:e}}catch{return{signature:e,rawSignature:e}}}function oM(e){try{const t=xl(e);return L2(t)}catch{return null}}function L2(e){try{return ml.from(e)}catch(t){if(t instanceof Error&&t.message.includes("Versioned messages"))return yl.deserialize(e);throw t}}async function Ax(e,t){const n=t.split(":")[0].toLowerCase();switch(n){case"solana":return lM(e);case"ethereum":case"eip155":case"polygon":case"optimism":case"arbitrum":case"base":return cM(e);case"sui":return await uM(e);case"bitcoin":return fM(e);default:throw new Error(`Unsupported network: ${n}`)}}function lM(e){if(e?.messageBytes!=null)return{parsed:Un(e.messageBytes),originalFormat:"@solana/kit"};if(typeof e?.serialize=="function"){const t=e.serialize({requireAllSignatures:!1,verifySignatures:!1});return{parsed:Un(t),originalFormat:"@solana/web3.js"}}if(e instanceof Uint8Array)return{parsed:Un(e),originalFormat:"bytes"};if(typeof e=="string")try{const t=Tt.Buffer.from(e,"base64");return{parsed:Un(new Uint8Array(t)),originalFormat:"base64"}}catch{throw new Error("Unsupported Solana transaction format")}throw new Error("Unsupported Solana transaction format")}function cM(e){if(typeof e=="string"&&e.startsWith("0x"))return{parsed:e,originalFormat:"hex"};if(e?.serialize&&typeof e.serialize=="function"){const t=e.serialize();return{parsed:t.startsWith("0x")?t:"0x"+t,originalFormat:"ethers"}}if(e instanceof Uint8Array)return{parsed:"0x"+Tt.Buffer.from(e).toString("hex"),originalFormat:"bytes"};if(e&&typeof e=="object"&&(e.to||e.data||e.from))try{const{from:t,gas:n,...i}=e;if(n&&(i.gasLimit=n),i.gasLimit||i.to&&i.value&&!i.data&&(i.gasLimit="0x5208"),i.to&&typeof i.to=="string")try{i.to=Sl(i.to)}catch{i.to=i.to.toLowerCase()}const o=mR.from(i).unsignedSerialized;return{parsed:o.startsWith("0x")?o:"0x"+o,originalFormat:"json"}}catch(t){const n=t instanceof Error?t.message:"Unknown error",i=e?Object.keys(e).join(", "):"N/A",o=e?JSON.stringify(e,null,2):"N/A";throw new Error(`Failed to RLP encode EVM transaction: ${n}. 36Transaction keys: [${i}]. 37Transaction: ${o} 38Please ensure the transaction object includes required fields (to, value, chainId, gasLimit or gasPrice, etc.)`)}throw new Error("Unsupported EVM transaction format. Expected hex string, bytes, or transaction object with 'to', 'data', or 'from' fields.")}async function uM(e){if(e?.serialize&&typeof e.serialize=="function"){const t=e.serialize();return{parsed:Un(t),originalFormat:"sui-sdk"}}if(e instanceof Uint8Array)return{parsed:Un(e),originalFormat:"bytes"};if(e?.build&&typeof e.build=="function"){const t=await e.build();if(t?.serialize&&typeof t.serialize=="function"){const n=t.serialize();return{parsed:Un(n),originalFormat:"transaction-block"}}}throw new Error("Unsupported Sui transaction format")}function fM(e){if(e?.toBuffer&&typeof e.toBuffer=="function"){const t=e.toBuffer();return{parsed:Un(new Uint8Array(t)),originalFormat:"bitcoinjs-lib"}}if(e instanceof Uint8Array)return{parsed:Un(e),originalFormat:"bytes"};if(typeof e=="string"){const t=new Uint8Array(Tt.Buffer.from(e,"hex"));return{parsed:Un(t),originalFormat:"hex"}}throw new Error("Unsupported Bitcoin transaction format")}
38class Cc extends Error{}Cc.prototype.name="InvalidTokenError";function dM(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let i=n.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}function hM(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return dM(t)}catch{return atob(t)}}function pM(e,t){if(typeof e!="string")throw new Cc("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,i=e.split(".")[n];if(typeof i!="string")throw new Cc(`Invalid token specified: missing part #${n+1}`);let o;try{o=hM(i)}catch(l){throw new Cc(`Invalid token specified: invalid base64 for part #${n+1} (${l.message})`)}try{return JSON.parse(o)}catch(l){throw new Cc(`Invalid token specified: invalid json for part #${n+1} (${l.message})`)}}var gM="2025-11-24",mM=class{constructor(e,t){this.stamper=e;const n=Vn.create();n.interceptors.request.use(async o=>{await this.stamper.maybeRefreshTokens(),o.headers=o.headers||{},o.headers["x-app-id"]=t.appId,o.headers["x-api-version"]=gM,o.headers.authorization=this.stamper.bearerToken;const l=this.stamper.auth2Token?.sub;l&&(o.headers["x-auth-user-id"]=l);const u=typeof o.data=="string"?o.data:o.data===void 0?"":JSON.stringify(o.data),f=await this.stamper.stamp({data:Tt.Buffer.from(u,"utf-8")});return o.headers["x-phantom-stamp"]=f,o});const i=new PE({basePath:t.apiBaseUrl});this.kmsApi=new zE(i,t.apiBaseUrl,n)}async postKmsRpc(e){const n=(await this.kmsApi.postKmsRpc(e)).data;if("error"in n)throw new Error(`KMS RPC error: ${JSON.stringify(n.error)}`);return n.result}async getOrCreatePhantomOrganization(e){return await this.postKmsRpc({method:xg.getOrCreatePhantomOrganization,params:{publicKey:e},timestampMs:Date.now()})}async listPendingMigrations(e){return await this.postKmsRpc({method:"listPendingMigrations",params:{organizationId:e},timestampMs:Date.now()})}async completeWalletTransfer(e){return await this.postKmsRpc({method:"completeWalletTransfer",params:e,timestampMs:Date.now()})}async getOrCreateWalletWithTag(e){return await this.postKmsRpc({method:Eg.getOrCreateWalletWithTag,params:e,timestampMs:Date.now()})}},z2=class{constructor(e){this.WALLET_URN_PREFIX="urn:phantom:wallet:",this.WALLET_TAG_URN_PREFIX="urn:phantom:wallet-tag:",this._claims=_x(e),this._a2tClaims=_x(this._claims.ext.a2t);const t=this._claims.aud.find(i=>i.startsWith(this.WALLET_URN_PREFIX));if(t){const[i,o]=t.replace(this.WALLET_URN_PREFIX,"").split(":");this._identity={id:i,derivationIndex:Number(o)}}const n=this._claims.aud.find(i=>i.startsWith(this.WALLET_TAG_URN_PREFIX));n&&(this._walletTag=n.replace(this.WALLET_TAG_URN_PREFIX,""))}static fromAccessToken(e){return new this(e)}get sub(){return this._claims.sub}get clientId(){return this._claims.client_id}get wallet(){return this._identity}get walletTag(){return this._walletTag}get a2t(){if(this._a2tClaims.exp<Date.now()/1e3)throw new P2;return this._claims.ext.a2t}};function _x(e){return pM(e)}var P2=class extends Error{constructor(){super("Auth2 token expired"),this.name="Auth2TokenExpiredError"}};async function yM(e){return H2(e.authApiBaseUrl,new URLSearchParams({grant_type:"authorization_code",client_id:e.clientId,redirect_uri:e.redirectUri,code:e.code,code_verifier:e.codeVerifier}))}async function wM(e){const t=new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:e.refreshToken});e.redirectUri.trim().length>0&&t.set("redirect_uri",e.redirectUri);const n=await H2(e.authApiBaseUrl,t);if(!n.refreshToken)throw new Error("Auth2 refresh token request did not return a refresh_token.");return{...n,refreshToken:n.refreshToken}}async function H2(e,t){const n=new URL("/oauth2/token",e).toString(),i=await fetch(n,{method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:t.toString()});if(!i.ok){const u=await i.text();throw new Error(`Auth2 token request failed (${i.status} ${i.statusText}): ${u}`)}const o=await i.json(),l=o.access_token;if(!l)throw new Error("Auth2 token request did not return an access_token.");
38return{accessToken:l,idType:o.token_type??"Bearer",expiresInMs:o.expires_in!=null?o.expires_in*1e3:0,refreshToken:o.refresh_token}}var bM=900*1e3,vM=class{constructor(e,t){this.storage=e,this.refreshConfig=t,this._keyPair=null,this._keyInfo=null,this._idType=null,this._accessToken=null,this._refreshToken=null,this._tokenExpiresAt=null,this.refreshingTokensPromise=null,this.algorithm=ma.secp256r1,this.type="OIDC"}get bearerToken(){return!this._idType||!this._accessToken?null:`${this._idType} ${this._accessToken}`}get auth2Token(){return this._accessToken?z2.fromAccessToken(this._accessToken):null}async init(){this.storage.open&&await this.storage.open();const e=await this.storage.load();return e?(this._keyPair=e.keyPair,this._keyInfo=e.keyInfo,e.idType&&(this._idType=e.idType),e.accessToken&&(this._accessToken=e.accessToken),e.refreshToken&&(this._refreshToken=e.refreshToken),e.tokenExpiresAt&&(this._tokenExpiresAt=e.tokenExpiresAt),this._keyInfo):this.generateAndStore()}getKeyInfo(){return this._keyInfo}getCryptoKeyPair(){return this._keyPair}async setTokens({accessToken:e,idType:t,refreshToken:n,expiresInMs:i}){this._idType=t,this._accessToken=e,this._refreshToken=n??null,this._tokenExpiresAt=i!=null?Date.now()+i:null;const o=await this.storage.load(),l=o?.keyPair??this._keyPair,u=o?.keyInfo??this._keyInfo;if(!l||!u)throw new Error("Auth2Stamper key pair not initialized. Call init() first.");await this.storage.save({keyPair:l,keyInfo:u,accessToken:e,idType:t,refreshToken:n,tokenExpiresAt:this._tokenExpiresAt??void 0})}async maybeRefreshTokens(){if(this.refreshConfig?.logger?.debug?.("Auth2Stamper.maybeRefreshTokens() called"),this.refreshingTokensPromise)return this.refreshConfig?.logger?.debug?.("Auth2Stamper.maybeRefreshTokens(): awaiting in-flight refresh"),this.refreshingTokensPromise;if(!this.refreshConfig)return!1;if(!this._refreshToken)return this.refreshConfig.logger?.debug?.("Auth2Stamper.maybeRefreshTokens(): skipped â missing refresh token"),!1;if(!this._tokenExpiresAt)return this.refreshConfig.logger?.debug?.("Auth2Stamper.maybeRefreshTokens(): skipped â missing token expiry"),!1;if(Date.now()<this._tokenExpiresAt-bM)return this.refreshConfig.logger?.debug?.("Auth2Stamper.maybeRefreshTokens(): skipped â token not near expiry"),!1;const e=this.refreshConfig,t=this._refreshToken;return this.refreshingTokensPromise=(async()=>{try{e.logger?.info?.("Auth2Stamper.maybeRefreshTokens(): attempting token refresh");const n=await wM({authApiBaseUrl:e.authApiBaseUrl,clientId:e.clientId,redirectUri:e.redirectUri,refreshToken:t});return await this.setTokens({accessToken:n.accessToken,idType:n.idType,refreshToken:n.refreshToken,expiresInMs:n.expiresInMs}),e.logger?.info?.("Auth2Stamper.maybeRefreshTokens(): token refresh succeeded"),!0}catch(n){const i=n instanceof Error?n.message:String(n);return e.logger?.error?.(`Auth2Stamper.maybeRefreshTokens(): token refresh failed: ${i}`),!1}finally{this.refreshingTokensPromise=null}})(),this.refreshingTokensPromise}async stamp(e){if(this.refreshConfig?.logger?.debug?.("Auth2Stamper.stamp(): called"),!this._keyPair||!this._keyInfo)throw new Error("Auth2Stamper not initialized. Call init() first.");if(this.refreshConfig?.logger?.debug?.("Auth2Stamper.stamp(): awaiting maybeRefreshTokens()"),await this.maybeRefreshTokens(),this.refreshConfig?.logger?.debug?.("Auth2Stamper.stamp(): maybeRefreshTokens() completed"),!this.auth2Token)throw new Error("Auth2Stamper not initialized. Call init() first.");const t=await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},this._keyPair.privateKey,new Uint8Array(e.data)),n=oo.decode(this._keyInfo.publicKey),i={kind:this.type,idToken:this.auth2Token.a2t,publicKey:Un(n),algorithm:this.algorithm,salt:"",signature:Un(new Uint8Array(t))};return Un(new TextEncoder().encode(JSON.stringify(i)))}async resetKeyPair(){return await this.clear(),this.generateAndStore()}async clear(){await this.storage.clear(),this._keyPair=null,this._keyInfo=null,this._accessToken=null,this._idType=null,this._refreshToken=null,this._tokenExpiresAt=null}async rotateKeyPair(){throw new Error("rotateKeyPair is not supported for Auth2Stamper")}async commitRotation(e){throw new Error("commitRotation is not supported for Auth2Stamper")}async rollbackRotation(){throw new Error("rollbackRotation is not supported for Auth2Stamper")}async generateAndStore(){const e=await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},this.storage.requiresExtractableKeys,["sign","verify"]),t=new Uint8Array(await crypto.subtle.exportKey("raw",e.publicKey)),n=oo.encode(t),i=await crypto.subtle.digest("SHA-256",t.buffer),o=Un(new Uint8Array(i)).substring(0,16);return this._keyPair=e,this._keyInfo={keyId:o,publicKey:n,createdAt:Date.now()},await this.storage.save({keyPair:e,keyInfo:this._keyInfo}),this._keyInfo}},xM="ES256",EM="oauth-authz-req+jwt",Zp=new TextEncoder;async function SM(e){const t=await globalThis.crypto.subtle.exportKey("jwk",e.keyPair.publicKey);if(!AM(t))throw new Error("Unable to export a valid P-256 public JWK for JAR header.");const n={alg:xM,typ:EM,jwk:{kty:"EC",crv:"P-256",x:t.x,y:t.y}},i=Un(Zp.encode(JSON.stringify(n))),o=Un(Zp.encode(JSON.stringify(e.payload))),l=`${i}.${o}`,u=await globalThis.crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},e.keyPair.privateKey,Zp.encode(l));return`${l}.${Un(new Uint8Array(u))}`}function AM(e){return e.kty==="EC"&&e.crv==="P-256"&&typeof e.x=="string"&&typeof e.y=="string"}var _M="openid offline_access",IM=[{curve:Ji.ed25519,derivationPath:"m/44'/501'/0'/0'",addressFormat:Ct.solana},{curve:Ji.secp256k1,derivationPath:"m/44'/60'/0'/0/0",addressFormat:Ct.ethereum},{curve:Ji.secp256k1,derivationPath:"m/84'/0'/0'/0",addressFormat:Ct.bitcoinSegwit},{curve:Ji.ed25519,derivationPath:"m/44'/784'/0'/0'/0'",addressFormat:Ct.sui}],TM=24,RM=0;async function CM(e){const{stamper:t,auth2Options:n}=e;t.getKeyInfo()||await t.init();const i=t.getCryptoKeyPair();if(!i)throw new Error("Stamper key pair not found.");const o=MM();return{url:await BM({keyPair:i,connectLoginUrl:n.connectLoginUrl,clientId:n.clientId,redirectUri:n.redirectUri,sessionId:e.sessionId,provider:e.provider,codeVerifier:o,salt:""}),codeVerifier:o,keyPair:i}}function MM(){const e=new Uint8Array(64);return crypto.getRandomValues(e),Un(e).slice(0,96)}async function BM({keyPair:e,connectLoginUrl:t,clientId:n,redirectUri:i,sessionId:o,provider:l,codeVerifier:u,salt:f}){const h=await DM(e,f),y=await OM(u),_=Math.floor(Date.now()/1e3),A={aud:t,iat:_,exp:_+300,client_id:n,redirect_uri:i,scope:_M,nonce:h,code_challenge:y,code_challenge_method:"S256",...l&&l!=="phantom"&&l!=="device"&&{login_hint:`${l}:auth2`},state:o,should_migrate:!0},D=await SM({payload:A,keyPair:e}),U=new URL(t);return U.hash=`jar=${D}`,U.toString()}async function DM(e,t){const n=await crypto.subtle.exportKey("raw",e.publicKey),i=new Uint8Array(n),o=new TextEncoder().encode(t),l=new Uint8Array(i.length+o.length);return l.set(i),l.set(o,i.length),Un(await $E(l))}async function OM(e){return Un(await $E(new TextEncoder().encode(e)))}function NM(e){const{getParam:t,expectedSessionId:n}=e;if(t("state")!==n)throw new Error("Auth2 state mismatch â possible CSRF attack.");const o=t("error");
38if(o){const u=t("error_description");throw new Error(`Auth2 callback error: ${u??o}`)}const l=t("code");if(!l)throw new Error("Auth2 callback missing authorization code");return l}async function kM(e){const{stamper:t,kms:n,auth2Options:i}=e,{accessToken:o,idType:l,expiresInMs:u,refreshToken:f}=await yM({authApiBaseUrl:i.authApiBaseUrl,clientId:i.clientId,redirectUri:i.redirectUri,code:e.code,codeVerifier:e.codeVerifier});await t.setTokens({accessToken:o,idType:l,refreshToken:f,expiresInMs:u});const h=z2.fromAccessToken(o),{organizationId:y,wallet:_}=await UM({stamper:t,kms:n,auth2Token:h});return{walletId:_.id,organizationId:y,provider:e.provider,accountDerivationIndex:_.derivationIndex,expiresInMs:u,authUserId:h.sub,bearerToken:`${l} ${o}`}}async function UM({stamper:e,kms:t,auth2Token:n}){const i=e.getKeyInfo();if(!i)throw new Error("Stamper key pair not found.");const o=Un(oo.decode(i.publicKey)),{organizationId:l}=await t.getOrCreatePhantomOrganization(o);if(n.wallet){const f=await t.listPendingMigrations(l);if(f.pendingMigrations){for(const h of f.pendingMigrations)if(h.migrationId)try{await t.completeWalletTransfer({organizationId:l,migrationId:h.migrationId})}catch(y){console.error(`Failed to complete wallet transfer for migration ${h.migrationId}:`,y)}}return{organizationId:l,wallet:n.wallet}}const u=await jM({kms:t,organizationId:l,clientId:n.clientId});return{organizationId:l,wallet:{id:u.walletId,derivationIndex:RM}}}async function jM({kms:e,organizationId:t,clientId:n}){return await e.getOrCreateWalletWithTag({organizationId:t,walletName:"App Wallet",tag:n,accounts:IM,mnemonicLength:TM})}var Ix=744*60*60*1e3,wd=["google","apple","phantom"],LM=class{constructor(e){this.provider=e,this.currentNetworkId=Yn.SOLANA_MAINNET,this._publicKey=null,this.eventEmitter=new ru,this.setupEventListeners(),this.syncInitialState()}get publicKey(){return this._publicKey}get isConnected(){return this._publicKey!==null}ensureConnected(){if(!this.isConnected)throw new Error("Solana chain not available. Ensure SDK is connected.")}async signMessage(e){this.ensureConnected();const t=typeof e=="string"?e:new TextDecoder().decode(e),n=await this.provider.signMessage({message:t,networkId:this.currentNetworkId});return{signature:typeof n.signature=="string"?new Uint8Array(oo.decode(n.signature)):n.signature,publicKey:this._publicKey||""}}async signTransaction(e){this.ensureConnected();const t=await this.provider.signTransaction({transaction:e,networkId:this.currentNetworkId}),n=oM(t.rawTransaction);if(!n)throw new Error("Failed to parse signed transaction");return n}async signAndSendTransaction(e,t){this.ensureConnected();const n=await this.provider.signAndSendTransaction({transaction:e,networkId:this.currentNetworkId,presignTransaction:t?.presignTransaction});if(!n.hash)throw new Error("Transaction not submitted");return{signature:n.hash}}async signAllTransactions(e){return this.ensureConnected(),await Promise.all(e.map(n=>this.signTransaction(n)))}async signAndSendAllTransactions(e){return{signatures:(await Promise.all(e.map(n=>this.signAndSendTransaction(n)))).map(n=>n.signature)}}connect(e){if(!this.provider.isConnected())throw new Error("Provider not connected. Call provider connect first.");const n=this.provider.getAddresses().find(i=>i.addressType==="Solana");if(!n)throw new Error("No Solana address found");return this._publicKey=n.address,Promise.resolve({publicKey:n.address})}async disconnect(){return this.provider.disconnect()}switchNetwork(e){return this.currentNetworkId=e==="mainnet"?Yn.SOLANA_MAINNET:Yn.SOLANA_DEVNET,Promise.resolve()}setupEventListeners(){this.provider.on("connect",e=>{const t=e.addresses?.find(n=>n.addressType==="Solana");t&&(this._publicKey=t.address,this.eventEmitter.emit("connect",t.address))}),this.provider.on("disconnect",()=>{this._publicKey=null,this.eventEmitter.emit("disconnect")})}syncInitialState(){if(!this.provider.isConnected())return;const t=this.provider.getAddresses().find(n=>n.addressType==="Solana");this._publicKey=t?.address||null}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}},zM=class{constructor(e){this.provider=e,this.currentNetworkId=Yn.ETHEREUM_MAINNET,this._accounts=[],this.eventEmitter=new ru,this.setupEventListeners(),this.syncInitialState()}get chainId(){return`0x${(pp(this.currentNetworkId)||1).toString(16)}`}get accounts(){return this._accounts}ensureConnected(){if(!this.provider.isConnected())throw new Error("Ethereum chain not available. Ensure SDK is connected.")}async request(e){return this.ensureConnected(),this.handleEmbeddedRequest(e)}connect(){if(!this.provider.isConnected())throw new Error("Provider not connected. Call provider connect first.");const t=this.provider.getAddresses().filter(n=>n.addressType==="Ethereum").map(n=>n.address);return this.updateConnectionState(t),Promise.resolve(t)}async disconnect(){await this.provider.disconnect()}async signPersonalMessage(e,t){return await this.request({method:"personal_sign",params:[e,t]})}async signTypedData(e,t){return await this.request({method:"eth_signTypedData_v4",params:[t,JSON.stringify(e)]})}async signTransaction(e){let t=this.currentNetworkId;if(e.chainId){const i=typeof e.chainId=="number"?e.chainId:parseInt(e.chainId,16),o=_f(i);o&&(t=o)}return(await this.provider.signTransaction({transaction:e,networkId:t})).rawTransaction}async sendTransaction(e){if(e.chainId){const n=typeof e.chainId=="number"?e.chainId:parseInt(e.chainId,16);await this.switchChain(n)}const t=await this.provider.signAndSendTransaction({transaction:e,networkId:this.currentNetworkId});if(!t.hash)throw new Error("Transaction not submitted");return t.hash}switchChain(e){const t=typeof e=="string"?e.toLowerCase().startsWith("0x")?parseInt(e,16):parseInt(e,10):e,n=_f(t);if(!n)throw new Error(`Unsupported chainId: ${e}`);return this.currentNetworkId=n,this.eventEmitter.emit("chainChanged",`0x${t.toString(16)}`),Promise.resolve()}getChainId(){const e=pp(this.currentNetworkId);return Promise.resolve(e||1)}async getAccounts(){return this.request({method:"eth_accounts"})}isConnected(){return this.provider.isConnected()&&this._accounts.length>0}setupEventListeners(){this.provider.on("connect",e=>{const t=e.addresses?.filter(n=>n.addressType==="Ethereum")?.map(n=>n.address)||[];t.length>0&&(this.updateConnectionState(t),this.eventEmitter.emit("connect",{chainId:this.chainId}),this.eventEmitter.emit("accountsChanged",t))}),this.provider.on("disconnect",()=>{this.updateConnectionState([]),this.eventEmitter.emit("disconnect",{code:4900,message:"Provider disconnected"}),this.eventEmitter.emit("accountsChanged",[])})}syncInitialState(){if(this.provider.isConnected()){const t=this.provider.getAddresses().filter(n=>n.addressType==="Ethereum").map(n=>n.address);t.length>0&&this.updateConnectionState(t)}}updateConnectionState(e){this._accounts=e}async handleEmbeddedRequest(e){switch(e.method){case"personal_sign":{const[t,n]=e.params;return(await this.provider.signEthereumMessage({message:t,networkId:this.currentNetworkId})).signature}case"eth_signTypedData_v4":{const[t,n]=e.params,i=JSON.parse(n);return(await this.provider.signTypedDataV4({typedData:i,networkId:this.currentNetworkId})).signature}case"eth_signTransaction":{const[t]=e.params,n=t.chainId?_f(typeof t.chainId=="number"?t.chainId:parseInt(t.chainId,16)):null;return(await this.provider.signTransaction({transaction:t,networkId:n||this.currentNetworkId})).rawTransaction}case"eth_sendTransaction":{const[t]=e.params,n=t.chainId?_f(typeof t.chainId=="number"?t.chainId:parseInt(t.chainId,16)):null;return(await this.provider.signAndSendTransaction({transaction:t,networkId:n||this.currentNetworkId})).hash}case"eth_accounts":{const n=this.provider.getAddresses().find(i=>i.addressType==="Ethereum");return n?[n.address]:[]}case"eth_chainId":return`0x${(pp(this.currentNetworkId)||1).toString(16)}`;case"wallet_switchEthereumChain":{const[{chainId:t}]=e.params,n=parseInt(t,16);await this.switchChain(n);return}default:throw new Error(`Embedded provider doesn't support method: ${e.method}`)}}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}};async function PM(e,t,n,i=3,o=1e3){let l;for(let u=1;u<=i;u++)try{return n.debug("EMBEDDED_PROVIDER",`Attempting ${t}`,{attempt:u,maxRetries:i}),await e()}catch(f){if(l=f,n.warn("EMBEDDED_PROVIDER",`${t} failed`,{attempt:u,maxRetries:i,error:f instanceof Error?f.message:String(f)}),u===i){n.error("EMBEDDED_PROVIDER",`${t} failed after ${i} attempts`,{finalError:f instanceof Error?f.message:String(f)});break}const h=o*Math.pow(2,u-1);n.debug("EMBEDDED_PROVIDER",`Retrying ${t} in ${h}ms`,{attempt:u+1,delay:h}),await new Promise(y=>setTimeout(y,h))}throw l}function Jp(){return"session_"+Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15)+"_"+Date.now()}var Tx={info:()=>{},warn:()=>{},error:()=>{},debug:()=>{}},HM=class{constructor(t,n,i){if(this.client=null,this.walletId=null,this.addresses=[],this.eventListeners=new Map,this.logger=i,this.logger.debug("EMBEDDED_PROVIDER","Initializing EmbeddedProvider",{config:t}),t.embeddedWalletType==="app-wallet")throw new Error("app-wallet type is not currently supported. Please use 'user-wallet' instead.");this.config=t,this.platform=n,this.storage=n.storage,this.authProvider=n.authProvider,this.phantomAppProvider=n.phantomAppProvider,this.urlParam
38sAccessor=n.urlParamsAccessor,this.stamper=n.stamper,this.solana=new LM(this),this.ethereum=new zM(this),this.logger.info("EMBEDDED_PROVIDER","EmbeddedProvider initialized")}on(t,n){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t)?.add(n),this.logger.debug("EMBEDDED_PROVIDER","Event listener added",{event:t})}off(t,n){const i=this.eventListeners.get(t);i&&(i.delete(n),this.logger.debug("EMBEDDED_PROVIDER","Event listener removed",{event:t}))}emit(t,n){const i=this.eventListeners.get(t);i&&i.size>0&&(this.logger.debug("EMBEDDED_PROVIDER","Emitting event",{event:t,listenerCount:i.size,data:n}),i.forEach(o=>{try{o(n)}catch(l){this.logger.error("EMBEDDED_PROVIDER","Event callback error",{event:t,error:l})}}))}getAddressForNetwork(t){const n=t.split(":")[0].toLowerCase();let i;switch(n){case"solana":i=Ct.solana;break;case"eip155":i=Ct.ethereum;break;case"bitcoin":case"btc":i=Ct.bitcoinSegwit;break;case"sui":i=Ct.sui;break;default:i=Ct.ethereum;break}return this.addresses.find(l=>l.addressType.toLowerCase()===i.toLowerCase())?.address}async getAndFilterWalletAddresses(t){const i=(await this.storage.getSession())?.accountDerivationIndex??0;return(await PM(()=>this.client.getWalletAddresses(t,void 0,i),"getWalletAddresses",this.logger).catch(async l=>{throw this.logger.error("EMBEDDED_PROVIDER","getWalletAddresses failed after retries, disconnecting",{walletId:t,error:l.message,derivationIndex:i}),await this.storage.clearSession(),this.client=null,this.walletId=null,this.addresses=[],l})).filter(l=>this.config.addressTypes.some(u=>u===l.addressType))}async validateAndCleanSession(t){if(!t)return null;if(this.logger.debug("EMBEDDED_PROVIDER","Found existing session, validating",{sessionId:t.sessionId,status:t.status,walletId:t.walletId}),t.status!=="completed"){const n=this.urlParamsAccessor.getParam("session_id"),i=this.urlParamsAccessor.getParam("code");if(t.status==="pending"&&!n&&!i)return this.logger.warn("EMBEDDED_PROVIDER","Session mismatch detected - pending session without redirect context",{sessionId:t.sessionId,status:t.status}),await this.storage.clearSession(),null;if(n&&n!==t.sessionId)return this.logger.warn("EMBEDDED_PROVIDER","Session ID mismatch detected",{storedSessionId:t.sessionId,urlSessionId:n}),await this.storage.clearSession(),null}return t.status==="completed"&&!this.isSessionValid(t)?(this.logger.warn("EMBEDDED_PROVIDER","Session invalid due to authenticator expiration, will regenerate keypair",{sessionId:t.sessionId,authenticatorExpiresAt:t.authenticatorExpiresAt,currentTime:Date.now(),expired:t.authenticatorExpiresAt<Date.now()}),await this.storage.clearSession(),null):t}async tryExistingConnection(t){this.logger.debug("EMBEDDED_PROVIDER","Getting existing session");let n=await this.storage.getSession();if(n=await this.validateAndCleanSession(n),!n)return this.logger.debug("EMBEDDED_PROVIDER","No existing session found"),null;if(n.status==="completed"){this.logger.info("EMBEDDED_PROVIDER","Using existing completed session",{sessionId:n.sessionId,walletId:n.walletId}),await this.initializeClientFromSession(n),n.lastUsed=Date.now(),await this.storage.saveSession(n),this.logger.info("EMBEDDED_PROVIDER","Connection from existing session successful",{walletId:this.walletId,addressCount:this.addresses.length}),await this.ensureValidAuthenticator();const i={walletId:this.walletId,addresses:this.addresses,status:"completed",authUserId:n.authUserId,authProvider:n.authProvider};return this.emit("connect",{...i,source:"existing-session"}),i}if(this.logger.debug("EMBEDDED_PROVIDER","No completed session found, checking for redirect resume"),this.authProvider.resumeAuthFromRedirect){const i=await this.authProvider.resumeAuthFromRedirect(n.authProvider);if(i){this.logger.info("EMBEDDED_PROVIDER","Resuming from redirect",{walletId:i.walletId,provider:i.provider});try{return await this.completeAuthConnection(i)}catch(o){if(o instanceof Error&&o.message.includes("No session found after redirect")&&!t)return this.logger.warn("EMBEDDED_PROVIDER","Session missing during redirect resume - will start fresh auth flow",{error:o.message,walletId:i.walletId}),await this.storage.clearSession(),null;throw o}}}return null}validateAuthOptions(t){if(!wd.includes(t.provider))throw new Error(`Invalid auth provider: ${t.provider}. Must be ${wd.join(", ")}`)}isSessionValid(t){return t?!t.walletId||!t.organizationId||!t.stamperInfo?(this.logger.debug("EMBEDDED_PROVIDER","Session missing required fields",{hasWalletId:!!t.walletId,hasOrganizationId:!!t.organizationId,hasStamperInfo:!!t.stamperInfo}),!1):t.status!=="completed"?(this.logger.debug("EMBEDDED_PROVIDER","Session not completed",{status:t.status}),!1):t.authenticatorExpiresAt?Date.now()>=t.authenticatorExpiresAt?(this.logger.debug("EMBEDDED_PROVIDER","Authenticator expired, session invali
38d",{authenticatorExpiresAt:new Date(t.authenticatorExpiresAt).toISOString(),now:new Date().toISOString()}),!1):(this.logger.debug("EMBEDDED_PROVIDER","Session is valid",{sessionId:t.sessionId,walletId:t.walletId,authenticatorExpires:new Date(t.authenticatorExpiresAt).toISOString()}),!0):(this.logger.debug("EMBEDDED_PROVIDER","Session invalid - missing authenticator timing",{sessionId:t.sessionId}),!1):!1}async autoConnect(){try{this.logger.debug("EMBEDDED_PROVIDER","Starting auto-connect attempt"),this.emit("connect_start",{source:"auto-connect"});const t=await this.tryExistingConnection(!0);if(t){this.logger.info("EMBEDDED_PROVIDER","Auto-connect successful",{walletId:t.walletId,addressCount:t.addresses.length}),this.emit("connect",{...t,source:"auto-connect"});return}this.logger.debug("EMBEDDED_PROVIDER","Auto-connect failed: no valid session found"),this.emit("connect_error",{error:"No valid session found",source:"auto-connect"})}catch(t){this.logger.error("EMBEDDED_PROVIDER","Auto-connect failed",{error:t instanceof Error?t.message:String(t)}),this.emit("connect_error",{error:t instanceof Error?t.message:"Auto-connect failed",source:"auto-connect"}),await this.storage.setShouldClearPreviousSession(!0)}}async initializeStamper(){this.logger.debug("EMBEDDED_PROVIDER","Initializing stamper"),await this.stamper.init(),this.logger.debug("EMBEDDED_PROVIDER","Resetting keypair to avoid conflicts with existing keypairs");const t=await this.stamper.resetKeyPair();this.logger.debug("EMBEDDED_PROVIDER","Stamper initialized with fresh keypair",{publicKey:t.publicKey,keyId:t.keyId,algorithm:this.stamper.algorithm});const n=Ix;return this.logger.info("EMBEDDED_PROVIDER","Stamper ready for auth flow with fresh keypair",{publicKey:t.publicKey,keyId:t.keyId}),{stamperInfo:t,expiresInMs:n}}async createOrganizationForAppWallet(t,n){const i=new bp({apiBaseUrl:this.config.apiBaseUrl,headers:{...this.platform.analyticsHeaders||{}},logger:Tx}),o=this.platform.name||"unknown",l=t.publicKey.slice(0,8),u=`${this.config.appId.substring(0,8)}-${o}-${l}`;this.logger.debug("EMBEDDED_PROVIDER","Creating organization for app-wallet",{organizationName:u,publicKey:t.publicKey,platform:o});const f=Un(oo.decode(t.publicKey)),h=`user-${FE()}`,{organizationId:y}=await i.createOrganization(u,[{username:h,role:"ADMIN",authenticators:[{authenticatorName:`auth-${l}`,authenticatorKind:"keypair",publicKey:f,algorithm:this.stamper.algorithm,expiresInMs:n}]}]);return this.logger.info("EMBEDDED_PROVIDER","Organization created for app-wallet",{organizationId:y}),y}async connect(t){try{this.logger.info("EMBEDDED_PROVIDER","Starting embedded provider connect",{authOptions:{provider:t.provider}}),this.emit("connect_start",{source:"manual-connect",authOptions:{provider:t.provider}});const n=await this.tryExistingConnection(!1);if(n)return this.logger.info("EMBEDDED_PROVIDER","Manual connect using existing connection",{walletId:n.walletId,addressCount:n.addresses.length}),this.emit("connect",{...n,source:"manual-existing"}),n;this.validateAuthOptions(t),this.logger.info("EMBEDDED_PROVIDER","No existing connection available, creating new auth flow with fresh keypair");const{stamperInfo:i,expiresInMs:o}=await this.initializeStamper(),l=await this.handleAuthFlow(i.publicKey,i,t,o);if(!l)return{addresses:[],status:"pending",authProvider:t.provider};this.config.embeddedWalletType==="app-wallet"&&(l.lastUsed=Date.now(),await this.storage.saveSession(l)),await this.initializeClientFromSession(l),await this.ensureValidAuthenticator();const u={walletId:this.walletId,addresses:this.addresses,status:"completed",authUserId:l?.authUserId,authProvider:l?.authProvider};return this.emit("connect",{...u,source:"manual"}),u}catch(n){throw this.logger.error("EMBEDDED_PROVIDER","Connect failed with error",{error:n instanceof Error?{name:n.name,message:n.message,stack:n.stack}:n}),this.emit("connect_error",{error:n instanceof Error?n.message:String(n),source:"manual-connect"}),n instanceof Error?n.message.includes("IndexedDB")||n.message.includes("storage")?new Error("Storage error: Unable to access browser storage. Please ensure storage is available and try again."):n.message.includes("network")||n.message.includes("fetch")?new Error("Network error: Unable to connect to authentication server. Please check your internet connection and try again."):n.message.includes("JWT")||n.message.includes("jwt")?new Error(`JWT Authentication error: ${n.message}`):n.message.includes("Authentication")||n.message.includes("auth")?new Error(`Authentication error: ${n.message}`):n.message.includes("organization")||n.message.includes("wallet")?new Error(`Wallet creation error: ${n.message}`):n:new Error(`Embedded wallet connection failed: ${String(n)}`)}}async disconnect(t=!0){const n=this.client!==null;await this.storage.setShouldClearPreviousSession(t),this.logger.debug("EMBEDDED_PROVIDER","Set flag to clear previous session on next login"),await this.storage.clearSession(),this.client=null,this.walletId=null,this.addresses=[],this.logger.info("EMBEDDED_PROVIDER","Disconnected from embedded wallet"),n&&this.emit
38("disconnect",{source:"manual"})}async handleSigningError(t){throw JA(t)?(this.logger.warn("EMBEDDED_PROVIDER","Authenticator rejected by server (401/403), disconnecting",{error:t}),await this.disconnect(!1),new Error("Authenticator revoked")):t instanceof Error&&t.name===P2.name?(this.logger.warn("EMBEDDED_PROVIDER","Auth2 token expired, disconnecting",{error:t}),await this.disconnect(!1),t):(t instanceof GE&&this.emit("spending_limit_reached",{error:t}),t)}async signMessage(t){if(!this.client||!this.walletId)throw new Error("Not connected");await this.ensureValidAuthenticator(),this.logger.info("EMBEDDED_PROVIDER","Signing message",{walletId:this.walletId,message:t.message});const i=(await this.storage.getSession())?.accountDerivationIndex??0,o=await this.client.signUtf8Message({walletId:this.walletId,message:t.message,networkId:t.networkId,derivationIndex:i}).catch(l=>this.handleSigningError(l));return this.logger.info("EMBEDDED_PROVIDER","Message signed successfully",{walletId:this.walletId,message:t.message}),Yp(o,t.networkId)}async signEthereumMessage(t){if(!this.client||!this.walletId)throw new Error("Not connected");await this.ensureValidAuthenticator(),this.logger.info("EMBEDDED_PROVIDER","Signing message",{walletId:this.walletId,message:t.message});const n=h=>/^0x[0-9a-fA-F]+$/.test(h),i=(()=>{if(n(t.message)){const h=t.message.slice(2),y=h.length%2===0?h:`0${h}`;return Tt.Buffer.from(y,"hex").toString("utf8")}return t.message})(),o=Y_(i),u=(await this.storage.getSession())?.accountDerivationIndex??0,f=await this.client.ethereumSignMessage({walletId:this.walletId,message:o,networkId:t.networkId,derivationIndex:u}).catch(h=>this.handleSigningError(h));return this.logger.info("EMBEDDED_PROVIDER","Message signed successfully",{walletId:this.walletId,message:t.message}),Yp(f,t.networkId)}async signTypedDataV4(t){if(!this.client||!this.walletId)throw new Error("Not connected");await this.ensureValidAuthenticator(),this.logger.info("EMBEDDED_PROVIDER","Signing typed data",{walletId:this.walletId,typedData:t.typedData});const i=(await this.storage.getSession())?.accountDerivationIndex??0,o=await this.client.ethereumSignTypedData({walletId:this.walletId,typedData:t.typedData,networkId:t.networkId,derivationIndex:i}).catch(l=>this.handleSigningError(l));return this.logger.info("EMBEDDED_PROVIDER","Typed data signed successfully",{walletId:this.walletId}),Yp(o,t.networkId)}async signTransaction(t){if(!this.client||!this.walletId)throw new Error("Not connected");await this.ensureValidAuthenticator(),this.logger.info("EMBEDDED_PROVIDER","Signing transaction",{walletId:this.walletId,networkId:t.networkId});const n=await Ax(t.transaction,t.networkId),o=(await this.storage.getSession())?.accountDerivationIndex??0;this.logger.debug("EMBEDDED_PROVIDER","Parsed transaction for signing",{walletId:this.walletId,transaction:n,derivationIndex:o});const l=n.parsed;if(!l)throw new Error("Failed to parse transaction: no valid encoding found");const u=this.getAddressForNetwork(t.networkId);if(!u)throw new Error(`No address found for network ${t.networkId}`);const f=await this.client.signTransaction({walletId:this.walletId,transaction:l,networkId:t.networkId,derivationIndex:o,account:u}).catch(h=>this.handleSigningError(h));return this.logger.info("EMBEDDED_PROVIDER","Transaction signed successfully",{walletId:this.walletId,networkId:t.networkId,rawTransaction:f.rawTransaction}),await Sx(f.rawTransaction,t.networkId)}async signAndSendTransaction(t){if(!this.client||!this.walletId)throw new Error("Not connected");await this.ensureValidAuthenticator(),this.logger.info("EMBEDDED_PROVIDER","Signing and sending transaction",{walletId:this.walletId,networkId:t.networkId});const n=await Ax(t.transaction,t.networkId),o=(await this.storage.getSession())?.accountDerivationIndex??0;this.logger.debug("EMBEDDED_PROVIDER","Parsed transaction for signing",{walletId:this.walletId,transaction:n,derivationIndex:o});const l=n.parsed;if(!l)throw new Error("Failed to parse transaction: no valid encoding found");const u=this.getAddressForNetwork(t.networkId);if(!u)throw new Error(`No address found for network ${t.networkId}`);const f=await this.client.signAndSendTransaction({walletId:this.walletId,transaction:l,networkId:t.networkId,derivationIndex:o,account:u,presignTransaction:t.presignTransaction}).catch(h=>this.handleSigningError(h));return this.logger.info("EMBEDDED_PROVIDER","Transaction signed and sent successfully",{walletId:this.walletId,networkId:t.networkId,hash:f.hash,rawTransaction:f.rawTransaction}),await Sx(f.rawTransaction,t.networkId,f.hash)}getAddresses(){return this.addresses}isConnected(){return this.client!==null&&this.walletId!==null}async handleAuthFlow(t,n,i,o){if(this.config.embeddedWalletType==="user-wallet")return this.logger.info("EMBEDDED_PROVIDER","Creating user-wallet, routing authentication",{authProvider:i.provider}),i.provider==="phantom"?await this.handlePhantomAuth(t,n,o):(this.logger.info("EMBEDDED_PROVIDER","Starting redirect-based authentication flow",{publicKey:t,provider:i?.provider}),await this.handleRedirectAuth(t,n,i));{this.logger.info("EMBEDDED_PROVIDER","Creating app-wallet",{publicKey:t});const l=await this.createOrganizationForAppWallet(n,o),h=(await new bp({apiBaseUrl:this.config.apiBaseUrl,organizationId:l,headers:{...this.platform.analyticsHeaders||{}},logger:Tx},this.stamper).createWallet(`Wallet ${Date.now()}`)).walletId,y=Date.now(),_={sessionId:Jp(),walletId:h,organizationId:l,appId:this.config.appId,stamperInfo:n,authProvider:"device",accountDerivationIndex:0,status:"completed",createdAt:y,lastUsed:y,authenticatorCreatedAt:y,authenticatorExpiresAt:Date.now()+o,lastRenewalAttempt:void 0};return await this.storage.saveSession(_),this.logger.info("EMBEDDED_PROVIDER","App-wallet created successfully",{walletId:h,organizationId:l}),_}}async handlePhantomAuth(t,n,i){if(this.logger.info("EMBEDDED_PROVIDER","Starting Phantom authentication flow"),!this.phantomAppProvider.isAvailable())throw this.logger.error("EMBEDDED_PROVIDER","Phantom app not available"),new Error("Phantom app is not available. Please install the Phantom browser extension or mobile app to use this authentication method.");this.logger.info("EMBEDDED_PROVIDER","Phantom app detected, proceeding with authentication");const l=Jp(),u=await this.phantomAppProvider.authenticate({publicKey:t,appId:this.config.appId,sessionId:l});this.logger.info("EMBEDDED_PROVIDER","Phantom authentication completed",{walletId:u.walletId,organizationId:u.organizationId});
38const f=u.expiresInMs>0?u.expiresInMs:i,h=Date.now(),y={sessionId:l,walletId:u.walletId,organizationId:u.organizationId,appId:this.config.appId,stamperInfo:n,authProvider:"phantom",accountDerivationIndex:u.accountDerivationIndex,status:"completed",createdAt:h,lastUsed:h,authenticatorCreatedAt:h,authenticatorExpiresAt:h+f,lastRenewalAttempt:void 0,authUserId:u.authUserId};return this.logger.debug("EMBEDDED_PROVIDER","Saving Phantom session"),await this.storage.saveSession(y),y}async handleRedirectAuth(t,n,i){this.logger.info("EMBEDDED_PROVIDER","Using Phantom Connect authentication flow (redirect-based)",{provider:i.provider,hasRedirectUrl:!!this.config.authOptions.redirectUrl,authUrl:this.config.authOptions.authUrl});const o=Date.now(),l=Jp(),u={sessionId:l,walletId:`temp-wallet-${o}`,organizationId:`temp-org-${o}`,appId:this.config.appId,stamperInfo:n,authProvider:i.provider,accountDerivationIndex:void 0,status:"pending",createdAt:o,lastUsed:o,authenticatorCreatedAt:o,authenticatorExpiresAt:o+Ix,lastRenewalAttempt:void 0};this.logger.debug("EMBEDDED_PROVIDER","Saving temporary session before redirect",{sessionId:u.sessionId,tempWalletId:u.walletId}),u.lastUsed=Date.now(),await this.storage.saveSession(u);const f=await this.storage.getShouldClearPreviousSession();this.logger.info("EMBEDDED_PROVIDER","Starting Phantom Connect redirect",{publicKey:t,appId:this.config.appId,provider:i?.provider,authUrl:this.config.authOptions.authUrl,clearPreviousSession:f,allowRefresh:!f});const h=await this.authProvider.authenticate({publicKey:t,appId:this.config.appId,provider:i?.provider,redirectUrl:this.config.authOptions.redirectUrl,authUrl:this.config.authOptions.authUrl,sessionId:l,clearPreviousSession:f,allowRefresh:!f,algorithm:this.stamper.algorithm});if(h&&"walletId"in h){if(this.logger.info("EMBEDDED_PROVIDER","Authentication completed after redirect",{walletId:h.walletId,organizationId:h.organizationId,provider:h.provider}),u.walletId=h.walletId,u.organizationId=h.organizationId,u.authProvider=h.provider||u.authProvider,u.accountDerivationIndex=h.accountDerivationIndex,u.authUserId=h.authUserId,u.bearerToken=h.bearerToken,u.status="completed",u.lastUsed=Date.now(),h.expiresInMs>0){const y=Date.now();u.authenticatorCreatedAt=y,u.authenticatorExpiresAt=y+h.expiresInMs,this.logger.debug("EMBEDDED_PROVIDER","Updated authenticator expiration from immediate auth response",{expiresInMs:h.expiresInMs,expiresAt:new Date(u.authenticatorExpiresAt).toISOString()})}return await this.storage.saveSession(u),await this.storage.setShouldClearPreviousSession(!1),this.logger.debug("EMBEDDED_PROVIDER","Cleared logout flag after successful authentication"),u}return this.logger.info("EMBEDDED_PROVIDER","Redirect authentication initiated, waiting for redirect completion"),null}async completeAuthConnection(t){const n=await this.storage.getSession();if(!n)throw new Error("No session found after redirect - session may have expired");if(n.walletId=t.walletId,n.authProvider=t.provider||n.authProvider,n.organizationId=t.organizationId,n.accountDerivationIndex=t.accountDerivationIndex,n.authUserId=t.authUserId,n.bearerToken=t.bearerToken,n.status="completed",n.lastUsed=Date.now(),t.expiresInMs>0){const i=Date.now();n.authenticatorCreatedAt=i,n.authenticatorExpiresAt=i+t.expiresInMs,this.logger.debug("EMBEDDED_PROVIDER","Updated authenticator expiration from auth response",{expiresInMs:t.expiresInMs,expiresAt:new Date(n.authenticatorExpiresAt).toISOString()})}return await this.storage.saveSession(n),await this.storage.setShouldClearPreviousSession(!1),this.logger.debug("EMBEDDED_PROVIDER","Cleared logout flag after successful authentication"),await this.initializeClientFromSession(n),await this.ensureValidAuthenticator(),{walletId:this.walletId,addresses:this.addresses,status:"completed",authUserId:n.authUserId,authProvider:n.authProvider}}async ensureValidAuthenticator(){const t=await this.storage.getSession();if(!t)throw new Error("No active session found");const n=Date.now();if(!t.authenticatorExpiresAt)throw this.logger.warn("EMBEDDED_PROVIDER","Session missing authenticator timing - treating as invali
38d session"),await this.disconnect(!1),new Error("Invalid session - missing authenticator timing");const i=t.authenticatorExpiresAt-n;if(this.logger.debug("EMBEDDED_PROVIDER","Checking authenticator expiration",{expiresAt:new Date(t.authenticatorExpiresAt).toISOString(),timeUntilExpiry:i}),i<=0)throw this.logger.error("EMBEDDED_PROVIDER","Authenticator has expired, disconnecting"),await this.disconnect(!1),new Error("Authenticator expired")}async initializeClientFromSession(t){this.logger.debug("EMBEDDED_PROVIDER","Initializing PhantomClient from session",{organizationId:t.organizationId,walletId:t.walletId,appId:t.appId}),this.stamper.getKeyInfo()||await this.stamper.init();const n=this.stamper;this.client=new bp({apiBaseUrl:this.config.apiBaseUrl,organizationId:t.organizationId,headers:{...this.platform.analyticsHeaders||{}},getHeaders:()=>({authorization:n.bearerToken??t.bearerToken,"x-auth-user-id":n.auth2Token?.sub??t.authUserId})},this.stamper),this.walletId=t.walletId,this.addresses=await this.getAndFilterWalletAddresses(t.walletId)}},Mc=class{constructor(){this.level=0,this.enabled=!1}static getInstance(){return Mc.instance||(Mc.instance=new Mc),Mc.instance}setCallback(e){this.callback=e}setLevel(e){this.level=e}enable(){this.enabled=!0}disable(){this.enabled=!1}writeLog(e,t,n,i){if(!this.enabled||e>this.level)return;const o={timestamp:Date.now(),level:e,category:t,message:n,data:i};this.callback&&this.callback(o)}error(e,t,n){this.writeLog(0,e,t,n)}warn(e,t,n){this.writeLog(1,e,t,n)}info(e,t,n){this.writeLog(2,e,t,n)}debug(e,t,n){this.writeLog(3,e,t,n)}log(e,t,n){this.writeLog(3,e,t,n)}},Q=Mc.getInstance(),ee={BROWSER_SDK:"BrowserSDK",PROVIDER_MANAGER:"ProviderManager",EMBEDDED_PROVIDER:"EmbeddedProvider",INJECTED_PROVIDER:"InjectedProvider",PHANTOM_CONNECT_AUTH:"PhantomConnectAuth",JWT_AUTH:"JWTAuth",STORAGE:"Storage",SESSION:"Session"},Rx=[{id:"coinbase-wallet",name:"Coinbase Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNTYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTI4IDU2YzE1LjQ2NCAwIDI4LTEyLjUzNiAyOC0yOFM0My40NjQgMCAyOCAwIDAgMTIuNTM2IDAgMjhzMTIuNTM2IDI4IDI4IDI4WiIgZmlsbD0iIzFCNTNFNCIvPjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNyAyOGMwIDExLjU5OCA5LjQwMiAyMSAyMSAyMXMyMS05LjQwMiAyMS0yMVMzOS41OTggNyAyOCA3IDcgMTYuNDAyIDcgMjhabTE3LjIzNC02Ljc2NmEzIDMgMCAwIDAtMyAzdjcuNTMzYTMgMyAwIDAgMCAzIDNoNy41MzNhMyAzIDAgMCAwIDMtM3YtNy41MzNhMyAzIDAgMCAwLTMtM2gtNy41MzNaIiBmaWxsPSIjZmZmIi8+PC9zdmc+",windowProperty:"coinbaseSolana",addressTypes:[Ct.solana]}];function VM(e){return e.rdns?e.rdns.split(".").reverse().join("-"):e.name.toLowerCase().replace(/\s+/g,"-")}function FM(e){return e.toLowerCase().replace(/\s+/g,"-")}function KM(e){const t=[];Q.log(ee.BROWSER_SDK,"Processing EIP-6963 providers",{providerCount:e.size,providerNames:Array.from(e.values()).map(n=>n.info.name)});for(const[,n]of e){const{info:i,provider:o}=n;if(i.name.toLowerCase().includes("phantom")||i.rdns&&(i.rdns.toLowerCase().includes("phantom")||i.rdns.toLowerCase()==="app.phantom")){Q.log(ee.BROWSER_SDK,"Skipping Phantom from EIP-6963",{name:i.name,rdns:i.rdns});continue}const u=VM(i);Q.log(ee.BROWSER_SDK,"Discovered EIP-6963 wallet",{walletId:u,walletName:i.name,rdns:i.rdns}),t.push({id:u,name:i.name,icon:i.icon,addressTypes:[Ct.ethereum],providers:{ethereum:o},rdns:i.rdns,discovery:"eip6963"})}return Q.log(ee.BROWSER_SDK,"EIP-6963 discovery completed",{discoveredCount:t.length,walletIds:t.map(n=>n.id)}),t}function qM(){return new Promise(e=>{const t=new Map;if(typeof window>"u"){e([]);return}const n=o=>{const l=o.detail;l?.info&&l?.provider&&t.set(l.info.uuid,l)};window.addEventListener("eip6963:announceProvider",n),window.dispatchEvent(new Event("eip6963:requestProvider")),setTimeout(()=>{const o=KM(t);window.removeEventListener("eip6963:announceProvider",n),e(o)},400)})}async function $M(){const e=[];if(typeof window>"u"||typeof navigator>"u")return Q.log(ee.BROWSER_SDK,"Wallet Standard discovery skipped (not in browser environment)"),e;const t=new Set;let n;function i(j){n=void 0,t.add(j);const M=j.features?Object.keys(j.features):[];Q.log(ee.BROWSER_SDK,"Wallet registered",{name:j.name,chains:j.chains,featureKeys:M,totalWallets:t.size})}function o(j){n=void 0,t.delete(j)}function l(){return n||(n=[...t]),n}function u(...j){return j=j.filter(M=>!t.has(M)),j.length?(j.forEach(M=>
38i(M)),function(){j.forEach(W=>o(W))}):()=>{}}const f=Object.freeze({register:u}),h=j=>{const M=j.detail;if(typeof M=="function")try{M(f)}catch(W){Q.warn(ee.BROWSER_SDK,"Error calling wallet registration callback",{error:W})}};try{window.addEventListener("wallet-standard:register-wallet",h)}catch(j){Q.warn(ee.BROWSER_SDK,"Could not add register-wallet event listener",{error:j})}class y extends Event{constructor(M){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),this.detail=M}}try{window.dispatchEvent(new y(f)),Q.log(ee.BROWSER_SDK,"Dispatched wallet-standard:app-ready event")}catch(j){Q.warn(ee.BROWSER_SDK,"Could not dispatch app-ready event",{error:j})}const _={getWallets:()=>({get:l,on:(j,M)=>()=>{},register:u})};navigator.wallets||(navigator.wallets=_),Q.log(ee.BROWSER_SDK,"Initialized Wallet Standard registry"),await new Promise(j=>setTimeout(j,100));const A=navigator.wallets||window.wallets;if(!A||typeof A.getWallets!="function"){const j={hasNavigator:!!navigator,hasWindow:typeof window<"u",note:"Wallet Standard API not properly initialized"};return Q.log(ee.BROWSER_SDK,"Wallet Standard API not available",j),e}const D=A.getWallets(),U=()=>Promise.resolve([...D.get()]);Q.log(ee.BROWSER_SDK,"Wallet Standard API detected, starting discovery");try{let j=[],M=0;const W=5,K=100,se=400;for(await new Promise(te=>setTimeout(te,K));M<W;){j=await U();const te={attempt:M+1,walletCount:j.length,walletNames:j.map(pe=>pe.name),chains:j.flatMap(pe=>pe.chains)};if(Q.log(ee.BROWSER_SDK,`Wallet Standard getWallets attempt ${M+1}`,te),j.length>0||M===W-1)break;await new Promise(pe=>setTimeout(pe,K)),M++}const re=K+M*K;if(re<se){const te=se-re;await new Promise(pe=>setTimeout(pe,te)),j=await U()}Q.log(ee.BROWSER_SDK,"Wallet Standard getWallets final result",{walletCount:j.length,walletNames:j.map(te=>te.name),attempts:M+1});for(const te of j){if(!(te.chains.some(Z=>{const ae=Z.toLowerCase();return ae.startsWith("solana:")||ae==="solana"})||te.features&&typeof te.features=="object"&&Object.keys(te.features).some(Z=>Z.toLowerCase().startsWith("solana:")))){const Z=te.features?Object.keys(te.features):[];Q.log(ee.BROWSER_SDK,"Wallet does not support Solana",{walletName:te.name,chains:te.chains,featureKeys:Z});continue}if(te.name.toLowerCase().includes("phantom")){Q.log(ee.BROWSER_SDK,"Skipping Phantom from Wallet Standard (handled separately)");continue}const we=FM(te.name),X=te.features?Object.keys(te.features):[];Q.log(ee.BROWSER_SDK,"Discovered Wallet Standard Solana wallet",{walletId:we,walletName:te.name,chains:te.chains,featureKeys:X,icon:te.icon,version:te.version,accountCount:te.accounts?.length||0}),e.push({id:we,name:te.name,icon:te.icon,addressTypes:[Ct.solana],providers:{solana:te},discovery:"standard"})}}catch(j){Q.warn(ee.BROWSER_SDK,"Wallet Standard API error",{error:j instanceof Error?j.message:String(j),stack:j instanceof Error?j.stack:void 0})}const L={discoveredCount:e.length,walletIds:e.map(j=>j.id),walletNames:e.map(j=>j.name)};Q.log(ee.BROWSER_SDK,"Wallet Standard Solana discovery completed",L);const k=WM();return e.push(...k),e}function WM(){const e=[];if(typeof window>"u")return Q.log(ee.BROWSER_SDK,"Custom wallet discovery skipped (not in browser environment)"),e;Q.log(ee.BROWSER_SDK,"Starting custom Solana wallet discovery",{configCount:Rx.length});for(const t of Rx){if(!t.addressTypes.includes(Ct.solana))continue;const n=window[t.windowProperty];if(!n){Q.log(ee.BROWSER_SDK,"Custom wallet not found",{walletId:t.id,windowProperty:t.windowProperty});continue}Q.log(ee.BROWSER_SDK,"Discovered custom Solana wallet",{walletId:t.id,walletName:t.name,windowProperty:t.windowProperty}),e.push({id:t.id,name:t.name,icon:t.icon,addressTypes:t.addressTypes,providers:{solana:n},discovery:"custom"})}return Q.log(ee.BROWSER_SDK,"Custom Solana wallet discovery completed",{discoveredCount:e.length,walletIds:e.map(t=>t.id)}),e}function GM(e){if(typeof window>"u"||!Bs())return null;const t=[I_()];e.includes(Ct.solana)&&t.push(P_()),e.includes(Ct.ethereum)&&t.push(A_()),t.push($_());const n=T_({plugins:t});return{id:"phantom",name:"Phantom",icon:HE,addressTypes:e,providers:{solana:e.includes(Ct.solana)?n.solana:void 0,ethereum:e.includes(Ct.ethereum)?n.ethereum:void 0},isPhantom:!0,phantomInstance:n,discovery:"phantom"}}async function YM(e){const t=e||[];Q.log(ee.BROWSER_SDK,"Starting all wallet discovery methods",{addressTypes:t});const[n,i]=await Promise.all([$M(),qM()]),o=GM(t);Q.log(ee.BROWSER_SDK,"All wallet discovery methods completed",{phantomFound:!!o,solanaWalletsCount:n.length,ethereumWalletsCount:i.length,solanaWalletIds:n.map(u=>u.id),ethereumWalletIds:i.map(u=>u.id)});const l=new Map;o&&l.set("phantom",o);for(const u of[...n,...i]){const f=l.get(u.id);if(f){const h=Array.from(new Set([...f.addressTypes,...u.addressTypes])),y={...f.providers,...u.providers},_={...f,addressTypes:h,icon:u.icon||f.icon,providers:y};l.set(u.id,_),Q.log(ee.BROWSER_SDK,"Merged wallet by ID",{walletName:u.name,walletId:u.id,existingAddressTypes:f.addressTypes,newAddressTypes:u.addressTypes,mergedAddressTypes:h,existingProviders:Object.keys(f.providers||{}),newProviders:Object.keys(u.providers||{}),mergedProviders:Object.keys(y)}),Q.log(ee.BROWSER_SDK,"Merged wallet from multiple discovery methods",{walletId:u.id,walletName:u.name,existingAddressTypes:f.addressTypes,newAddressTypes:u.addressTypes,mergedAddressTypes:h})}else l.set(u.id,u)}return Array.from(l.values())}var Cx=class{constructor(e,t,n){this.eventEmitter=new ru,this._publicKey=null,this.provider=e,this.walletId=t,this.walletName=n,this.setupEventListeners()}get publicKey(){return this._publicKey}get isConnected(){return this.provider.isConnected||!!this._publicKey}async connect(e){try{await this.provider.connect(e);const t=this.provider.isConnected;if(!t||this.provider.publicKey===null)throw Q.error(ee.INJECTED_PROVIDER,"Provider not connected after connect() call",{walletId:this.walletId,walletName:this.walletName,providerConnected:t,providerPublicKey:this.provider.publicKey}),new Error("Provider not connected after connect() call");let n;const i=this.provider.publicKey;if(typeof i=="string")n=i;else if(i!=null&&typeof i.toString=="function")n=i.toString();else throw Q.error(ee.INJECTED_PROVIDER,"Invalid publicKey format in provider state",{walletId:this.walletId,walletName:this.walletName,publicKeyType:typeof i}),new Error("Invalid publicKey format in provider state");if(!n||n.length===0)throw new Error("Empty publicKey from provider");return this._publicKey=n,Q.info(ee.INJECTED_PROVIDER,"External wallet Solana connected",{walletId:this.walletId,walletName:this.walletName,publicKey:n}),{publicKey:n}}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana connect failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async disconnect(){Q.log(ee.INJECTED_PROVIDER,"External wallet Solana disconnect",{walletId:this.walletId,walletName:this.walletName});try{await this.provider.disconnect(),this._publicKey=null,Q.info(ee.INJECTED_PROVIDER,"External wallet Solana disconnected",{walletId:this.walletId,walletName:this.walletName})}catch(e){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana disconnect failed",{walletId:this.walletId,walletName:this.walletName,error:e instanceof Error?e.message:String(e)}),e}}async signMessage(e){const t=typeof e=="string"?new TextEncoder().encode(e):e,n=typeof e=="string"?e.substring(0,50):`${t.length} bytes`;Q.log(ee.INJECTED_PROVIDER,"External wallet Solana signMessage",{walletId:this.walletId,walletName:this.walletName,messagePreview:n,messageLength:t.length});
38try{const i=await this.provider.signMessage(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Solana signMessage success",{walletId:this.walletId,walletName:this.walletName,signatureLength:i.signature.length}),{signature:i.signature instanceof Uint8Array?i.signature:new Uint8Array(Tt.Buffer.from(i.signature,"base64")),publicKey:i.publicKey||this._publicKey||""}}catch(i){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana signMessage failed",{walletId:this.walletId,walletName:this.walletName,error:i instanceof Error?i.message:String(i)}),i}}async signTransaction(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Solana signTransaction",{walletId:this.walletId,walletName:this.walletName});try{const t=await this.provider.signTransaction(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Solana signTransaction success",{walletId:this.walletId,walletName:this.walletName}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana signTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAndSendTransaction(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendTransaction",{walletId:this.walletId,walletName:this.walletName});try{const t=await this.provider.signAndSendTransaction(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendTransaction success",{walletId:this.walletId,walletName:this.walletName,signature:t.signature}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAllTransactions(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Solana signAllTransactions",{walletId:this.walletId,walletName:this.walletName,transactionCount:e.length});try{const t=await this.provider.signAllTransactions(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Solana signAllTransactions success",{walletId:this.walletId,walletName:this.walletName,signedCount:t.length}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana signAllTransactions failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAndSendAllTransactions(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendAllTransactions",{walletId:this.walletId,walletName:this.walletName,transactionCount:e.length});try{const t=await this.provider.signAndSendAllTransactions(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendAllTransactions success",{walletId:this.walletId,walletName:this.walletName,signatureCount:t.signatures.length}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Solana signAndSendAllTransactions failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}switchNetwork(e){return Promise.resolve()}setupEventListeners(){typeof this.provider.on=="function"&&(this.provider.on("connect",e=>{this._publicKey=e,this.eventEmitter.emit("connect",e)}),this.provider.on("disconnect",()=>{this._publicKey=null,this.eventEmitter.emit("disconnect")}),this.provider.on("accountChanged",e=>{this._publicKey=e||null,this.eventEmitter.emit("accountChanged",this._publicKey)}))}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}},ZM=class{constructor(e,t,n){this.eventEmitter=new ru,this._publicKey=null,this.wallet=e,this.walletId=t,this.walletName=n,this.setupEventListeners()}get publicKey(){return this._publicKey}get isConnected(){return this._publicKey!==null}async connect(e){try{const t=this.wallet.features["standard:connect"];if(!t)throw new Error("Wallet Standard connect feature not available");const n=await t.connect();let i;if(Array.isArray(n)&&n.length>0?i=n:this.wallet.accounts&&this.wallet.accounts.length>0&&(i=Array.from(this.wallet.accounts)),!i||i.length===0)throw new Error("No accounts available after connecting to wallet");const o=i[0];if(!o)throw new Error("First account is null or undefined");let l;
38if(typeof o=="string"?l=o:typeof o=="object"&&o!==null&&(l=o.address||o.publicKey?.toString()||(o.publicKey instanceof Uint8Array?Tt.Buffer.from(o.publicKey).toString("hex"):void 0)),!l)throw new Error(`Could not extract address from account. Account structure: ${JSON.stringify(o,null,2)}`);return this._publicKey=l,{publicKey:l}}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana connect failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async disconnect(){try{const e=this.wallet.features["standard:disconnect"];e&&await e.disconnect(),this._publicKey=null}catch(e){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana disconnect failed",{walletId:this.walletId,walletName:this.walletName,error:e instanceof Error?e.message:String(e)}),e}}async signMessage(e){try{const t=this.wallet.features["solana:signMessage"];if(!t)throw new Error("Wallet Standard signMessage feature not available");const n=typeof e=="string"?new TextEncoder().encode(e):e,i=await t.signMessage({message:n,account:this.wallet.accounts[0]});if(!Array.isArray(i)||i.length===0)throw new Error(`Expected array result from signMessage, got: ${typeof i}`);const o=i[0];if(!o||!o.signature)throw new Error(`Invalid signMessage result structure: ${JSON.stringify(i)}`);const l=this.parseUint8Array(o.signature);if(l.length===0)throw new Error("Signature is empty");const u=o.account?.address||this.wallet.accounts[0]?.address||this._publicKey||"";return{signature:l,publicKey:u}}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana signMessage failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signTransaction(e){try{const t=this.wallet.features["solana:signTransaction"];if(!t)throw new Error("Wallet Standard signTransaction feature not available");if(!this.wallet.accounts||this.wallet.accounts.length===0)throw new Error("No accounts available. Please connect first.");const n=this.wallet.accounts[0],i=this.serializeTransaction(e),o=await t.signTransaction({transaction:i,account:n});let l;if(Array.isArray(o)&&o.length>0){const h=o[0];h&&typeof h=="object"&&(l=h.signedTransaction||h.transaction)}else if(o&&typeof o=="object"&&!Array.isArray(o)){const h=o;l=h.transaction||h.signedTransaction}if(!l)throw new Error("No transaction data found in Wallet Standard result");const u=this.parseUint8Array(l);if(u.length===0)throw new Error("Empty signed transaction returned from Wallet Standard");return L2(u)}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana signTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAndSendTransaction(e){try{const t=this.wallet.features["solana:signAndSendTransaction"];if(!t)throw new Error("Wallet Standard signAndSendTransaction feature not available");if(!this.wallet.accounts||this.wallet.accounts.length===0)throw new Error("No accounts available. Please connect first.");const n=this.wallet.accounts[0],i=n.chains?.[0]||"solana:mainnet",o=this.serializeTransaction(e),l=await t.signAndSendTransaction({transaction:o,account:n,chain:i});let u;if(Array.isArray(l)&&l.length>0)u=l[0];else if(l&&typeof l=="object"&&!Array.isArray(l))u=l;else throw new Error("Invalid signAndSendTransaction result format");if(!u.signature)throw new Error("No signature found in signAndSendTransaction result");const f=this.parseUint8Array(u.signature);return{signature:oo.encode(f)}}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana signAndSendTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAllTransactions(e){try{const t=[];for(const n of e){const i=await this.signTransaction(n);t.push(i)}return t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana signAllTransactions failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async signAndSendAllTransactions(e){try{const t=[];for(const n of e){const i=await this.signAndSendTransaction(n);t.push(i.signature)}return{signatures:t}}
38catch(t){throw Q.error(ee.INJECTED_PROVIDER,"Wallet Standard Solana signAndSendAllTransactions failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async switchNetwork(e){return Promise.resolve()}setupEventListeners(){const e=this.wallet.features["standard:events"];if(!e){Q.log(ee.INJECTED_PROVIDER,"Wallet Standard events feature not available",{walletId:this.walletId,walletName:this.walletName});return}Q.log(ee.INJECTED_PROVIDER,"Setting up Wallet Standard event listeners",{walletId:this.walletId,walletName:this.walletName}),e.on("change",t=>{if(Q.log(ee.INJECTED_PROVIDER,"Wallet Standard change event received",{walletId:this.walletId,walletName:this.walletName,hasAccounts:!!t.accounts,accountCount:t.accounts?.length||0}),t.accounts!==void 0)if(t.accounts.length>0){const n=t.accounts[0],i=this.extractAccountAddress(n);i?(this._publicKey=i,this.eventEmitter.emit("accountChanged",i),this.eventEmitter.emit("connect",i),Q.log(ee.INJECTED_PROVIDER,"Emitted accountChanged and connect events",{walletId:this.walletId,walletName:this.walletName,address:i})):(this._publicKey=null,this.eventEmitter.emit("accountChanged",null),Q.log(ee.INJECTED_PROVIDER,"Emitted accountChanged event (null - invalid account)",{walletId:this.walletId,walletName:this.walletName}))}else this._publicKey=null,this.eventEmitter.emit("accountChanged",null),this.eventEmitter.emit("disconnect"),Q.log(ee.INJECTED_PROVIDER,"Emitted accountChanged and disconnect events",{walletId:this.walletId,walletName:this.walletName})})}extractAccountAddress(e){return e.address}on(e,t){this.eventEmitter.on(e,t),Q.log(ee.INJECTED_PROVIDER,"Added event listener",{walletId:this.walletId,walletName:this.walletName,event:e})}off(e,t){this.eventEmitter.off(e,t),Q.log(ee.INJECTED_PROVIDER,"Removed event listener",{walletId:this.walletId,walletName:this.walletName,event:e})}serializeTransaction(e){return typeof e.serialize=="function"?e.serialize({requireAllSignatures:!1,verifySignatures:!1}):e instanceof Uint8Array?e:new Uint8Array(0)}parseUint8Array(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if(typeof e=="object"&&e!==null){const t=Object.keys(e).map(Number).filter(n=>!isNaN(n)&&n>=0).sort((n,i)=>n-i);if(t.length>0){const n=Math.max(...t),i=new Uint8Array(n+1);for(const o of t)i[o]=Number(e[o])||0;return i}}return new Uint8Array(0)}},Mx=class{constructor(e,t,n){this.eventEmitter=new ru,this._connected=!1,this._chainId="0x1",this._accounts=[],this.provider=e,this.walletId=t,this.walletName=n,this.setupEventListeners()}get chainId(){return this._chainId}get accounts(){return this._accounts}async request(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum request",{walletId:this.walletId,walletName:this.walletName,method:e.method});try{["personal_sign","eth_sign","eth_signTypedData","eth_signTypedData_v4","eth_sendTransaction","eth_signTransaction"].includes(e.method)&&(!this._connected||this._accounts.length===0)&&(Q.log(ee.INJECTED_PROVIDER,"Method requires authorization, ensuring connection",{walletId:this.walletId,walletName:this.walletName,method:e.method}),await this.connect());const n=await this.provider.request(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum request success",{walletId:this.walletId,walletName:this.walletName,method:e.method}),n}catch(t){if(t?.code===4100){Q.log(ee.INJECTED_PROVIDER,"Got 4100 Unauthorized, attempting to re-authorize",{walletId:this.walletId,walletName:this.walletName,method:e.method});try{await this.provider.request({method:"eth_requestAccounts"});const n=await this.provider.request(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum request success (after re-auth)",{walletId:this.walletId,walletName:this.walletName,method:e.method}),n}catch(n){throw Q.error(ee.INJECTED_PROVIDER,"Failed after re-authorization",{walletId:this.walletId,walletName:this.walletName,method:e.method,error:n instanceof Error?n.message:String(n)}),n}}throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum request failed",{walletId:this.walletId,walletName:this.walletName,method:e.method,error:t instanceof Error?t.message:String(t),errorCode:t?.code}),t}}async connect(){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum connect",{walletId:this.walletId,walletName:this.walletName});try{const e=await this.provider.request({method:"eth_requestAccounts"});return this._connected=e.length>0,this._accounts=e,Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum connected (via eth_requestAccounts)",{walletId:this.walletId,walletName:this.walletName,accountCount:e.length,accounts:e}),e}catch(e){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum connect failed",{walletId:this.walletId,walletName:this.walletName,error:e instanceof Error?e.message:String(e)}),e}}async disconnect(){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum disconnect",{walletId:this.walletId,walletName:this.walletName});try{await this.provider.disconnect(),this._connected=!1,this._accounts=[],Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum disconnected",{walletId:this.walletId,walletName:this.walletName})}catch(e){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum disconnect failed",{walletId:this.walletId,walletName:this.walletName,error:e instanceof Error?e.message:String(e)}),e}}async signPersonalMessage(e,t){const n=e.length>50?e.substring(0,50)+"...":e;Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum signPersonalMessage",{walletId:this.walletId,walletName:this.walletName,messagePreview:n,messageLength:e.length,address:t});try{const i=this.provider,o=(typeof i.isConnected=="function"?i.isConnected():!1)||(typeof i.connected=="boolean"?i.connected:!1);(!this._connected||this._accounts.length===0||!o)&&(Q.log(ee.INJECTED_PROVIDER,"Not connected, attempting to connect before signing",{walletId:this.walletId,walletName:this.walletName,internalConnected:this._connected,accountsLength:this._accounts.length,providerConnected:o}),await this.connect());const l=t.toLowerCase();if(!this._accounts.map(h=>h.toLowerCase()).includes(l)){Q.warn(ee.INJECTED_PROVIDER,"Address not in connected accounts, refreshing connection",{walletId:this.walletId,walletName:this.walletName,requestedAddress:t,connectedAccounts:this._accounts});const h=await this.getAccounts();if(!h.map(_=>_.toLowerCase()).includes(l))throw new Error(`Address ${t} is not connected. Connected accounts: ${h.join(", ")}`);this._accounts=h}if(typeof this.provider.signPersonalMessage=="function"){const h=await this.provider.signPersonalMessage(e,t);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signPersonalMessage success",{walletId:this.walletId,walletName:this.walletName,signatureLength:h.length}),h}const f=await this.request({method:"personal_sign",params:[e,t]});return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signPersonalMessage success",{walletId:this.walletId,walletName:this.walletName,signatureLength:f.length}),f}catch(i){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum signPersonalMessage failed",{walletId:this.walletId,walletName:this.walletName,error:i instanceof Error?i.message:String(i),errorCode:i?.code}),i}}async signTypedData(e,t){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum signTypedData",{walletId:this.walletId,walletName:this.walletName,primaryType:e?.primaryType,address:t});try{if(typeof this.provider.signTypedData=="function"){const i=await this.provider.signTypedData(e,t);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signTypedData success",{walletId:this.walletId,walletName:this.walletName,signatureLength:i.length}),i}const n=await this.request({method:"eth_signTypedData_v4",params:[t,e]});return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signTypedData success",{walletId:this.walletId,walletName:this.walletName,signatureLength:n.length}),n}catch(n){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum signTypedData failed",{walletId:this.walletId,walletName:this.walletName,error:n instanceof Error?n.message:String(n)}),n}}async signTransaction(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum signTransaction",{walletId:this.walletId,walletName:this.walletName,from:e.from,to:e.to});try{if(typeof this.provider.signTransaction=="function"){const n=await this.provider.signTransaction(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signTransaction success",{walletId:this.walletId,walletName:this.walletName,signatureLength:n.length}),n}const t=await this.request({method:"eth_signTransaction",params:[e]});return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum signTransaction success",{walletId:this.walletId,walletName:this.walletName,signatureLength:t.length}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum signTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async sendTransaction(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum sendTransaction",{walletId:this.walletId,walletName:this.walletName,from:e.from,to:e.to,value:e.value});try{if(typeof this.provider.sendTransaction=="function"){const n=await this.provider.sendTransaction(e);return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum sendTransaction success",{walletId:this.walletId,walletName:this.walletName,txHash:n}),n}const t=await this.request({method:"eth_sendTransaction",params:[e]});return Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum sendTransaction success",{walletId:this.walletId,walletName:this.walletName,txHash:t}),t}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum sendTransaction failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async switchChain(e){Q.log(ee.INJECTED_PROVIDER,"External wallet Ethereum switchChain",{walletId:this.walletId,walletName:this.walletName,chainId:e});try{const t=typeof e=="string"?e.toLowerCase().startsWith("0x")?e:`0x${parseInt(e,10).toString(16)}`:`0x${e.toString(16)}`;typeof this.provider.switchChain=="function"?await this.provider.switchChain(t):await this.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]}),this._chainId=t,this.eventEmitter.emit("chainChanged",this._chainId),Q.info(ee.INJECTED_PROVIDER,"External wallet Ethereum switchChain success",{walletId:this.walletId,walletName:this.walletName,chainId:t})}catch(t){throw Q.error(ee.INJECTED_PROVIDER,"External wallet Ethereum switchChain failed",{walletId:this.walletId,walletName:this.walletName,error:t instanceof Error?t.message:String(t)}),t}}async getChainId(){if(typeof this.provider.getChainId=="function"){const n=await this.provider.getChainId();
38return this._chainId=`0x${n.toString(16)}`,n}const e=await this.request({method:"eth_chainId"}),t=parseInt(e,16);return this._chainId=e,t}async getAccounts(){if(typeof this.provider.getAccounts=="function"){const t=await this.provider.getAccounts();return this._accounts=t,t}const e=await this.request({method:"eth_accounts"});return this._accounts=e,e}isConnected(){return this._connected}setupEventListeners(){typeof this.provider.on=="function"&&(this.provider.on("connect",e=>{this._connected=!0,this._chainId=e.chainId,this.eventEmitter.emit("connect",e)}),this.provider.on("disconnect",e=>{this._connected=!1,this._accounts=[],this.eventEmitter.emit("disconnect",e),this.eventEmitter.emit("accountsChanged",[])}),this.provider.on("accountsChanged",e=>{this._accounts=e,this._connected=e.length>0,this.eventEmitter.emit("accountsChanged",e)}),this.provider.on("chainChanged",e=>{this._chainId=e,this.eventEmitter.emit("chainChanged",e)}))}on(e,t){this.eventEmitter.on(e,t)}off(e,t){this.eventEmitter.off(e,t)}};function Xo(e){return e!==void 0&&e.id==="phantom"&&"isPhantom"in e&&e.isPhantom===!0}function JM(e){return e!==null&&typeof e=="object"&&"features"in e&&typeof e.features=="object"}var XM=class{constructor(){this.wallets=new Map,this.discoveryPromise=null}register(e){const t={};e.providers?.solana&&(JM(e.providers.solana)?(t.solana=new ZM(e.providers.solana,e.id,e.name),Q.log(ee.BROWSER_SDK,"Wrapped Wallet Standard Solana wallet with adapter",{walletId:e.id,walletName:e.name})):(t.solana=new Cx(e.providers.solana,e.id,e.name),Q.log(ee.BROWSER_SDK,"Wrapped Solana provider with InjectedWalletSolanaChain",{walletId:e.id,walletName:e.name}))),e.providers?.ethereum&&(t.ethereum=new Mx(e.providers.ethereum,e.id,e.name),Q.log(ee.BROWSER_SDK,"Wrapped Ethereum provider with InjectedWalletEthereumChain",{walletId:e.id,walletName:e.name}));const n={...e,providers:Object.keys(t).length>0?t:e.providers};this.wallets.set(e.id,n)}registerPhantom(e,t){const n={};t.includes(Ct.solana)&&e.solana&&(n.solana=new Cx(e.solana,"phantom","Phantom"),Q.log(ee.BROWSER_SDK,"Created InjectedWalletSolanaChain wrapper for Phantom",{walletId:"phantom"})),t.includes(Ct.ethereum)&&e.ethereum&&(n.ethereum=new Mx(e.ethereum,"phantom","Phantom"),Q.log(ee.BROWSER_SDK,"Created InjectedWalletEthereumChain wrapper for Phantom",{walletId:"phantom"}));const i={id:"phantom",name:"Phantom",icon:HE,addressTypes:t,providers:n,isPhantom:!0,phantomInstance:e,discovery:"phantom"};this.wallets.set("phantom",i),Q.log(ee.BROWSER_SDK,"Registered Phantom wallet with chain wrappers",{addressTypes:t,hasSolana:!!n.solana,hasEthereum:!!n.ethereum})}unregister(e){this.wallets.delete(e)}has(e){return this.wallets.has(e)}getById(e){return this.wallets.get(e)}getAll(){return Array.from(this.wallets.values())}getByAddressTypes(e){if(e.length===0)return this.getAll();const t=new Set(e);return this.getAll().filter(n=>n.addressTypes.some(i=>t.has(i)))}discover(e){return this.discoveryPromise?this.discoveryPromise:(Q.log(ee.BROWSER_SDK,"Starting wallet discovery",{addressTypes:e}),this.discoveryPromise=YM(e).then(t=>{const n=e?t.filter(i=>i.addressTypes.some(o=>e.includes(o))):t;for(const i of n)i.id==="phantom"&&Xo(i)?this.registerPhantom(i.phantomInstance,i.addressTypes):this.register(i),Q.log(ee.BROWSER_SDK,"Registered discovered wallet",{id:i.id,name:i.name,addressTypes:i.addressTypes});Q.info(ee.BROWSER_SDK,"Wallet discovery completed",{totalDiscovered:t.length,relevantWallets:n.length})}).catch(t=>{throw Q.warn(ee.BROWSER_SDK,"Wallet discovery failed",{error:t}),this.discoveryPromise=null,t}),this.discoveryPromise)}},Xp=null;function V2(){return Xp||(Xp=new XM),Xp}var Qp="phantom-injected-was-connected",Bx="true",Dx="phantom-injected-last-wallet-id",QM=class{constructor(e){this.selectedWalletId=null,this.walletStates=new Map,this.eventListeners=new Map,this.eventsInitialized=!1,this.eventListenersSetup=new Set,this.eventListenerCleanups=new Map,Q.log(ee.INJECTED_PROVIDER,"Initializing InjectedProvider",{config:e}),this.addressTypes=e.addressTypes,this.walletRegistry=V2(),Q.log(ee.INJECTED_PROVIDER,"Address types configured",{addressTypes:this.addressTypes}),this.walletRegistry.discover(this.addressTypes).catch(t=>{Q.warn(ee.INJECTED_PROVIDER,"Wallet discovery failed during initialization",{error:t})}),Q.info(ee.INJECTED_PROVIDER,"InjectedProvider initialized")}async waitForWalletDiscovery(e){if(!this.walletRegistry.has(e)){Q.log(ee.INJECTED_PROVIDER,"Wallet not found in registry, waiting for discovery",{walletId:e});try{await this.walletRegistry.discover(this.addressTypes),Q.log(ee.INJECTED_PROVIDER,"Wallet discovery completed",{walletId:e})}catch(t){Q.warn(ee.INJECTED_PROVIDER,"Wallet discovery failed",{walletId:e,error:t instanceof Error?t.message:String(t)})}}}getChainProvider(e,t,n){if(!this.addressTypes.includes(e))throw new Error(`${n} not enabled for this provider`);const i=this.selectedWalletId||"phantom",o=this.walletRegistry.getById(i);if(!o)throw this.walletRegistry.discoveryPromise?new Error(`Wallet "${i}" not found. Wallet discovery is still in progress. Please wait for sdk.discoverWallets() to complete before accessing chain properties.`):new Error(`Wallet "${i}" not found. Please ensure wallet discovery has completed. Make sure you call sdk.discoverWallets() and await it before accessing chain properties.`);const l=o.providers?.[t];if(!l)throw new Error(`Selected wallet "${o.name}" does not support ${n}. This wallet only supports: ${o.addressTypes.join(", ")}. Make sure your SDK config includes ${n} in addressTypes.`);return l}get solana(){return this.getChainProvider(Ct.solana,"solana","Solana")}get ethereum(){return this.getChainProvider(Ct.ethereum,"ethereum","Ethereum")}validateAndSelectWallet(e){if(!this.walletRegistry.has(e))throw Q.error(ee.INJECTED_PROVIDER,"Unknown injected wallet id requested",{walletId:e}),new Error(`Unknown injected wallet id: ${e}`);const t=this.walletRegistry.getById(e);if(!t||!t.providers)throw Q.warn(ee.INJECTED_PROVIDER,"Wallet not available for connection",{walletId:e}),new Error(`Wallet not available for connection: ${e}`);return this.selectedWalletId=e,Q.log(ee.INJECTED_PROVIDER,"Selected injected wallet for connection",{walletId:e}),t}async connectToWallet(e,t){if(!e.providers){const i=new Error(`Wallet adapter not available for wallet: ${this.selectedWalletId}`);throw Q.error(ee.INJECTED_PROVIDER,"Wallet adapter not available",{walletId:this.selectedWalletId}
38),this.emit("connect_error",{error:i.message,source:t?.skipEventListeners?"auto-connect":"manual-connect"}),i}Q.log(ee.INJECTED_PROVIDER,"Connecting via wallet",{walletId:this.selectedWalletId,walletName:e.name,options:t}),t?.skipEventListeners||this.setupEventListeners(e);const n=[];if(this.addressTypes.includes(Ct.solana)&&e.providers?.solana){Q.log(ee.INJECTED_PROVIDER,"Attempting Solana connection",{walletId:this.selectedWalletId,walletName:e.name,onlyIfTrusted:t?.onlyIfTrusted});try{const o=(await e.providers.solana.connect(t?.onlyIfTrusted?{onlyIfTrusted:!0}:void 0)).publicKey;n.push({addressType:Ct.solana,address:o}),Q.info(ee.INJECTED_PROVIDER,"Solana connected successfully",{address:o,walletId:this.selectedWalletId,walletName:e.name})}catch(i){Q.warn(ee.INJECTED_PROVIDER,"Failed to connect Solana, continuing with other chains",{error:i,walletId:this.selectedWalletId,walletName:e.name})}}if(this.addressTypes.includes(Ct.ethereum)&&e.providers?.ethereum){Q.log(ee.INJECTED_PROVIDER,"Attempting Ethereum connection",{walletId:this.selectedWalletId,walletName:e.name,silent:t?.silent});try{let i;t?.silent?i=await e.providers.ethereum.request({method:"eth_accounts"}):i=await e.providers.ethereum.connect(),i.length>0&&(n.push(...i.map(o=>({addressType:Ct.ethereum,address:o}))),Q.info(ee.INJECTED_PROVIDER,"Ethereum connected successfully",{addresses:i,walletId:this.selectedWalletId,walletName:e.name}))}catch(i){Q.warn(ee.INJECTED_PROVIDER,"Failed to connect Ethereum, continuing with other chains",{error:i,walletId:this.selectedWalletId,walletName:e.name})}}return n}async finalizeConnection(e,t,n){if(e.length===0){const f=new Error("Failed to connect to any supported wallet provider");throw this.emit("connect_error",{error:f.message,source:"manual-connect"}),f}this.selectedWalletId&&this.setWalletState(this.selectedWalletId,{connected:!0,addresses:e}),Q.log(ee.INJECTED_PROVIDER,"Finalized connection with addresses",{addressCount:e.length,addresses:e.map(f=>({type:f.addressType,address:f.address.substring(0,10)+"..."}))});const i=await this.getAuthUserId("manual-connect");try{localStorage.setItem(Qp,Bx),Q.log(ee.INJECTED_PROVIDER,"Set was-connected flag - auto-reconnect enabled"),this.selectedWalletId&&(localStorage.setItem(Dx,this.selectedWalletId),Q.log(ee.INJECTED_PROVIDER,"Stored last injected wallet id",{walletId:this.selectedWalletId}))}catch(f){Q.warn(ee.INJECTED_PROVIDER,"Failed to persist injected provider state",{error:f})}const o=n?this.walletRegistry.getById(n):void 0,l=o?{id:o.id,name:o.name,icon:o.icon,addressTypes:o.addressTypes,rdns:o.rdns,discovery:o.discovery}:void 0,u={addresses:e,status:"completed",authUserId:i,authProvider:t,walletId:n,wallet:l};return this.emit("connect",{addresses:e,source:"manual-connect",authUserId:i,walletId:n}),u}async connect(e){if(Q.info(ee.INJECTED_PROVIDER,"Starting injected provider connect",{addressTypes:this.addressTypes,provider:e.provider}),e.provider!=="injected")throw new Error(`Invalid provider for injected connection: ${e.provider}. Must be "injected"`);const t=e.walletId||"phantom";this.emit("connect_start",{source:"manual-connect",providerType:"injected",walletId:t});try{const n=this.validateAndSelectWallet(t),i=await this.connectToWallet(n);return await this.finalizeConnection(i,"injected",this.selectedWalletId||void 0)}catch(n){throw this.emit("connect_error",{error:n instanceof Error?n.message:"Failed to connect",source:"manual-connect"}),n}}async disconnect(){Q.info(ee.INJECTED_PROVIDER,"Starting injected provider disconnect");const e=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(e?.providers){if(this.addressTypes.includes(Ct.solana)&&e.providers.solana)try{await e.providers.solana.disconnect(),Q.log(ee.INJECTED_PROVIDER,"Solana disconnected successfully")}catch(i){Q.warn(ee.INJECTED_PROVIDER,"Failed to disconnect Solana",{error:i})}if(this.addressTypes.includes(Ct.ethereum)&&e.providers.ethereum)try{await e.providers.ethereum.disconnect(),Q.log(ee.INJECTED_PROVIDER,"Ethereum disconnected successfully")}catch(i){Q.warn(ee.INJECTED_PROVIDER,"Failed to disconnect Ethereum",{error:i})}}const t=this.selectedWalletId||"phantom",n=this.eventListenerCleanups.get(t);n&&(n.forEach(i=>
38i()),this.eventListenerCleanups.delete(t)),this.eventListenersSetup.delete(t),this.selectedWalletId&&this.setWalletState(this.selectedWalletId,{connected:!1,addresses:[]});try{localStorage.removeItem(Qp),Q.log(ee.INJECTED_PROVIDER,"Cleared was connected flag to prevent auto-reconnect")}catch(i){Q.warn(ee.INJECTED_PROVIDER,"Failed to clear was-connected flag",{error:i})}this.emit("disconnect",{source:"manual-disconnect"}),Q.info(ee.INJECTED_PROVIDER,"Injected provider disconnected successfully")}async autoConnect(){Q.log(ee.INJECTED_PROVIDER,"Attempting auto-connect");let e=null;try{if(localStorage.getItem(Qp)!==Bx){Q.log(ee.INJECTED_PROVIDER,"Skipping auto-connect: user was not previously connected");return}e=localStorage.getItem(Dx),Q.log(ee.INJECTED_PROVIDER,"User was previously connected, attempting auto-connect",{lastWalletId:e||"phantom"})}catch(t){Q.warn(ee.INJECTED_PROVIDER,"Failed to check was-connected flag",{error:t});return}this.emit("connect_start",{source:"auto-connect",providerType:"injected"});try{const t=e||"phantom";await this.waitForWalletDiscovery(t);const n=this.validateAndSelectWallet(t);let i=[];try{i=await this.connectToWallet(n,{onlyIfTrusted:!0,silent:!0,skipEventListeners:!0})}catch(l){Q.log(ee.INJECTED_PROVIDER,"Auto-connect failed (expected if not trusted)",{error:l,walletId:this.selectedWalletId})}if(i.length===0){Q.log(ee.INJECTED_PROVIDER,"Auto-connect failed: no trusted connections available"),this.emit("connect_error",{error:"No trusted connections available",source:"auto-connect"});return}this.setupEventListeners(n),this.selectedWalletId&&this.setWalletState(this.selectedWalletId,{connected:!0,addresses:i});const o=await this.getAuthUserId("auto-connect");this.emit("connect",{addresses:i,source:"auto-connect",authUserId:o,walletId:this.selectedWalletId}),Q.info(ee.INJECTED_PROVIDER,"Auto-connect successful",{addressCount:i.length,addresses:i.map(l=>({type:l.addressType,address:l.address.substring(0,8)+"..."})),walletId:this.selectedWalletId,authUserId:o})}catch(t){Q.log(ee.INJECTED_PROVIDER,"Auto-connect failed with error",{error:t instanceof Error?t.message:String(t)}),this.emit("connect_error",{error:t instanceof Error?t.message:"Auto-connect failed",source:"auto-connect"})}}getWalletState(e){return this.walletStates.has(e)||this.walletStates.set(e,{connected:!1,addresses:[]}),this.walletStates.get(e)}setWalletState(e,t){this.walletStates.set(e,t)}updateWalletAddresses(e,t,n){const o=this.getWalletState(e).addresses.filter(f=>f.addressType!==n),l=t.map(f=>({addressType:n,address:f})),u=[...o,...l];return this.setWalletState(e,{connected:u.length>0,addresses:u}),u}getAccountChangeSource(e){return`${e}-account-change`}createSolanaConnectHandler(e,t){return async n=>{Q.log(ee.INJECTED_PROVIDER,"Solana connect event received",{publicKey:n,walletId:e});const i=this.updateWalletAddresses(e,[n],Ct.solana),o=await this.getAuthUserId("Solana connect event");this.emit("connect",{addresses:i,source:t,authUserId:o,walletId:this.selectedWalletId})}}createSolanaDisconnectHandler(e,t){return()=>{Q.log(ee.INJECTED_PROVIDER,"Solana disconnect event received",{walletId:e});const i=this.getWalletState(e).addresses.filter(o=>o.addressType!==Ct.solana);this.setWalletState(e,{connected:i.length>0,addresses:i}),this.emit("disconnect",{source:t})}}createSolanaAccountChangeHandler(e,t){return async n=>{if(Q.log(ee.INJECTED_PROVIDER,"Solana account changed event received",{publicKey:n,walletId:e}),n){const i=this.updateWalletAddresses(e,[n],Ct.solana),o=await this.getAuthUserId("Solana account changed event");this.emit("connect",{addresses:i,source:this.getAccountChangeSource(t),authUserId:o,walletId:this.selectedWalletId})}else{const o=this.getWalletState(e).addresses.filter(l=>l.addressType!==Ct.solana);this.setWalletState(e,{connected:o.length>0,addresses:o}),this.emit("disconnect",{source:this.getAccountChangeSource(t)})}}}createEthereumConnectHandler(e,t){return async n=>{let i=[];if(Array.isArray(n))i=n;else try{const o=this.walletRegistry.getById(e);o?.providers?.ethereum&&(i=await o.providers.ethereum.getAccounts())}catch(o){Q.warn(ee.INJECTED_PROVIDER,"Failed to get accounts on connect",{error:o})}if(Q.log(ee.INJECTED_PROVIDER,"Ethereum connect event received",{accounts:i,walletId:e}),i.length>0){const o=this.updateWalletAddresses(e,i,Ct.ethereum),l=await this.getAuthUserId("Ethereum connect event");
38this.emit("connect",{addresses:o,source:t,authUserId:l,walletId:this.selectedWalletId})}}}createEthereumDisconnectHandler(e,t){return()=>{Q.log(ee.INJECTED_PROVIDER,"Ethereum disconnect event received",{walletId:e});const i=this.getWalletState(e).addresses.filter(o=>o.addressType!==Ct.ethereum);this.setWalletState(e,{connected:i.length>0,addresses:i}),this.emit("disconnect",{source:t})}}createEthereumAccountChangeHandler(e,t){return async n=>{if(Q.log(ee.INJECTED_PROVIDER,"Ethereum accounts changed event received",{accounts:n,walletId:e}),n&&n.length>0){const i=this.updateWalletAddresses(e,n,Ct.ethereum),o=await this.getAuthUserId("Ethereum accounts changed event");this.emit("connect",{addresses:i,source:this.getAccountChangeSource(t),authUserId:o,walletId:this.selectedWalletId})}else{const o=this.getWalletState(e).addresses.filter(l=>l.addressType!==Ct.ethereum);this.setWalletState(e,{connected:o.length>0,addresses:o}),this.emit("disconnect",{source:this.getAccountChangeSource(t)})}}}getAddresses(){const e=this.selectedWalletId||"phantom";return this.getWalletState(e).addresses}getEnabledAddressTypes(){if(!this.selectedWalletId||this.selectedWalletId==="phantom")return this.addressTypes;const e=this.walletRegistry.getById(this.selectedWalletId);return e?e.addressTypes:this.addressTypes}isConnected(){const e=this.selectedWalletId||"phantom";return this.getWalletState(e).connected}async enableAutoConfirm(e){const t=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(!Xo(t))throw new Error("Auto-confirm is only available for Phantom wallet");return Q.log(ee.INJECTED_PROVIDER,"Enabling autoConfirm",{params:e}),await t.phantomInstance.autoConfirm.autoConfirmEnable(e)}async disableAutoConfirm(){const e=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(!Xo(e))throw new Error("Auto-confirm is only available for Phantom wallet");Q.log(ee.INJECTED_PROVIDER,"Disabling autoConfirm"),await e.phantomInstance.autoConfirm.autoConfirmDisable()}async getAutoConfirmStatus(){const e=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(!Xo(e))throw new Error("Auto-confirm is only available for Phantom wallet");return Q.log(ee.INJECTED_PROVIDER,"Getting autoConfirm status"),await e.phantomInstance.autoConfirm.autoConfirmStatus()}async getSupportedAutoConfirmChains(){const e=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(!Xo(e))throw new Error("Auto-confirm is only available for Phantom wallet");return Q.log(ee.INJECTED_PROVIDER,"Getting supported autoConfirm chains"),await e.phantomInstance.autoConfirm.autoConfirmSupportedChains()}async getAuthUserId(e){const t=this.walletRegistry.getById(this.selectedWalletId||"phantom");if(Xo(t))try{if(window.phantom?.app?.getUser){const i=(await window.phantom.app.getUser())?.authUserId;return i&&Q.log(ee.INJECTED_PROVIDER,`Retrieved authUserId from window.phantom.app.getUser() during ${e}`,{authUserId:i}),i}}catch(n){Q.log(ee.INJECTED_PROVIDER,`Failed to get user info during ${e} (method may not be supported)`,{error:n})}}on(e,t){if(Q.log(ee.INJECTED_PROVIDER,"Adding event listener",{event:e}),!this.eventsInitialized){const n=this.selectedWalletId||"phantom",i=this.walletRegistry.getById(n);i&&this.setupEventListeners(i)}this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(t)}off(e,t){Q.log(ee.INJECTED_PROVIDER,"Removing event listener",{event:e}),this.eventListeners.has(e)&&(this.eventListeners.get(e)?.delete(t),this.eventListeners.get(e)?.size===0&&this.eventListeners.delete(e))}emit(e,t){Q.log(ee.INJECTED_PROVIDER,"Emitting event",{event:e,listenerCount:this.eventListeners.get(e)?.size||0,data:t});const n=this.eventListeners.get(e);n&&n.size>0&&n.forEach(i=>{try{i(t)}catch(o){Q.error(ee.INJECTED_PROVIDER,"Event callback error",{event:e,error:o})}})}setupSolanaEventListeners(e,t,n){if(typeof e.on!="function")return;Q.log(ee.INJECTED_PROVIDER,"Setting up Solana event listeners",{walletId:t,source:n});const i={connect:this.createSolanaConnectHandler(t,n),disconnect:this.createSolanaDisconnectHandler(t,n),accountChanged:this.createSolanaAccountChangeHandler(t,n)};e.on("connect",i.connect),e.on("disconnect",i.disconnect),e.on("accountChanged",i.accountChanged);const o=[];typeof e.off=="function"&&o.push(()=>e.off("connect",i.connect),()=>e.off("disconnect",i.disconnect),()=>e.off("accountChanged",i.accountChanged));const l=this.eventListenerCleanups.get(t)||[];this.eventListenerCleanups.set(t,[...l,...o])}setupEthereumEventListeners(e,t,n){if(typeof e.on!="function")return;Q.log(ee.INJECTED_PROVIDER,"Setting up Ethereum event listeners",{walletId:t,source:n});
38const i={connect:this.createEthereumConnectHandler(t,n),disconnect:this.createEthereumDisconnectHandler(t,n),accountsChanged:this.createEthereumAccountChangeHandler(t,n)};e.on("connect",i.connect),e.on("disconnect",i.disconnect),e.on("accountsChanged",i.accountsChanged);const o=[];typeof e.off=="function"&&o.push(()=>e.off("connect",i.connect),()=>e.off("disconnect",i.disconnect),()=>e.off("accountsChanged",i.accountsChanged));const l=this.eventListenerCleanups.get(t)||[];this.eventListenerCleanups.set(t,[...l,...o])}setupEventListeners(e){const t=this.selectedWalletId||"phantom";if(this.eventListenersSetup.has(t)){Q.log(ee.INJECTED_PROVIDER,"Event listeners already set up for wallet",{walletId:t});return}for(const n of this.eventListenersSetup){if(n===t)continue;const i=this.eventListenerCleanups.get(n);i&&(Q.log(ee.INJECTED_PROVIDER,"Cleaning up event listeners for wallet",{existingWalletId:n}),i.forEach(o=>o())),this.eventListenersSetup.delete(n)}Q.log(ee.INJECTED_PROVIDER,"Setting up event listeners",{walletId:t}),this.addressTypes.includes(Ct.solana)&&e.providers?.solana&&this.setupSolanaEventListeners(e.providers.solana,t,"wallet"),this.addressTypes.includes(Ct.ethereum)&&e.providers?.ethereum&&this.setupEthereumEventListeners(e.providers.ethereum,t,"wallet"),this.eventListenersSetup.add(t),this.eventsInitialized=!0}},eB=class{constructor(){this.dbName="phantom-browser-sdk",this.storeName="sessions",this.version=1}async getDB(){return new Promise((e,t)=>{const n=indexedDB.open(this.dbName,this.version);n.onerror=()=>t(n.error),n.onsuccess=()=>e(n.result),n.onupgradeneeded=i=>{const o=i.target.result;o.objectStoreNames.contains(this.storeName)||o.createObjectStore(this.storeName)}})}async getSession(){Q.log(ee.STORAGE,"Getting session from IndexedDB");const e=await this.getDB();return new Promise((t,n)=>{const l=e.transaction([this.storeName],"readonly").objectStore(this.storeName).get("currentSession");l.onsuccess=()=>{const u=l.result||null;Q.log(ee.STORAGE,"Retrieved session from IndexedDB",{hasSession:!!u,sessionId:u?.sessionId}),t(u)},l.onerror=()=>{Q.error(ee.STORAGE,"Failed to get session from IndexedDB",{error:l.error}),n(l.error)}})}async saveSession(e){Q.log(ee.STORAGE,"Saving session to IndexedDB",{sessionId:e.sessionId,walletId:e.walletId,status:e.status});const t=await this.getDB();return new Promise((n,i)=>{const u=t.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(e,"currentSession");u.onsuccess=()=>{Q.log(ee.STORAGE,"Successfully saved session to IndexedDB"),n()},u.onerror=()=>{Q.error(ee.STORAGE,"Failed to save session to IndexedDB",{error:u.error}),i(u.error)}})}async clearSession(){Q.log(ee.STORAGE,"Clearing session from IndexedDB");const e=await this.getDB();return new Promise((t,n)=>{const l=e.transaction([this.storeName],"readwrite").objectStore(this.storeName).delete("currentSession");l.onsuccess=()=>{Q.log(ee.STORAGE,"Successfully cleared session from IndexedDB"),t()},l.onerror=()=>{Q.error(ee.STORAGE,"Failed to clear session from IndexedDB",{error:l.error}),n(l.error)}})}async getShouldClearPreviousSession(){Q.log(ee.STORAGE,"Getting shouldClearPreviousSession flag from IndexedDB");const e=await this.getDB();return new Promise((t,n)=>{const l=e.transaction([this.storeName],"readonly").objectStore(this.storeName).get("shouldClearPreviousSession");l.onsuccess=()=>{const u=l.result??!1;Q.log(ee.STORAGE,"Retrieved shouldClearPreviousSession flag from IndexedDB",{shouldClear:u}),t(u)},l.onerror=()=>{Q.error(ee.STORAGE,"Failed to get shouldClearPreviousSession flag from IndexedDB",{error:l.error}),n(l.error)}})}async setShouldClearPreviousSession(e){Q.log(ee.STORAGE,"Setting shouldClearPreviousSession flag in IndexedDB",{should:e});const t=await this.getDB();return new Promise((n,i)=>{const u=t.transaction([this.storeName],"readwrite").objectStore(this.storeName).put(e,"shouldClearPreviousSession");u.onsuccess=()=>{Q.log(ee.STORAGE,"Successfully set shouldClearPreviousSession flag in IndexedDB"),n()},u.onerror=()=>{Q.error(ee.STORAGE,"Failed to set shouldClearPreviousSession flag in IndexedDB",{error:u.error}),i(u.error)}})}},tB=class{getParam(e){return new URLSearchParams(window.location.search).get(e)}};function nB(e,t){let n="unknown",i="unknown";if(!e||typeof e!="string")return{name:n,version:i,userAgent:"unknown"};try{if(e.includes("Edg/")){n="edge";const o=e.match(/Edg\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("OPR/")||e.includes("Opera/")){n="opera";const o=e.match(/(?:OPR|Opera)\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("SamsungBrowser/")){n="samsung";const o=e.match(/SamsungBrowser\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("DuckDuckGo/")){n="duckduckgo";const o=e.match(/DuckDuckGo\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Chrome/")&&t){n="brave";const o=e.match(/Chrome\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Mobile/")||e.includes("Android"))if(e.includes("Chrome/")){n="chrome-mobile";const o=e.match(/Chrome\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Firefox/")){n="firefox-mobile";const o=e.match(/Firefox\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Safari/")&&e.includes("Mobile/")){n="safari-mobile";const o=e.match(/Version\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else n="mobile";else if(e.includes("Chrome/")){n="chrome";const o=e.match(/Chrome\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Firefox/")){n="firefox";const o=e.match(/Firefox\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}else if(e.includes("Safari/")&&!e.includes("Chrome/")){n="safari";const o=e.match(/Version\/([0-9]+(?:\.[0-9]+)*)/);o&&(i=o[1].split(".")[0])}if(n==="unknown"){const o=[{regex:/Chrome\/([0-9]+)/,name:"chrome"},{regex:/Firefox\/([0-9]+)/,name:"firefox"},{regex:/Safari\/([0-9]+)/,name:"safari"},{regex:/Edge\/([0-9]+)/,name:"edge"},{regex:/Opera\/([0-9]+)/,name:"opera"}];for(const l of o){const u=e.match(l.regex);if(u){n=l.name,i=u[1];break}}}}catch{}return{name:n,version:i,userAgent:e}}function F2(){if(typeof window>"u"||!window.navigator?.userAgent)return{name:"unknown",version:"unknown",userAgent:"unknown"};const e=window.navigator.userAgent,t=!!navigator.brave;return nB(e,t)}function rB(){const{name:e,version:t}=F2();return t!=="unknown"?`${e}-v${t}`:e}function L1(){if(typeof window>"u"||!window.navigator?.userAgent)return!1;const e=window.navigator.userAgent.toLowerCase(),n=[/android/,/iphone|ipad|ipod/,/blackberry/,/windows phone/,/mobile/,/tablet/,/silk/,/kindle/,/opera mini/,/opera mobi/].some(l=>l.test(e));let i=!1;try{i=window.screen.width<=768||window.screen.height<=768}catch{i=!1}let o=!1;try{o="ontouchstart"in window||navigator.maxTouchPoints>0}catch{o=!1}
38return n||i&&o}var K2=class{constructor(e,t,n,i,o){this.stamper=e,this.storage=t,this.urlParamsAccessor=n,this.auth2ProviderOptions=i,this.kms=new mM(e,o)}static navigate(e){window.location.href=e}async authenticate(e){const t=await this.storage.getSession();if(!t)throw new Error("Session not found.");const{url:n,codeVerifier:i}=await CM({stamper:this.stamper,auth2Options:this.auth2ProviderOptions,sessionId:e.sessionId,provider:e.provider});await this.storage.saveSession({...t,pkceCodeVerifier:i}),K2.navigate(n)}async resumeAuthFromRedirect(e){if(!this.urlParamsAccessor.getParam("code"))return null;this.stamper.getKeyInfo()||await this.stamper.init();const t=await this.storage.getSession();if(!t)throw new Error("Session not found.");const n=t?.pkceCodeVerifier;if(!n)return null;const i=NM({getParam:l=>this.urlParamsAccessor.getParam(l),expectedSessionId:t.sessionId}),o=await kM({stamper:this.stamper,kms:this.kms,auth2Options:this.auth2ProviderOptions,code:i,codeVerifier:n,provider:e});return await this.storage.saveSession({...t,status:"completed",bearerToken:o.bearerToken,authUserId:o.authUserId,pkceCodeVerifier:void 0}),o}},da="crypto-keys",eg="auth2-p256-signing-key",iB=class{constructor(e){this.dbName=e,this.db=null,this.requiresExtractableKeys=!1}async open(){return new Promise((e,t)=>{const n=indexedDB.open(this.dbName,1);n.onsuccess=()=>{this.db=n.result,e()},n.onerror=()=>t(n.error),n.onupgradeneeded=i=>{const o=i.target.result;o.objectStoreNames.contains(da)||o.createObjectStore(da)}})}async load(){return new Promise((e,t)=>{if(!this.db)throw new Error("Database not initialized");const n=this.db.transaction([da],"readonly").objectStore(da).get(eg);n.onsuccess=()=>{e(n.result??null)},n.onerror=()=>{t(n.error)}})}async save(e){return new Promise((t,n)=>{if(!this.db)throw new Error("Database not initialized");const i=this.db.transaction([da],"readwrite").objectStore(da).put(e,eg);i.onsuccess=()=>{t()},i.onerror=()=>{n(i.error)}})}async clear(){return new Promise((e,t)=>{if(!this.db)throw new Error("Database not initialized");const n=this.db.transaction([da],"readwrite").objectStore(da).delete(eg);n.onsuccess=()=>{e()},n.onerror=()=>{t(n.error)}})}};async function q2(e=3e3){return new Promise(t=>{const n=Date.now(),i=100,o=()=>{try{if(Bs()){t(!0);return}}catch{}if(Date.now()-n>=e){t(!1);return}setTimeout(o,i)};o()})}async function $2(e=3e3){if(!await q2(e))return!1;try{if(!window.phantom?.app?.features||typeof window.phantom.app.features!="function")return!1;const n=await window.phantom.app.features();return Array.isArray(n.features)?n.features.includes("phantom_login"):!1}catch(n){return console.error("Error checking Phantom extension features",n),!1}}var sB=class{isAvailable(){return Bs()}async authenticate(e){if(!this.isAvailable())throw new Error("Phantom extension is not installed. Please install the Phantom browser extension to use this authentication method.");if(!await $2())throw new Error("Phantom Login is not available. Please update your Phantom extension to use this authentication method.");try{if(!window.phantom?.app?.login)throw new Error("Phantom extension login method not found");const n=await window.phantom.app.login({publicKey:e.publicKey,appId:e.appId,sessionId:e.sessionId});if(!n||!n.walletId||!n.organizationId)throw new Error("Invalid authentication response from Phantom extension");return{walletId:n.walletId,organizationId:n.organizationId,provider:"phantom",accountDerivationIndex:n.accountDerivationIndex??0,expiresInMs:n.expiresInMs??0,authUserId:n.authUserId}}catch(n){throw n instanceof Error?n:new Error(`Phantom extension authentication failed: ${String(n)}`)}}},aB=class{info(e,...t){Q.info(e,t.length>0?String(t[0]):"",t[1])}warn(e,...t){Q.warn(e,t.length>0?String(t[0]):"",t[1])}error(e,...t){Q.error(e,t.length>0?String(t[0]):"",t[1])}debug(e,...t){Q.log(e,t.length>0?String(t[0]):"",t[1])}},oB=class extends HM{constructor(e){Q.log(ee.EMBEDDED_PROVIDER,"Initializing Browser EmbeddedProvider",{config:e});const t=new tB,n=new eB,i=new vM(new iB(`phantom-auth2-${e.appId}`),{authApiBaseUrl:e.authOptions.authApiBaseUrl,clientId:e.appId,redirectUri:e.authOptions.redirectUrl}),o=rB(),{name:l,version:u}=F2(),f=new K2(i,n,t,{redirectUri:e.authOptions.redirectUrl,connectLoginUrl:e.authOptions.authUrl,clientId:e.appId,authApiBaseUrl:e.authOptions.authApiBaseUrl},{apiBaseUrl:e.apiBaseUrl,appId:e.appId}),h={storage:n,authProvider:f,phantomAppProvider:new sB,urlParam
38sAccessor:t,stamper:i,name:o,analyticsHeaders:{[Va.SDK_TYPE]:"browser",[Va.PLATFORM]:"ext-sdk",[Va.PLATFORM_VERSION]:u,[Va.CLIENT]:l,[Va.APP_ID]:e.appId,[Va.WALLET_TYPE]:e.embeddedWalletType,[Va.SDK_VERSION]:"2.0.2"}};Q.log(ee.EMBEDDED_PROVIDER,"Detected platform",{platformName:o});const y=new aB;super(e,h,y),this.addressTypes=e.addressTypes,Q.info(ee.EMBEDDED_PROVIDER,"Browser EmbeddedProvider initialized")}getEnabledAddressTypes(){return this.addressTypes}};function lB(e){if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search),n=t.get("response_type"),i=t.get("session_id");return n==="failure"&&!!i}function cB(e){if(typeof window>"u")return!1;const t=new URLSearchParams(window.location.search);return!!(t.get("session_id")&&(t.has("response_type")||t.has("wallet_id")))}function W2(e,t){const n=t??window.location.href;if(!n.startsWith("http:")&&!n.startsWith("https:"))throw new Error("Invalid URL protocol - only HTTP/HTTPS URLs are supported for deeplinks");const i=encodeURIComponent(n),o=e?`?ref=${encodeURIComponent(e)}`:"";return`https://phantom.app/ul/browse/${i}${o}`}var uB=class{constructor(e){this.providers=new Map,this.currentProvider=null,this.currentProviderKey=null,this.eventListeners=new Map,this.providerForwardingSetup=new WeakSet,Q.log(ee.PROVIDER_MANAGER,"Initializing ProviderManager",{config:e}),this.config=e,Q.log(ee.PROVIDER_MANAGER,"Setting default provider"),this.setDefaultProvider(),Q.info(ee.PROVIDER_MANAGER,"ProviderManager initialized",{currentProviderKey:this.currentProviderKey})}getValidatedCurrentUrl(){if(typeof window>"u")return"";const e=window.location.href;if(!e.startsWith("http:")&&!e.startsWith("https:"))throw new Error("Invalid URL protocol - only HTTP/HTTPS URLs are supported");return e}switchProvider(e,t){if(t?.embeddedWalletType&&!["app-wallet","user-wallet"].includes(t.embeddedWalletType))throw new Error(`Invalid embeddedWalletType: ${t.embeddedWalletType}. Must be "app-wallet" or "user-wallet".`);const n=this.getProviderKey(e,t?.embeddedWalletType);return this.providers.has(n)||this.createProvider(e,t?.embeddedWalletType),this.currentProvider=this.providers.get(n),this.currentProviderKey=n,this.ensureProviderEventForwarding(),this.currentProvider}getCurrentProvider(){return this.currentProvider}getCurrentProviderInfo(){if(!this.currentProviderKey)return null;const e=this.currentProviderKey.split("-"),[t,n]=e;return{type:t,embeddedWalletType:n}}isProviderAllowed(e){return this.config.providers.includes(e)}async connect(e){if(Q.info(ee.PROVIDER_MANAGER,"Starting connection",{currentProviderKey:this.currentProviderKey,authOptions:{provider:e.provider}}),!this.isProviderAllowed(e.provider)){const o=`Provider "${e.provider}" is not in the allowed providers list: ${JSON.stringify(this.config.providers)}`;throw Q.error(ee.PROVIDER_MANAGER,o),new Error(o)}const t=e.provider;let n=null;if(t==="injected")n="injected";else if(t==="deeplink")try{const o=W2();if(typeof window<"u"&&window.location)try{window.location.href=o}catch(l){Q.warn(ee.PROVIDER_MANAGER,"Failed to set deeplink location",{error:l instanceof Error?l.message:String(l)})}return{addresses:[],walletId:void 0,authUserId:void 0}}catch(o){const l=o instanceof Error?o.message:"Failed to open deeplink";throw Q.error(ee.PROVIDER_MANAGER,"Deeplink error",{error:l}),new Error(`Failed to open deeplink: ${l}`)}else wd.includes(t)&&(n="embedded");if(n){const o=this.getCurrentProviderInfo();if(o?.type!==n){Q.log(ee.PROVIDER_MANAGER,"Auto-switching provider based on auth options",{from:o?.type,to:n,requestedProvider:t});const l={};n==="embedded"&&(l.embeddedWalletType=o?.embeddedWalletType||this.config.embeddedWalletType),this.switchProvider(n,l)}}if(!this.currentProvider)throw Q.error(ee.PROVIDER_MANAGER,"No provider selected"),new Error("No provider selected");Q.log(ee.PROVIDER_MANAGER,"Delegating to provider connect method");const i=await this.currentProvider.connect(e);return Q.log(ee.PROVIDER_MANAGER,"Connection successful, saving preferences",{addressCount:i.addresses?.length||0,provider:e.provider}),this.saveProviderPreference(),Q.info(ee.PROVIDER_MANAGER,"Connect completed",{addresses:i.addresses,provider:e.provider}),i}async disconnect(){this.currentProvider&&await this.currentProvider.disconnect()}getAddresses(){return this.currentProvider?this.currentProvider.getAddresses():[]}isConnected(){return this.currentProvider?.isConnected()??!1}async autoConnect(){if(Q.log(ee.PROVIDER_MANAGER,"Starting auto-connect with fallback strategy"),lB())return Q.warn(ee.PROVIDER_MANAGER,"Auth failure detected in URL, skipping autoConnect fallback"),!1;const e=this.config.embeddedWalletType||"user-wallet",t=this.getProviderKey("embedded",e);if(this.config.providers.some(l=>l!=="injected")&&this.providers.has(t)){Q.log(ee.PROVIDER_MANAGER,"Trying auto-connect with existing embedded provider");const l=this.providers.get(t);try{const u=this.currentProvider,f=this.currentProviderKey;if(this.currentProvider=l,this.currentProviderKey=t,this.ensureProviderEventForwarding(),await l.autoConnect(),l.isConnected())return Q.info(ee.PROVIDER_MANAGER,"Embedded auto-connect successful"),this.saveProviderPreference(),!0;Q.log(ee.PROVIDER_MANAGER,"Embedded provider did not connect, restoring previous provider"),this.currentProvider=u,this.currentProviderKey=f}catch(u){if(Q.log(ee.PROVIDER_MANAGER,"Embedded auto-connect failed",{error:u.message}),cB())return Q.log(ee.PROVIDER_MANAGER,"In auth callback URL, not attempting injected fallback"),!1}}const i=this.config.providers.includes("injected"),o=this.getProviderKey("injected");if(i&&this.providers.has(o)){Q.log(ee.PROVIDER_MANAGER,"Trying auto-connect with existing injected provider");const l=this.providers.get(o);try{if(this.currentProvider=l,this.currentProviderKey=o,this.ensureProviderEventForwarding(),await l.autoConnect(),l.isConnected())return Q.info(ee.PROVIDER_MANAGER,"Injected auto-connect successful"),this.saveProviderPreference(),!0}catch(u){Q.log(ee.PROVIDER_MANAGER,"Injected auto-connect failed",{error:u.message})}}return Q.log(ee.PROVIDER_MANAGER,"Auto-connect failed for all allowed providers"),!1}on(e,t){Q.log(ee.PROVIDER_MANAGER,"Adding event listener",{event:e}),this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e)?.add(t),this.ensureProviderEventForwarding()}off(e,t){Q.log(ee.PROVIDER_MANAGER,"Removing event listener",{event:e}),this.eventListeners.has(e)&&(this.eventListeners.get(e)?.delete(t),this.eventListeners.get(e)?.size===0&&this.eventListeners.delete(e))}emit(e,t){Q.log(ee.PROVIDER_MANAGER,"Emitting event to stored callbacks",{event:e,listenerCount:this.eventListeners.get(e)?.size||0,data:t});const n=this.eventListeners.get(e);n&&n.size>
380?n.forEach(i=>{try{Q.log(ee.PROVIDER_MANAGER,"Calling stored callback for event",{event:e}),i(t)}catch(o){Q.error(ee.PROVIDER_MANAGER,"Event callback error",{event:e,error:o})}}):Q.warn(ee.PROVIDER_MANAGER,"No stored callbacks for event",{event:e})}ensureProviderEventForwarding(){if(!this.currentProvider||!("on"in this.currentProvider)){Q.warn(ee.PROVIDER_MANAGER,"Current provider does not support events",{providerType:this.getCurrentProviderInfo()?.type});return}if(this.providerForwardingSetup.has(this.currentProvider)){Q.log(ee.PROVIDER_MANAGER,"Event forwarding already set up for current provider");return}Q.log(ee.PROVIDER_MANAGER,"Setting up event forwarding from current provider");const e=["connect_start","connect","connect_error","disconnect","error","spending_limit_reached"];for(const t of e){const n=i=>{Q.log(ee.PROVIDER_MANAGER,"Forwarding event from provider",{event:t,data:i}),this.emit(t,i)};Q.log(ee.PROVIDER_MANAGER,"Attaching forwarding callback for event",{event:t}),this.currentProvider.on(t,n)}this.providerForwardingSetup.add(this.currentProvider)}setDefaultProvider(){const e=this.config.embeddedWalletType||"user-wallet",t=this.config.providers.includes("injected"),n=this.config.providers.some(l=>l!=="injected"&&l!=="deeplink");t&&(Q.log(ee.PROVIDER_MANAGER,"Creating injected provider (allowed by providers array)"),this.createProvider("injected")),n&&(Q.log(ee.PROVIDER_MANAGER,"Creating embedded provider (allowed by providers array)"),this.createProvider("embedded",e));let i;if(n&&this.providers.has(`embedded-${e}`))i="embedded";else if(t&&this.providers.has("injected"))i="injected";else throw new Error("No valid providers could be created from the providers array");const o={};i==="embedded"&&(o.embeddedWalletType=e),this.switchProvider(i,o)}createProvider(e,t){const n=this.getProviderKey(e,t);if(this.providers.has(n))return;let i;if(e==="injected")i=new QM({addressTypes:this.config.addressTypes||[Ct.solana]});else if(e==="embedded"){if(!this.config.appId)throw new Error("appId is required for embedded provider");const o=this.config.apiBaseUrl||LA,l=this.config.authOptions?.authUrl||UA,u=this.config.authOptions?.authApiBaseUrl||jA;i=new oB({apiBaseUrl:o,appId:this.config.appId,authOptions:{...this.config.authOptions||{},authUrl:l,redirectUrl:this.config.authOptions?.redirectUrl||this.getValidatedCurrentUrl(),authApiBaseUrl:u},embeddedWalletType:t||VE,addressTypes:this.config.addressTypes||[Ct.solana]})}else throw new Error(`Unsupported provider type: ${e}`);this.providers.set(n,i)}getProviderKey(e,t){if(e==="injected")return"injected";if(e==="embedded")return`embedded-${t||"app-wallet"}`;throw new Error(`Unsupported provider type: ${e}`)}saveProviderPreference(){try{const e=this.getCurrentProviderInfo();e&&localStorage.setItem("phantom-provider-preference",JSON.stringify(e))}catch(e){console.error("Failed to save provider preference:",e)}}},tg=[...wd,"injected","deeplink"],fB=class{constructor(e){if(this.walletRegistry=V2(),this.isLoading=!0,Q.info(ee.BROWSER_SDK,"Initializing BrowserSDK",{providers:e.providers,embeddedWalletType:e.embeddedWalletType,addressTypes:e.addressTypes}),!Array.isArray(e.providers)||e.providers.length===0)throw Q.error(ee.BROWSER_SDK,"Invalid providers array",{providers:e.providers}),new Error("providers must be a non-empty array of AuthProviderType");const t=e.providers.filter(o=>!tg.includes(o));if(t.length>0)throw Q.error(ee.BROWSER_SDK,"Invalid provider types",{invalidProviders:t,validProviders:tg}),new Error(`Invalid provider type(s): ${t.join(", ")}. Valid providers are: ${tg.join(", ")}`);if(e.providers.some(o=>o!=="injected")&&!e.appId)throw Q.error(ee.BROWSER_SDK,"appId required for embedded providers",{providers:e.providers}),new Error("appId is required when using embedded providers (google, apple, phantom, etc.)");const i=e.embeddedWalletType||VE;if(!["app-wallet","user-wallet"].includes(i))throw Q.error(ee.BROWSER_SDK,"Invalid embeddedWalletType",{embeddedWalletType:e.embeddedWalletType}),new Error(`Invalid embeddedWalletType: ${e.embeddedWalletType}. Must be "app-wallet" or "user-wallet".`);this.config=e,this.providerManager=new uB(e),this.discoverWallets()}discoverWallets(){return this.walletRegistry.discover(this.config.addressTypes).finally(()=>{this.isLoading=!1})}get solana(){const e=this.providerManager.getCurrentProvider();if(!e)throw new Error("No provider available. Call connect() first.");return e.solana}get ethereum(){const e=this.providerManager.getCurrentProvider();if(!e)throw new Error("No provider available. Call connect() first.");return e.ethereum}
38async connect(e){Q.info(ee.BROWSER_SDK,"Starting connection",e);try{const t=await this.providerManager.connect(e);return Q.info(ee.BROWSER_SDK,"Connection successful",{addressCount:t.addresses.length,status:t.status}),t}catch(t){throw Q.error(ee.BROWSER_SDK,"Connection failed",{error:t.message}),t}}async disconnect(){Q.info(ee.BROWSER_SDK,"Disconnecting");try{await this.providerManager.disconnect(),Q.info(ee.BROWSER_SDK,"Disconnection successful")}catch(e){throw Q.error(ee.BROWSER_SDK,"Disconnection failed",{error:e.message}),e}}isConnected(){return this.providerManager.isConnected()}getAddresses(){return this.providerManager.getAddresses()}getCurrentProviderInfo(){return this.providerManager.getCurrentProviderInfo()}getEnabledAddressTypes(){const e=this.providerManager.getCurrentProvider();return e?e.getEnabledAddressTypes():[]}on(e,t){Q.log(ee.BROWSER_SDK,"Adding event listener",{event:e}),this.providerManager.on(e,t)}off(e,t){Q.log(ee.BROWSER_SDK,"Removing event listener",{event:e}),this.providerManager.off(e,t)}async autoConnect(){Q.log(ee.BROWSER_SDK,"Attempting auto-connect with fallback strategy"),await this.discoverWallets(),await this.providerManager.autoConnect()?Q.info(ee.BROWSER_SDK,"Auto-connect successful",{providerType:this.getCurrentProviderInfo()?.type}):Q.log(ee.BROWSER_SDK,"Auto-connect failed for all providers")}enableDebug(){Q.enable(),Q.info(ee.BROWSER_SDK,"Debug logging enabled")}disableDebug(){Q.disable()}setDebugLevel(e){Q.setLevel(e),Q.info(ee.BROWSER_SDK,"Debug level updated",{level:e})}setDebugCallback(e){Q.setCallback(e),Q.info(ee.BROWSER_SDK,"Debug callback updated")}configureDebug(e){e.enabled!==void 0&&(e.enabled?this.enableDebug():this.disableDebug()),e.level!==void 0&&this.setDebugLevel(e.level),e.callback!==void 0&&this.setDebugCallback(e.callback)}async enableAutoConfirm(e){Q.info(ee.BROWSER_SDK,"Enabling auto-confirm",{params:e});const t=this.providerManager.getCurrentProvider();if(!t)throw new Error("No provider available. Call connect() first.");if(!("enableAutoConfirm"in t))throw new Error("Auto-confirm is only available for injected providers");try{const n=await t.enableAutoConfirm(e);return Q.info(ee.BROWSER_SDK,"Auto-confirm enabled successfully",{result:n}),n}catch(n){throw Q.error(ee.BROWSER_SDK,"Failed to enable auto-confirm",{error:n.message}),n}}async disableAutoConfirm(){Q.info(ee.BROWSER_SDK,"Disabling auto-confirm");const e=this.providerManager.getCurrentProvider();if(!e)throw new Error("No provider available. Call connect() first.");if(!("disableAutoConfirm"in e))throw new Error("Auto-confirm is only available for injected providers");try{await e.disableAutoConfirm(),Q.info(ee.BROWSER_SDK,"Auto-confirm disabled successfully")}catch(t){throw Q.error(ee.BROWSER_SDK,"Failed to disable auto-confirm",{error:t.message}),t}}async getAutoConfirmStatus(){Q.info(ee.BROWSER_SDK,"Getting auto-confirm status");const e=this.providerManager.getCurrentProvider();if(!e)throw new Error("No provider available. Call connect() first.");if(!("getAutoConfirmStatus"in e))throw new Error("Auto-confirm is only available for injected providers");try{const t=await e.getAutoConfirmStatus();return Q.info(ee.BROWSER_SDK,"Got auto-confirm status",{result:t}),t}catch(t){throw Q.error(ee.BROWSER_SDK,"Failed to get auto-confirm status",{error:t.message}),t}}async getSupportedAutoConfirmChains(){Q.info(ee.BROWSER_SDK,"Getting supported auto-confirm chains");const e=this.providerManager.getCurrentProvider();if(!e)throw new Error("No provider available. Call connect() first.");if(!("getSupportedAutoConfirmChains"in e))throw new Error("Auto-confirm is only available for injected providers");try{const t=await e.getSupportedAutoConfirmChains();return Q.info(ee.BROWSER_SDK,"Got supported auto-confirm chains",{result:t}),t}catch(t){throw Q.error(ee.BROWSER_SDK,"Failed to get supported auto-confirm chains",{error:t.message}),t}}getDiscoveredWallets(){Q.log(ee.BROWSER_SDK,"Getting discovered wallets");try{const e=this.walletRegistry.getByAddressTypes(this.config.addressTypes);return Q.log(ee.BROWSER_SDK,"Retrieved discovered wallets",{count:e.length,walletIds:e.map(t=>
38t.id)}),e}catch(e){return Q.error(ee.BROWSER_SDK,"Failed to get discovered wallets",{error:e.message}),[]}}},$c=(e,t)=>{const n=e.replace("#",""),i=parseInt(n.slice(0,2),16),o=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16);return`rgba(${i}, ${o}, ${l}, ${t})`},dB="#7C63E7",Wc={background:"#181818",text:"#FFFFFF",secondary:"#98979C",overlay:"rgba(0, 0, 0, 0.7)",borderRadius:"16px",error:"#F00000",success:"#1CC700",brand:dB};function G2(e){const t=e?.secondary||Wc.secondary;if(!t.startsWith("#"))throw new Error("Secondary color must be a hex color to derive auxiliary color.");return{...Wc,...e,aux:$c(t,.1),typography:{caption:{fontFamily:'"SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",fontStyle:"normal",fontWeight:"400",lineHeight:"17px",letterSpacing:"-0.14px"},captionBold:{fontFamily:'"SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"14px",fontStyle:"normal",fontWeight:"600",lineHeight:"17px",letterSpacing:"-0.14px"},label:{fontFamily:'"SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',fontSize:"12px",fontStyle:"normal",fontWeight:"400",lineHeight:"15px",letterSpacing:"-0.12px"}}}}var Y2=Me.createContext(void 0);function hB({children:e,theme:t}){const n=G2(t||Wc);return w.jsx(Y2.Provider,{value:{theme:n},children:e})}function Bi(){const e=Me.useContext(Y2);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e.theme}var pB={phantom:{viewBox:"0 0 20 20",path:w.jsx("path",{d:"M2.36655 18.3271C4.91871 18.3271 6.8367 16.1076 7.98131 14.3537C7.8421 14.7417 7.76476 15.1298 7.76476 15.5023C7.76476 16.5267 8.35253 17.2562 9.5126 17.2562C11.1058 17.2562 12.8072 15.8593 13.6889 14.3537C13.627 14.571 13.5961 14.7728 13.5961 14.959C13.5961 15.673 13.9982 16.1231 14.818 16.1231C17.4011 16.1231 19.9997 11.5444 19.9997 7.53987C19.9997 4.42011 18.422 1.67285 14.4622 1.67285C7.50181 1.67285 0 10.1785 0 15.673C0 17.8305 1.16007 18.3271 2.36655 18.3271ZM12.0648 7.19841C12.0648 6.42235 12.4979 5.8791 13.132 5.8791C13.7507 5.8791 14.1838 6.42235 14.1838 7.19841C14.1838 7.97447 13.7507 8.53323 13.132 8.53323C12.4979 8.53323 12.0648 7.97447 12.0648 7.19841ZM15.3748 7.19841C15.3748 6.42235 15.8079 5.8791 16.4421 5.8791C17.0608 5.8791 17.4939 6.42235 17.4939 7.19841C17.4939 7.97447 17.0608 8.53323 16.4421 8.53323C15.8079 8.53323 15.3748 7.97447 15.3748 7.19841Z",fill:"currentColor"})},google:{viewBox:"0 0 20 20",path:w.jsxs(w.Fragment,{children:[w.jsxs("mask",{id:"mask0_google",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:[w.jsx("path",{d:"M18.8 10.2084C18.8 9.55837 18.7417 8.93337 18.6333 8.33337H10V11.8834H14.9333C14.7167 13.025 14.0667 13.9917 13.0917 14.6417V16.95H16.0667C17.8 15.35 18.8 13 18.8 10.2084Z",fill:"#FFFFFE"}),w.jsx("path",{d:"M9.99998 19.1667C12.475 19.1667 14.55 18.35 16.0667 16.95L13.0917 14.6417C12.275 15.1917 11.2333 15.525 9.99998 15.525C7.61665 15.525 5.59165 13.9167 4.86665 11.75H1.81665V14.1167C3.32498 17.1083 6.41665 19.1667 9.99998 19.1667Z",fill:"#FFFFFE"}),w.jsx("path",{d:"M4.86659 11.7417C4.68325 11.1917 4.57492 10.6084 4.57492 10.0001C4.57492 9.39172 4.68325 8.80839 4.86659 8.25839V5.89172H1.81659C1.19159 7.12506 0.833252 8.51672 0.833252 10.0001C0.833252 11.4834 1.19159 12.8751 1.81659 14.1084L4.19159 12.2584L4.86659 11.7417Z",fill:"#FFFFFE"}),w.jsx("path",{d:"M9.99998 4.48337C11.35 4.48337 12.55 4.95004 13.5083 5.85004L16.1333 3.22504C14.5417 1.74171 12.475 0.833374 9.99998 0.833374C6.41665 0.833374 3.32498 2.89171 1.81665 5.89171L4.86665 8.25837C5.59165 6.09171 7.61665 4.48337 9.99998 4.48337Z",fill:"#FFFFFE"})]}),w.jsx("g",{mask:"url(#mask0_google)",children:w.jsx("rect",{width:"20",height:"20",fill:"currentColor"})})]})},apple:{viewBox:"0 0 20 20",path:w.jsxs("g",{clipPath:"url(#clip0_apple)",children:[w.jsx("path",{d:"M16.9876 6.91634C16.8812 6.99884 15.0039 8.05667 15.0039 10.4088C15.0039 13.1295 17.3927 14.092 17.4642 14.1158C17.4532 14.1745 17.0847 15.434 16.2047 16.7173C15.4201 17.8467 14.6006 18.9742 13.3539 18.9742C12.1072 18.9742 11.7864 18.25 10.3472 18.25C8.94473 18.25 8.44606 18.998 7.30573 18.998C6.1654 18.998 5.36973 17.953 4.4549 16.6697C3.39523 15.1627 2.53906 12.8215 2.53906 10.5995C2.53906 7.0355 4.8564 5.14534 7.13706 5.14534C8.3489 5.14534 9.35906 5.941 10.1199 5.941C10.8441 5.941 11.9734 5.09767 13.3521 5.09767C13.8746 5.09767 15.7519 5.14534 16.9876 6.91634ZM12.6976 3.58884C13.2677 2.91234 13.6711 1.97367 13.6711 1.035C13.6711 0.904837 13.6601 0.772837 13.6362 0.666504C12.7086 0.701337 11.6049 1.28434 10.9394 2.05617C10.4169 2.65017 9.92923 3.58884 9.92923 4.54034C9.92923 4.68334 9.95306 4.82634 9.96406 4.87217C10.0227 4.88317 10.1181 4.896 10.2134 4.896C11.0457 4.896 12.0926 4.33867 12.6976 3.58884Z",fill:"currentColor"}),w.jsx("defs",{children:w.jsx("clipPath",{id:"clip0_apple",children:w.jsx("rect",{width:"14.9233",he
38ight:"18.3333",fill:"white",transform:"translate(2.53906 0.833374)"})})})]})},wallet:{viewBox:"0 0 19 15",path:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 3.33333C0 1.49238 1.49238 0 3.33333 0H15C16.8409 0 18.3333 1.49238 18.3333 3.33333V11.6667C18.3333 13.5076 16.8409 15 15 15H3.33333C1.49238 15 0 13.5076 0 11.6667V3.33333ZM1.66667 8.33333V11.6667C1.66667 12.5871 2.41286 13.3333 3.33333 13.3333H15C15.9205 13.3333 16.6667 12.5871 16.6667 11.6667V8.33333H13.3333C12.9727 8.33333 12.6218 8.4503 12.3333 8.66667L11.1667 9.54167C9.98148 10.4306 8.35185 10.4306 7.16667 9.54167L6 8.66667C5.71151 8.4503 5.36062 8.33333 5 8.33333H1.66667ZM16.6667 6.66667C16.6667 5.74619 15.9205 5 15 5H3.33333C2.41286 5 1.66667 5.74619 1.66667 6.66667H5C5.72123 6.66667 6.42301 6.90059 7 7.33333L8.16667 8.20833C8.75926 8.65278 9.57407 8.65278 10.1667 8.20833L11.3333 7.33333C11.9103 6.90059 12.6121 6.66667 13.3333 6.66667H16.6667ZM16.6667 3.77927V3.33333C16.6667 2.41286 15.9205 1.66667 15 1.66667H3.33333C2.41286 1.66667 1.66667 2.41286 1.66667 3.33333V3.77927C2.15696 3.49566 2.72619 3.33333 3.33333 3.33333H15C15.6071 3.33333 16.1764 3.49566 16.6667 3.77927Z",fill:"currentColor"})},"chevron-right":{viewBox:"0 0 16 16",path:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.52876 2.86189C5.78911 2.60154 6.21122 2.60154 6.47157 2.86189L11.1382 7.52855C11.3986 7.7889 11.3986 8.21101 11.1382 8.47136L6.47157 13.138C6.21122 13.3984 5.78911 13.3984 5.52876 13.138C5.26841 12.8777 5.26841 12.4556 5.52876 12.1952L9.72402 7.99996L5.52876 3.8047C5.26841 3.54435 5.26841 3.12224 5.52876 2.86189Z",fill:"currentColor"})},"arrow-right":{viewBox:"0 0 16 16",path:w.jsx("path",{d:"M8 3L13 8L8 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})},x:{viewBox:"0 0 16 16",path:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.86201 2.86201C3.12236 2.60166 3.54447 2.60166 3.80482 2.86201L8.00008 7.05727L12.1953 2.86201C12.4557 2.60166 12.8778 2.60166 13.1382 2.86201C13.3985 3.12236 13.3985 3.54447 13.1382 3.80482L8.94289 8.00008L13.1382 12.1953C13.3985 12.4557 13.3985 12.8778 13.1382 13.1382C12.8778 13.3985 12.4557 13.3985 12.1953 13.1382L8.00008 8.94289L3.80482 13.1382C3.54447 13.3985 3.12236 13.3985 2.86201 13.1382C2.60166 12.8778 2.60166 12.4557 2.86201 12.1953L7.05727 8.00008L2.86201 3.80482C2.60166 3.54447 2.60166 3.12236 2.86201 2.86201Z",fill:"currentColor"})},tiktok:{viewBox:"0 0 20 20",path:w.jsx("path",{d:"M17.0156 7.54948C15.4792 7.54167 14.0156 6.94271 12.8958 5.89323V13.0573C12.8958 16.1042 10.401 18.599 7.35417 18.599C6.24219 18.599 5.21615 18.276 4.35417 17.7292C2.91927 16.8333 1.8776 15.3281 1.60938 13.5521C1.57813 13.3307 1.5625 13.1042 1.5625 12.8724C1.5625 9.82552 4.05729 7.33073 7.10417 7.33073C7.35156 7.33073 7.59375 7.35156 7.83073 7.38802V10.2708C7.59635 10.2161 7.35417 10.1849 7.10417 10.1849C5.63542 10.1849 4.44271 11.3776 4.44271 12.8464C4.44271 13.8333 4.97396 14.6875 5.76563 15.138C6.15104 15.3568 6.59375 15.4818 7.0651 15.4818C8.47917 15.4818 9.64323 14.3776 9.73438 13.0026C9.74219 12.9271 9.74479 5.3724 9.74479 5.3724H12.5469C12.6354 6.21615 12.9401 6.99479 13.4036 7.65885C14.0469 8.57552 14.9818 9.25521 16.0677 9.54948V7.54948H17.0156Z",fill:"currentColor"})},close:{viewBox:"0 0 24 24",path:w.jsx("path",{d:"M18 6L6 18M6 6L18 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})},solana:{viewBox:"0 0 9 9",path:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.54607 6.17667C1.57509 6.14475 1.61047 6.11923 1.64992 6.10177C1.68937 6.08429 1.73204 6.07526 1.77519 6.07523L8.84482 6.08101C8.87493 6.08107 8.90437 6.08988 8.92958 6.10636C8.95478 6.12283 8.97465 6.14627 8.98678 6.17382C8.99891 6.20137 9.00278 6.23185 8.99792 6.26156C8.99306 6.29127 8.97968 6.31894 8.95939 6.34119L7.45389 7.99886C7.42484 8.0308 7.38944 8.05634 7.34995 8.0738C7.31046 8.09128 7.26775 8.1003 7.22457 8.1003L0.155133 8.09452C0.125026 8.09446 0.0955847 8.08565 0.0703861 8.06917C0.0451864 8.0527 0.0253137 8.02927 0.0131815 8.00171C0.00104843 7.97416 -0.00282139 7.94368 0.00204072 7.91397C0.00690283 7.88426 0.0202886 7.85659 0.0405712 7.83434L1.54607 6.17667ZM8.95939 4.79673C8.97968 4.81898 8.99306 4.84664 8.99792 4.87635C9.00278 4.90606 8.99891 4.93655 8.98678 4.9641C8.97465 4.99166 8.95478 5.01509 8.92958 5.03156C8.90437 5.04804 8.87493 5.05684 8.84482 5.0569L1.77538 5.06269C1.73221 5.06269 1.6895 5.05366 1.65001 5.03619C1.61052 5.01873 1.57512 4.99319 1.54607 4.96124L0.0405712 3.30261C0.0202886 3.28036 0.00690283 3.2527 0.00204072 3.22298C-0.00282139 3.19327 0.00104843 3.16279 0.0131815 3.13524C0.0253137 3.10768 0.0451864 3.08425 0.0703861 3.06778C0.0955847 3.0513 0.125026 3.04249 0.155133 3.04243L7.22476 3.03665C7.26792 3.03668 7.31059 3.04571 7.35004 3.06319C7.38949 3.08065 7.42487 3.10617 7.45389 3.1381L8.95939 4.79673ZM1.54607 0.101447C1.57509 0.0695195 1.61047 0.0440047 1.64992 0.0265358C1.68937 0.00906688 1.73204 2.87448e-05 1.77519 0L8.84482 0.00578593C8.87493 0.00584714 8.90437 0.0146497 8.92958 0.0311243C8.95478 0.0475988 8.97465 0.0710365 8.98678 0.0985903C8.99891 0.126144 9.00278 0.156628 8.99792 0.18634C8.99306 0.21605 8.97968 0.243711 8.95939 0.26596L7.45389 1.92363C7.42484 1.95558 7.38944 1.98111 7.34995 1.99858C7.31046 2.01605 7.26775 2.02508 7.22457 2.02508L0.155133 2.01929C0.125026 2.01923 0.0955847 2.01043 0.0703861 1.99395C0.0451864 1.97748 0.0253137 1.95404 0.0131815 1.92648C0.00104843 1.89893 -0.00282139 1.86845 0.00204072 1.83874C0.
3800690283 1.80903 0.0202886 1.78136 0.0405712 1.75912L1.54607 0.101447Z",fill:"currentColor"})},ethereum:{viewBox:"0 0 7 11",path:w.jsxs(w.Fragment,{children:[w.jsx("path",{d:"M6.44558 5.3474L3.22279 7.25238L0 5.34739L3.22279 0L6.44558 5.3474Z",fill:"currentColor"}),w.jsx("path",{d:"M6.44755 5.95857L3.22282 10.5L0 5.95852L3.22282 7.8626L6.44755 5.95857Z",fill:"currentColor"})]})},bitcoin:{viewBox:"0 0 8 11",path:w.jsx("path",{d:"M6.11234 4.86004C6.66737 4.57405 7.01465 4.07038 6.93353 3.23129C6.82428 2.08459 5.84538 1.70007 4.60964 1.59057L4.6094 0H3.65195L3.65168 1.54874C3.39976 1.54874 3.14296 1.55375 2.88733 1.55893L2.88712 0.000211106L1.93052 0.000120638L1.93035 1.5903C1.72303 1.59458 1.51944 1.59865 1.32064 1.59865V1.59395L0 1.5934L0.000178762 2.62728C0.000178762 2.62728 0.707241 2.61383 0.695593 2.62689C1.08327 2.62716 1.20985 2.85486 1.24625 3.0514L1.24655 4.86339V7.40864C1.22948 7.53199 1.15765 7.72907 0.886584 7.72943C0.898918 7.74041 0.190097 7.72931 0.190097 7.72931L0.000178762 8.88543H1.24595C1.47809 8.8857 1.70617 8.88935 1.92993 8.89116L1.93076 10.4997L2.88712 10.5L2.88685 8.90829C3.14997 8.91371 3.40393 8.91607 3.65201 8.91573L3.65174 10.5H4.60916L4.6097 8.89411C6.21908 8.80062 7.34578 8.39056 7.48586 6.86191C7.59876 5.63118 7.02606 5.08182 6.11234 4.86004ZM2.91021 2.69707C3.4502 2.69707 5.14847 2.52315 5.14871 3.66406C5.14847 4.75787 3.45074 4.63009 2.91021 4.63009V2.69707ZM2.90979 7.73728L2.91021 5.60594C3.559 5.60576 5.59394 5.41712 5.59421 6.67113C5.59448 7.87371 3.559 7.73679 2.90979 7.73728Z",fill:"currentColor"})},sui:{viewBox:"0 0 8 9",path:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.63424 3.75325C6.00135 4.21419 6.22089 4.79712 6.22089 5.43123C6.22089 6.06533 5.99468 6.66605 5.61793 7.12957L5.58528 7.16963L5.57676 7.11882C5.56935 7.0758 5.56083 7.03205 5.55081 6.9883C5.36206 6.15914 4.74725 5.44829 3.73527 4.87239C3.05184 4.48452 2.66063 4.01802 2.55793 3.48738C2.49155 3.14438 2.54086 2.79988 2.63615 2.5047C2.73147 2.2099 2.87311 1.96257 2.99363 1.81387L3.38744 1.33254C3.45642 1.248 3.58584 1.248 3.65479 1.33254L5.63462 3.75325H5.63424ZM6.25684 3.2723L3.61809 0.0461671C3.56767 -0.015389 3.47346 -0.015389 3.42305 0.0461671L0.784654 3.2723L0.776128 3.28307C0.290724 3.88565 0 4.6514 0 5.485C0 7.42624 1.57636 9 3.52057 9C5.46479 9 7.04113 7.42624 7.04113 5.485C7.04113 4.6514 6.7504 3.88565 6.26501 3.28342L6.25647 3.27267L6.25684 3.2723ZM1.41616 3.74288L1.652 3.454L1.65905 3.5074C1.66461 3.54967 1.67166 3.59194 1.67981 3.63459C1.83259 4.43594 2.37807 5.10379 3.28992 5.62108C4.08273 6.07237 4.54439 6.59116 4.67714 7.15999C4.73277 7.39732 4.74241 7.63092 4.71831 7.83526L4.71683 7.84786L4.70533 7.85342C4.3475 8.02807 3.94515 8.12634 3.52019 8.12634C2.02913 8.12634 0.820254 6.9197 0.820254 5.43085C0.820254 4.79156 1.04312 4.20454 1.41542 3.74213L1.41616 3.74288Z",fill:"currentColor"})}};function Sr({type:e,size:t=20,color:n,style:i}){const o=pB[e],l={width:`${t}px`,height:`${t}px`,display:"inline-block",color:n||"currentColor",...i};return w.jsx("svg",{style:l,viewBox:o.viewBox,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.path})}function Pr({children:e,variant:t="caption",color:n,style:i}){const o=Bi(),l={...o.typography[t],color:n??o.text,margin:0,...i};return w.jsx("span",{style:l,children:e})}var Z2=({fullWidth:e,disabled:t,fontSize:n,fontWeight:i})=>{const o=Bi();return{height:"56px",padding:"12px 16px",width:e?"100%":"auto",border:"none",borderRadius:o.borderRadius,fontFamily:o.typography.captionBold.fontFamily,fontSize:n??o.typography.captionBold.fontSize,fontStyle:o.typography.captionBold.fontStyle,fontWeight:i??o.typography.captionBold.fontWeight,lineHeight:o.typography.captionBold.lineHeight,letterSpacing:o.typography.captionBold.letterSpacing,cursor:t?"not-allowed":"pointer",transition:"background-color 0.2s",gap:"8px"}};function qa({children:e,onClick:t,disabled:n=!1,variant:i="primary",fullWidth:o=!0,isLoading:l=!1}){const u=Bi(),[f,h]=Me.useState(!1),y=!n&&!l,_=Z2({fullWidth:o,disabled:n||l}),A=Me.useMemo(()=>y&&f?i==="primary"?$c(u.secondary,.15):$c(u.secondary,.1):i==="primary"?u.aux:"transparent",[y,f,i,u.aux,u.secondary]),D={..._,backgroundColor:A,color:u.text,border:i==="secondary"?`1px solid ${u.secondary}`:"none"},U=()=>{y&&h(!0)},L=()=>{h(!1)};return w.jsx("button",{style:D,onClick:t,disabled:n||l,onMouseEnter:U,onMouseLeave:L,children:l?"Connecting...":e})}function Ox({children:e="Continue with Phantom",onClick:t,disabled:n=!1,fullWidth:i=!0,isLoading:o=!1,testId:l="login-with-phantom-button"}){const u=Bi(),[f,h]=Me.useState(!1),y=!n&&!o,_=Z2({fullWidth:i,disabled:n||o}),A=Me.useMemo(()=>y&&f?$c(u.brand,.85):u.brand,[y,f,u.brand]),D={..._,backgroundColor:A,color:"#FFFFFF"},U=()=>{y&&h(!0)},L=()=>{h(!1)},k={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%"},j={display:"flex",alignItems:"center",gap:"8px"},M={display:"flex",alignItems:"center",gap:"8px"};return w.jsx("button",{style:D,onClick:t,disabled:n||o,onMouseEnter:U,onMouseLeave:L,"data-testid":l,children:w.jsxs("span",{style:k,children:[w.jsxs("span",{style:j,children:[w.jsx(Sr,{type:"phantom",size:20}),w.jsx(Pr,{variant:"captionBold",color:"#FFFFFF",children:o?"Connecting...":e})]}),w.jsx("span",{style:M,children:w.jsx(Sr,{type:"chevron-right",size:16,color:"#FFFFFF"})})]})})}function Ac({type:e,size:t=20,color:n,style:i,background:o}){const l=Bi(),u={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",borderRadius:"8px",backgroundColor:o??l.aux};return w.jsx("div",{style:{...u,...i},children:w.jsx(Sr,{type:e,size:t,color:n})})}function gB({appIcon:e,appName:t,isVisible:n,onClose:i,isMobile:o=!1,children:l}){const u=Bi(),f=Me.useRef(null),[h,y]=Me.useState("auto");if(Me.useEffect(()=>{if(!n||!f.current)return;const L=()=>
38{if(f.current){const j=f.current.scrollHeight;y(j)}};L();const k=new ResizeObserver(()=>{L()});return f.current&&k.observe(f.current),()=>{k.disconnect()}},[n,l]),!n)return null;const _={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:u.overlay,display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999,padding:o?"16px":"0"},A={backgroundColor:u.background,borderRadius:u.borderRadius,maxWidth:o?"100%":"350px",width:"100%",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.3)",position:"relative",overflow:"hidden",transition:"max-width 0.1s ease-in-out"},D={height:typeof h=="number"?`${h}px`:"auto",transition:"height 0.15s ease-in-out",overflow:"hidden"},U={transition:"opacity 0.15s ease-in-out"};return w.jsx("div",{style:_,onClick:i,children:w.jsx("div",{style:A,onClick:L=>L.stopPropagation(),children:w.jsx("div",{style:D,children:w.jsx("div",{ref:f,style:U,children:l})})})})}function Hg({goBack:e=!1,onGoBack:t,title:n,onClose:i,hideCloseButton:o=!1}){const l=Bi(),u={position:"relative",display:"flex",justifyContent:"center",alignItems:"center",padding:"28px 32px 0 32px",height:"32px"},f={fontFeatureSettings:'"liga" off, "clig" off'},h={position:"absolute",left:"32px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:"8px",background:"none",border:"none",width:"32px",height:"32px"},y={position:"absolute",right:"32px",background:"none",border:"none",color:l.secondary,fontSize:"24px",cursor:"pointer",padding:"4px 8px",lineHeight:1,transition:"color 0.2s",width:"auto"};return w.jsxs("div",{style:u,children:[e&&t&&w.jsx("button",{style:h,onClick:t,children:w.jsx(Sr,{type:"chevron-right",size:16,color:l.secondary,style:{transform:"rotate(180deg)"}})}),w.jsx("div",{style:f,children:w.jsx(Pr,{variant:"caption",color:l.secondary,children:n})}),i&&!o&&w.jsx("button",{style:y,onClick:i,children:w.jsx(Sr,{type:"x",size:16,color:l.secondary})})]})}var J2=Me.createContext(void 0);function Ds(){const e=Me.useContext(J2);if(!e)throw new Error("usePhantom must be used within a PhantomProvider");return e}var X2=Me.createContext(void 0);function mB(){const e=Me.useContext(X2);if(!e)throw new Error("useModal must be used within a ModalProvider");return{open:e.openModal,close:e.closeModal,isOpened:e.isModalOpen}}function yB(){const[e,t]=Me.useState(!0),[n,i]=Me.useState(!1);return Me.useEffect(()=>{let o=!0;return(async()=>{try{t(!0);const u=await q2(3e3);o&&i(u)}catch{o&&i(!1)}finally{o&&t(!1)}})(),()=>{o=!1}},[]),{isLoading:e,isInstalled:n}}function wB(){const[e,t]=Me.useState(!0),[n,i]=Me.useState(!1);return Me.useEffect(()=>{let o=!0;return(async()=>{try{t(!0);const u=await $2(3e3);o&&i(u)}catch{o&&i(!1)}finally{o&&t(!1)}})(),()=>{o=!1}},[]),{isLoading:e,isAvailable:n}}function bB(){const{sdk:e,isConnecting:t,isLoading:n,errors:i}=Ds();return{connect:Me.useCallback(async l=>{if(!e)throw new Error("SDK not initialized");try{return await e.connect(l)}catch(u){throw console.error("Error connecting to Phantom:",u),u}},[e]),isConnecting:t,isLoading:n,error:i.connect}}function vB(){const{sdk:e}=Ds(),[t,n]=Me.useState([]),[i,o]=Me.useState(!0),[l,u]=Me.useState(null),f=Me.useCallback(async()=>{if(!e){n([]),u(null),o(!1);return}try{o(!0),u(null),await e.discoverWallets();const h=e.getDiscoveredWallets();n(h)}catch(h){const y=h instanceof Error?h:new Error("Failed to fetch discovered wallets");u(y),n([])}finally{o(!1)}},[e]);return Me.useEffect(()=>{f()},[f]),{wallets:t,isLoading:i,error:l,refetch:f}}var jf=({children:e})=>{const t=Bi();return w.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",backgroundColor:t.aux,color:t.text,padding:"2px"},children:e})};function Nx({addressType:e,size:t=8}){const n=Bi(),i=e.toLowerCase();return i.includes("solana")?w.jsx(jf,{children:w.jsx(Sr,{type:"solana",size:t,color:n.text})}):i.includes("ethereum")||i.includes("evm")?w.jsx(jf,{children:w.jsx(Sr,{type:"ethereum",size:t,color:n.text})}):i.includes("bitcoin")?w.jsx(jf,{children:w.jsx(Sr,{type:"bitcoin",size:t,color:n.text})}):i.includes("sui")?w.jsx(jf,{children:w.jsx(Sr,{type:"sui",size:t,color:n.text})}):w.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:"4px",backgroundColor:n.aux,color:n.text,fontSize:"6px",fontWeight:"bold",lineHeight:"1",padding:"2px"},title:e,children:e.charAt(0).toUpperCase()})}function xB({appIcon:e,appName:t="App Name",onClose:n,hideCloseButton:i=!1}){const o=Bi(),{isLoading:l,allowedProviders:u}=Ds(),f=bB(),h=yB(),y=wB(),_=Me.useMemo(()=>L1(),[]),{wallets:A}=vB(),[D,U]=Me.useState(!1),[L,k]=Me.useState(null),[j,M]=Me.useState(null),[W,K]=Me.useState(!1),[se,re]=Me.useState(null),te=f.isConnecting||D,pe=f.error?f.error.message:L,we=!(u.length===1&&u.includes("injected")),Z=!(u.length===1&&u.includes("injected"))&&A.length>2,ae=Z?[]:A,ce=Me.useCallback(async(He,At)=>{try{U(!0),k(null),M(He),re(At||null),await f.connect({provider:He,walletId:At}),n()}catch{const Rt=A.find(qn=>qn.id===At)?.name||PA(He);k(`Failed to connect to ${Rt}`)}finally{U(!1),M(null),re(null)}},[f,A,n]),N=Me.useCallback(async He=>{await ce("injected",He.id)},[ce]),g=Me.useCallback(async()=>{try{U(!0),k(null),M("deeplink"),await f.connect({provider:"deeplink"}),n()}catch(He){const At=He instanceof Error?He.message:"Failed to open deeplink";
38k(At)}finally{U(!1),M(null)}},[f,n]),v={width:"56px",height:"56px",borderRadius:"50%",display:"block",objectFit:"cover",marginBottom:"12px"},E={transition:"opacity 0.15s ease-in-out, transform 0.15s ease-in-out",display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",padding:"0 32px"},B={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",maxHeight:"480px",overflowY:"auto",padding:"0 32px 32px 32px",transition:"opacity 0.15s ease-in-out, transform 0.15s ease-in-out"},z={display:"flex",alignItems:"center",width:"100%",margin:"12px 0",...o.typography.caption,color:o.secondary,textTransform:"uppercase"},G={flex:1,height:"1px",backgroundColor:$c(o.secondary,.1)},J={padding:"0 12px"},T={backgroundColor:"rgba(220, 53, 69, 0.1)",color:"#ff6b6b",border:"1px solid rgba(220, 53, 69, 0.3)",borderRadius:o.borderRadius,boxSizing:"border-box",padding:"12px",width:"100%",fontSize:"14px"},m={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px",gap:"12px"},b={width:"40px",height:"40px",border:`3px solid ${o.secondary}`,borderTop:`3px solid ${o.brand}`,borderRadius:"50%",animation:"spin 1s linear infinite"},O={width:"32px",height:"32px",borderRadius:"8px",objectFit:"cover"},P={display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px",width:"100%"},ne={display:"flex",alignItems:"center",gap:"8px",flex:1},ue={display:"flex",flexDirection:"column",gap:"4px",alignItems:"flex-start"},Te={display:"flex",alignItems:"center",gap:"4px"},ve={display:"flex",alignItems:"center",gap:"8px",color:o.secondary},Xe={display:"flex",padding:"16px",justifyContent:"center",alignItems:"center",gap:"4px",borderTop:"1px solid rgba(152, 151, 156, 0.10)",...o.typography.caption,color:o.secondary},mt={display:"flex",flexDirection:"column",justifyContent:"space-between",gap:"24px"};return w.jsxs("div",{style:mt,children:[w.jsx("style",{children:` 39 @keyframes spin { 40 0% { transform: rotate(0deg); } 41 100% { transform: rotate(360deg); } 42 } 43 `}),l||f.isConnecting?w.jsxs("div",{style:m,children:[w.jsx("div",{style:b}),w.jsx(Pr,{variant:"label",color:o.secondary,children:"Loading..."})]}):W?w.jsxs(w.Fragment,{children:[w.jsx(Hg,{goBack:!0,onGoBack:()=>{k(null),K(!1)},title:"Other Wallets",onClose:n,hideCloseButton:i}),w.jsxs("div",{style:B,children:[pe&&w.jsx("div",{style:T,children:pe}),A.map(He=>w.jsx(qa,{onClick:()=>N(He),disabled:te,isLoading:te&&j==="injected"&&se===He.id,fullWidth:!0,children:w.jsxs("span",{style:P,children:[w.jsxs("span",{style:ne,children:[He.id==="phantom"?w.jsx(Ac,{type:"phantom",size:20,background:"#aba0f2",color:"white"}):He.icon?w.jsx("img",{src:He.icon,alt:He.name,style:O}):w.jsx(Ac,{type:"wallet",size:20,background:o.aux,color:o.text}),w.jsx("span",{style:ue,children:w.jsx(Pr,{variant:"captionBold",children:He.name})})]}),w.jsxs("span",{style:ve,children:[He.addressTypes&&He.addressTypes.length>0&&w.jsx("span",{style:Te,children:He.addressTypes.map(At=>w.jsx("span",{children:w.jsx(Nx,{addressType:At,size:8})},`${He.id}-chain-${At}`))}),w.jsx(Sr,{type:"chevron-right",size:16,color:o.secondary})]})]})},He.id))]})]}):w.jsxs(w.Fragment,{children:[w.jsx(Hg,{title:"Login or Sign Up",onClose:n,hideCloseButton:i}),w.jsxs("div",{style:E,children:[e&&w.jsx("img",{src:e,alt:t,style:v}),pe&&w.jsx("div",{style:T,children:pe}),_&&!h.isInstalled&&u.includes("deeplink")&&w.jsx(Ox,{testId:"deeplink-button",onClick:g,disabled:te,isLoading:te&&j==="deeplink",fullWidth:!0,children:D&&j==="deeplink"?"Opening Phantom...":"Open in Phantom App"}),!_&&u.includes("phantom")&&y.isAvailable&&w.jsx(Ox,{testId:"login-with-phantom-button",onClick:()=>ce("phantom"),disabled:te,isLoading:te&&j==="phantom"}),u.includes("google")&&!(_&&h.isInstalled)&&w.jsx(qa,{onClick:()=>ce("google"),disabled:te,isLoading:te&&j==="google",fullWidth:!0,children:w.jsxs("span",{style:P,children:[w.jsxs("span",{style:ne,children:[w.jsx(Sr,{type:"google",size:20}),w.jsx(Pr,{variant:"captionBold",children:"Continue with Google"})]}),w.jsx("span",{style:ve,children:w.jsx(Sr,{type:"chevron-right",size:16,color:o.secondary})})]})}),u.includes("apple")&&w.jsx(qa,{onClick:()=>ce("apple"),disabled:te,isLoading:te&&j==="apple",fullWidth:!0,children:w.jsxs("span",{style:P,children:[w.jsxs("span",{style:ne,children:[w.jsx(Sr,{type:"apple",size:20}),w.jsx(Pr,{variant:"captionBold",children:"Continue with Apple"})]}),w.jsx("span",{style:ve,children:w.jsx(Sr,{type:"chevron-right",size:16,color:o.secondary})})]})}),u.includes("injected")&&(h.isInstalled||A.length>0)&&w.jsxs(w.Fragment,{children:[we&&w.jsxs("div",{style:z,children:[w.jsx("div",{style:G}),w.jsx("span",{style:J,children:"OR"}),w.jsx("div",{style:G})]}),ae.map(He=>w.jsx(qa,{onClick:()=>N(He),disabled:te,isLoading:te&&j==="injected"&&se===He.id,fullWidth:!0,children:w.jsxs("span",{style:P,children:[w.jsxs("span",{style:ne,children:[He.id==="phantom"?w.jsx(Ac,{type:"phantom",size:20,background:"#aba0f2",color:"white"}
43):He.icon?w.jsx("img",{src:He.icon,alt:He.name,style:O}):w.jsx(Ac,{type:"wallet",size:10,background:o.aux,color:o.text}),w.jsx("span",{style:ue,children:w.jsx(Pr,{variant:"captionBold",children:He.name})})]}),w.jsxs("span",{style:ve,children:[He.addressTypes&&He.addressTypes.length>0&&w.jsx("span",{style:Te,children:He.addressTypes.map(At=>w.jsx("span",{children:w.jsx(Nx,{addressType:At,size:8})},`${He.id}-chain-${At}`))}),w.jsx(Sr,{type:"chevron-right",size:16,color:o.secondary})]})]})},He.id)),Z&&w.jsx(qa,{onClick:()=>K(!0),disabled:te,fullWidth:!0,children:w.jsxs("span",{style:P,children:[w.jsxs("span",{style:ne,children:[w.jsx(Ac,{type:"wallet",size:20,background:o.aux,color:o.text}),w.jsx(Pr,{variant:"captionBold",children:"Other Wallets"})]}),w.jsx("span",{style:ve,children:w.jsx(Sr,{type:"chevron-right",size:16,color:o.secondary})})]})})]})]}),w.jsxs("div",{style:Xe,children:[w.jsx(Pr,{variant:"label",color:o.secondary,children:"Powered by"}),w.jsx(Sr,{type:"phantom",size:16}),w.jsx(Pr,{variant:"label",color:o.secondary,children:"Phantom"})]})]})]})}function Q2(){const{sdk:e}=Ds(),[t,n]=Me.useState(!1),[i,o]=Me.useState(null);return{disconnect:Me.useCallback(async()=>{if(!e)throw new Error("SDK not initialized");n(!0),o(null);try{await e.disconnect()}catch(u){const f=u instanceof Error?u:new Error(String(u));throw o(f),u}finally{n(!1)}},[e]),isDisconnecting:t,error:i}}function EB({onClose:e,hideCloseButton:t=!1}){const n=Bi(),{addresses:i}=Ds(),{disconnect:o}=Q2(),[l,u]=Me.useState(!1),[f,h]=Me.useState(null);Me.useEffect(()=>{h(null)},[]);const y=async()=>{try{u(!0),h(null),await o(),e()}catch(M){const W=M instanceof Error?M:new Error(String(M));h(W)}finally{u(!1)}},_={display:"flex",flexDirection:"column",gap:"16px",width:"100%",minWidth:0,boxSizing:"border-box"},A={display:"flex",flexDirection:"column",gap:"8px",width:"100%",minWidth:0,boxSizing:"border-box"},D={fontFamily:"monospace",wordBreak:"break-all",overflowWrap:"break-word",minWidth:0},U={padding:"12px",backgroundColor:"rgba(220, 53, 69, 0.1)",borderRadius:n.borderRadius,border:"1px solid rgba(220, 53, 69, 0.3)",width:"100%",boxSizing:"border-box",minWidth:0},L={display:"flex",flexDirection:"column",gap:"24px"},k={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",padding:"0 32px 24px 32px",boxSizing:"border-box",width:"100%",minWidth:0},j={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",padding:"0 32px 24px 32px",boxSizing:"border-box",width:"100%",minWidth:0};return w.jsxs("div",{style:L,children:[w.jsx(Hg,{title:"Wallet",onClose:e,hideCloseButton:t}),w.jsxs("div",{style:k,children:[f&&w.jsx("div",{style:U,children:w.jsx(Pr,{variant:"caption",color:n.error,children:"Failed to disconnect"})}),i&&i.length>0&&w.jsx("div",{style:_,children:i.map((M,W)=>w.jsxs("div",{style:A,children:[w.jsx(Pr,{variant:"label",color:n.secondary,style:{textTransform:"uppercase"},children:M.addressType}),w.jsx("div",{style:D,children:w.jsx(Pr,{variant:"caption",children:M.address})})]},W))})]}),w.jsx("div",{style:j,children:w.jsx(qa,{onClick:y,disabled:l,isLoading:l,fullWidth:!0,children:w.jsx(Pr,{variant:"captionBold",children:l?"Disconnecting...":"Disconnect"})})})]})}function SB({onClose:e}){const t=Bi();return w.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:32},children:[w.jsx(Pr,{variant:"caption",color:t.secondary,children:"You've reached the maximum daily limit allowed to spend by this application."}),w.jsx(qa,{fullWidth:!0,onClick:e,children:w.jsx(Pr,{variant:"captionBold",children:"Close"})})]})}function AB({children:e,appIcon:t,appName:n}){const{isConnected:i,errors:o,clearError:l}=Ds(),[u,f]=Me.useState(!1),h=Me.useMemo(()=>L1(),[]),y=Me.useCallback(()=>{f(!0)},[]),_=Me.useCallback(()=>{f(!1),l("spendingLimit")},[l]),A=!!o.spendingLimit,D=Me.useMemo(()=>({isModalOpen:u,openModal:y,closeModal:_}),[u,y,_]);return w.jsxs(X2.Provider,{value:D,children:[e,w.jsx(gB,{isVisible:u||A,onClose:_,appIcon:t,appName:n,isMobile:h,children:A?w.jsx(SB,{onClose:_}):i?w.jsx(EB,{onClose:_}):w.jsx(xB,{appIcon:t,appName:n,onClose:_})})]})}function _B({children:e,config:t,debugConfig:n,theme:i,appIcon:o,appName:l}){const u=Me.useMemo(()=>t,[t]),f=Me.useMemo(()=>G2(i||Wc),[i]),[h,y]=Me.useState(null),[_,A]=Me.useState(!1),[D,U]=Me.useState(!1),[L,k]=Me.useState(!1),[j,M]=Me.useState(!0),[W,K]=Me.useState({}),[se,re]=Me.useState([]),[te,pe]=Me.useState(null);Me.useEffect(()=>{A(!0)},[]),Me.useEffect(()=>{if(!_)return;const Z=new fB(u);y(Z)},[_,u]),Me.useEffect(()=>{if(!h)return;const Z=()=>{k(!0),K(v=>({...v,connect:void 0}))},ae=async v=>{try{U(!0),k(!1);const E=await h.getAddresses();re(E),pe(v??{addresses:E})}catch(E){console.error("Error connecting:",E);try{await h.disconnect()}catch(B){console.error("Error disconnecting after connect failure:",B),U(!1),k(!1),re([]),pe(null),K(z=>({...z,connect:E instanceof Error?E:new Error("Failed to retrieve addresses after connect")}))}}},ce=v=>{k(!1),U(!1);const E=v?.source==="auto-connect"&&(v?.error==="No valid session found"||v?.error==="No trusted connections available");K(E?B=>({...B,connect:void 0}):B=>({...B,connect:new Error(v?.error||"Connection failed")})),re([])},N=()=>{U(!1),k(!1),K({}),re([]),pe(null)},g=()=>{K(v=>({...v,spendingLimit:!0}))};return h.on("connect_start",Z),h.on("connect",ae),h.on("connect_error",ce),h.on("disconnect",N),h.on("spending_limit_reached",g),()=>
43{h.off("connect_start",Z),h.off("connect",ae),h.off("connect_error",ce),h.off("disconnect",N),h.off("spending_limit_reached",g)}},[h]),Me.useEffect(()=>{!n||!h||h.configureDebug(n)},[h,n]),Me.useEffect(()=>{if(!_||!h)return;(async()=>{try{await h.autoConnect()}catch(ae){console.error("Auto-connect error:",ae)}M(!1)})()},[h,_]);const we=Me.useCallback(Z=>{K(ae=>{const ce={...ae};return delete ce[Z],ce})},[]),X=Me.useMemo(()=>({sdk:h,isConnected:D,isConnecting:L,isLoading:j,errors:W,addresses:se,isClient:_,user:te,theme:f,allowedProviders:u.providers,clearError:we}),[h,D,L,j,W,se,_,te,f,u.providers,we]);return w.jsx(hB,{theme:f,children:w.jsx(J2.Provider,{value:X,children:w.jsx(AB,{appIcon:o,appName:l,children:e})})})}function IB(){const{addresses:e,isConnected:t}=Ds();return t?e:null}function TB(){const{sdk:e,isClient:t,isLoading:n}=Ds();if(!t||!e||n)return{solana:{},isAvailable:!1};if(!e.getEnabledAddressTypes().includes(Ct.solana))return{solana:{},isAvailable:!1};try{return{solana:e.solana,isAvailable:!0}}catch{return{solana:{},isAvailable:!1}}}const RB="modulepreload",CB=function(e){return"/"+e},kx={},Dn=function(t,n,i){let o=Promise.resolve();if(n&&n.length>0){let h=function(y){return Promise.all(y.map(_=>Promise.resolve(_).then(A=>({status:"fulfilled",value:A}),A=>({status:"rejected",reason:A}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=u?.nonce||u?.getAttribute("nonce");o=h(n.map(y=>{if(y=CB(y),y in kx)return;kx[y]=!0;const _=y.endsWith(".css"),A=_?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${A}`))return;const D=document.createElement("link");if(D.rel=_?"stylesheet":RB,_||(D.as="script"),D.crossOrigin="",D.href=y,f&&D.setAttribute("nonce",f),document.head.appendChild(D),_)return new Promise((U,L)=>{D.addEventListener("load",U),D.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return o.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};var MB=function(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)},BB=function(e,t,n,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,n):o?o.value=n:t.set(e,n),n},Zf;let _c;const Kd=new Set;function DB(e){kc=void 0,Kd.add(e)}function OB(e){kc=void 0,Kd.delete(e)}const rl={};
43function e6(){if(_c||(_c=Object.freeze({register:Ux,get:NB,on:kB}),typeof window>"u"))return _c;const e=Object.freeze({register:Ux});try{window.addEventListener("wallet-standard:register-wallet",({detail:t})=>t(e))}catch(t){console.error(`wallet-standard:register-wallet event listener could not be added 44`,t)}try{window.dispatchEvent(new UB(e))}catch(t){console.error(`wallet-standard:app-ready event could not be dispatched 45`,t)}return _c}function Ux(...e){return e=e.filter(t=>!Kd.has(t)),e.length?(e.forEach(t=>DB(t)),rl.register?.forEach(t=>jx(()=>t(...e))),function(){e.forEach(n=>OB(n)),rl.unregister?.forEach(n=>jx(()=>n(...e)))}):()=>{}}let kc;function NB(){return kc||(kc=[...Kd]),kc}function kB(e,t){return rl[e]?.push(t)||(rl[e]=[t]),function(){rl[e]=rl[e]?.filter(i=>t!==i)}}function jx(e){try{e()}catch(t){console.error(t)}}class UB extends Event{get detail(){return MB(this,Zf,"f")}get type(){return"wallet-standard:app-ready"}constructor(t){super("wallet-standard:app-ready",{bubbles:!1,cancelable:!1,composed:!1}),Zf.set(this,void 0),BB(this,Zf,t,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}Zf=new WeakMap;function bN(e,t){const n=e.trim();if(!/^\d*\.?\d*$/.test(n)||n===""||n===".")return null;const[i,o=""]=n.split(".");if(o.length>t)return null;const l=BigInt((i||"0")+o.padEnd(t,"0"));return l>0n?l.toString():null}function jB(e,t,n=6){let i;try{i=BigInt(e)}catch{return"0"}const o=i<0n;o&&(i=-i);const l=10n**BigInt(t),u=i/l;let f=(i%l).toString().padStart(t,"0").slice(0,Math.min(n,t));f=f.replace(/0+$/,"");const h=u.toLocaleString("en-US");return`${o?"-":""}${h}${f?"."+f:""}`}function Gc(e){return e<=0?"0%":e<1?"<0.01%":`${(e/100).toFixed(2).replace(/\.?0+$/,"")}%`}function vN(e){return e.length?e.join(" â "):"Jupiter"}const bd=e=>typeof e=="number"&&Number.isFinite(e)&&e>0;function xN(e){const t=e&&typeof e=="object"?e:{},n=bd(t.public_swap_fee_bps)?t.public_swap_fee_bps:null,i=t.public_swap_discount_bps,o=n!==null&&bd(i)&&i<n?i:null;return{feeBps:n,holderBps:o}}function EN(e){return e.discounted?`Flex fee (${Gc(e.bps)}, $FLEX holder)`:`Flex fee (${Gc(e.bps)})`}function SN(e,t){return e==="input"?`${t} (included)`:`â ${t} (from output)`}function AN(e,t){if(!bd(e))return"Flex fee plus network fee, shown before you confirm.";const n=bd(t)?` $FLEX holders pay ${Gc(t)}.`:"";return`${Gc(e)} Flex fee plus network fee, shown before you confirm.${n}`}function _N(e,t){return["Flex public swap: use my $FLEX holder rate.",`Wallet: ${e}`,`Time: ${t}`].join(` 46`)}const LB=new Set(["wallet_changed","expired","not_built","unreadable"]);function IN(e){return typeof e=="string"&&LB.has(e)}function zB(e){let t="",n;if(typeof e=="string")t=e;else if(e&&typeof e=="object"){const i=e;t=typeof i.message=="string"?i.message:typeof i.error?.message=="string"?i.error.message:"",n=i.code??i.error?.code}return t=t.trim(),{rejected:n===4001||/reject|denied|cancel|declin/i.test(t),message:t}}function PB(e){if(!e||typeof e!="object")return null;const t=e,n=t.code??t.error?.code;return typeof n=="number"?n:null}const HB=new Set([-32002,-32603,4100,4900]);function TN(e){const{rejected:t,message:n}=zB(e),i=n.toLowerCase();if(t)return!1;const o=PB(e);return o===-32601||o===4200?!0:o!==null&&HB.has(o)||/resource not available|already pending/.test(i)?!1:/not supported|unsupported|not implemented|not available|signandsend/.test(i)}const VB="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function t6(e){let t=0n;for(const i of e)t=t*256n+BigInt(i);let n="";for(;t>0n;)n=VB[Number(t%58n)]+n,t/=58n;for(const i of e){if(i!==0)break;n="1"+n}return n}const vd="solana:mainnet",n6="standard:connect",FB="standard:disconnect",r6="solana:signMessage",i6="solana:signTransaction",KB="solana:signAndSendTransaction";function ol(e,t){return e.features[t]}function qB(e){return e.chains.includes(vd)&&[n6,r6,i6].every(t=>t in e.features)}function s6(){return typeof window>"u"?[]:e6().get().filter(qB)}function a6(e){if(typeof window>"u")return()=>{};const t=e6(),n=[t.on("register",e),t.on("unregister",e)];return()=>n.forEach(i=>
46i())}function Vg(e){const t=e.toLowerCase();return s6().find(n=>n.name.toLowerCase()===t)??null}function Lx(e){return e instanceof yl?e.serialize():new Uint8Array(e.serialize({requireAllSignatures:!1,verifySignatures:!1}))}function $B(e,t){return e instanceof yl?yl.deserialize(t):ml.from(t)}function WB(e,t){const n=ol(e,i6),i=ol(e,r6),o=ol(e,KB),l={isConnected:!0,async signTransaction(u){if(!n)throw new Error(`${e.name} cannot sign transactions.`);const[f]=await n.signTransaction({account:t,transaction:Lx(u),chain:vd});if(!f?.signedTransaction)throw new Error(`${e.name} returned no transaction.`);return $B(u,f.signedTransaction)},async signMessage(u){if(!i)throw new Error(`${e.name} cannot sign messages.`);const f=typeof u=="string"?new TextEncoder().encode(u):u,[h]=await i.signMessage({account:t,message:f});if(!h?.signature)throw new Error(`${e.name} returned no signature.`);return{signature:h.signature,publicKey:t.address}}};return o&&(l.signAndSendTransaction=async u=>{const[f]=await o.signAndSendTransaction({account:t,transaction:Lx(u),chain:vd});if(!f?.signature)throw new Error(`${e.name} returned no signature.`);return{signature:t6(f.signature)}}),l}async function o6(e,t={}){const n=Vg(e);if(!n){if(t.silent)return null;throw new Error(`${e} isn't available.`)}const i=ol(n,n6),{accounts:o}=await i.connect(t.silent?{silent:!0}:void 0),l=(o.length?o:n.accounts).find(u=>u.chains.includes(vd));if(!l){if(t.silent)return null;throw new Error(`${n.name} didn't share a Solana account.`)}return{wallet:n,address:l.address,provider:WB(n,l),disconnect:async()=>{try{await ol(n,FB)?.disconnect()}catch{}}}}function GB(e,t){return Vg(e)?Promise.resolve(!0):new Promise(n=>{const i=a6(()=>{Vg(e)&&(clearTimeout(o),i(),n(!0))}),o=setTimeout(()=>{i(),n(!1)},t)})}function YB(e,t){const n=ol(e,"standard:events");return n?n.on("change",({accounts:i})=>{i&&t(i.map(o=>o.address))}):()=>{}}const Fg="zkard:chunk-reload-once",zx=typeof window<"u"?window.location.hash:"";let l6=!1;function ZB(){zx&&!l6&&!window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search+zx)}function c6(){ZB(),window.location.reload()}function Kg(e){const t=e instanceof Error?e.message:String(e);return/Failed to fetch dynamically imported module/i.test(t)||/error loading dynamically imported module/i.test(t)||/Importing a module script failed/i.test(t)||/Unable to preload/i.test(t)||/ChunkLoadError/i.test(t)}function u6(){let e=!1;try{e=sessionStorage.getItem(Fg)==="1"}catch{}if(e||typeof window>"u"||!window.location)return!1;try{sessionStorage.setItem(Fg,"1")}catch{}return c6(),!0}async function z1(e){try{const t=await e();l6=!0;try{sessionStorage.removeItem(Fg)}catch{}return t}catch(t){if(!Kg(t))throw t;if(u6())return new Promise(()=>{});throw t}}const qd={solflare:{name:"Solflare",site:"https://solflare.com"},metamask:{name:"MetaMask",site:"https://metamask.io"},jupiter:{name:"Jupiter",site:"https://jup.ag"}};function f6(e,t){const n=qd[e].name.toLowerCase();return t.find(i=>i.toLowerCase()===n)??t.find(i=>i.toLowerCase().startsWith(n+" "))??null}function JB(e,t,n){const i=f6(e,t);if(i)return{kind:"connect",walletName:i};const{name:o,site:l}=qd[e];if(!n.mobile)return{kind:"install",note:`${o} isn't installed.`,url:l};switch(e){case"solflare":return{kind:"open",url:`https://solflare.com/ul/v1/browse/${encodeURIComponent(n.href)}?ref=${encodeURIComponent(n.origin)}`};case"metamask":return{kind:"open",url:`https://metamask.app.link/dapp/${n.host}${n.pathname}`};case"jupiter":return{kind:"copy",note:`Open ${n.host} in the Jupiter app's browser.`,link:n.origin}}}function XB(e){const t=Object.keys(qd).map(n=>f6(n,e));return e.filter(n=>!/^phantom\b/i.test(n)&&!t.includes(n))}function P1(){if(typeof window>"u")return!1;try{if(window.matchMedia?.("(pointer: coarse)").matches)return!0}catch{}return/Android|iPhone|iPad|iPod|Mobile/i.test(navigator.userAgent)}function QB(){const{href:e,origin:t,host:n,pathname:i}=window.location;return{mobile:P1(),href:e,origin:t,host:n,pathname:i}}function eD(e){return e==="phantom"?"phantom":"solana"}function tD(e,t,n,i,o){return{wallet_type:eD(e),pubkey:t,signature:n,message:i,nonce:o}}function nD(e){const t=/^wallet:[^:]+:([1-9A-HJ-NP-Za-km-z]{32,44})@zkard$/i.exec(e??"");return t?t[1]:null}
46class Jf extends Error{constructor(){super("Cancelled."),this.name="PairingCancelled"}}let $d=null,Uc=null;const qg=new Set;function Bc(e){$d=e,qg.forEach(t=>t())}function d6(){return $d}function rD(e){return qg.add(e),()=>{qg.delete(e)}}function wa(){Uc?.abort(),Uc=null,$d&&Bc(null)}async function h6({inline:e=!1}={}){wa();const t=new AbortController;Uc=t;const n=P1();Bc({inline:e,mobile:n,uri:null,qr:null});try{const i=await z1(()=>Dn(()=>import("./walletConnect-B-KVLXv3.js"),__vite__mapDeps([0,1,2])));if(t.signal.aborted)throw new Jf;const o=await i.connectWalletConnect(l=>{t.signal.aborted||(Bc({inline:e,mobile:n,uri:l,qr:null}),!n&&i.qrDataUrl(l).then(u=>{!t.signal.aborted&&$d?.uri===l&&Bc({inline:e,mobile:n,uri:l,qr:u})}).catch(()=>{}))},t.signal);if(t.signal.aborted)throw o.disconnect().catch(()=>{}),new Jf;return o}catch(i){throw t.signal.aborted?new Jf:i}finally{Uc===t&&(Uc=null,Bc(null))}}const $g="flex:external-wallet",iD=3e3;function sD(e){try{e?localStorage.setItem($g,JSON.stringify(e)):localStorage.removeItem($g)}catch{}}function aD(){try{const e=JSON.parse(localStorage.getItem($g)||"null");if(e&&(e.kind==="standard"||e.kind==="walletconnect")&&typeof e.name=="string")return{kind:e.kind,name:e.name}}catch{}return null}let mi=null,Wd=aD(),Yc=null,Wg=null,Ci=0;const Gg=new Set;function Gd(){Gg.forEach(e=>e())}function p6(e){Wd=e,sD(e)}function Zc(){return mi}function Yg(){return Wd}function Px(e){return Gg.add(e),()=>{Gg.delete(e)}}function oD(e){return`${e.slice(0,4)}â¦${e.slice(-4)}`}function g6(e){return!Yc||Yc.toLowerCase()===e.toLowerCase()}function m6(e){return new Error(`${e} is on another account. Switch to ${oD(Yc??"")} and try again.`)}function Yd(){Wg?.(),Wg=null,mi=null}function Zg(e){mi?.name!==e.name&&e.disconnect().catch(()=>{})}function Zd(e){if(!g6(e.address))return!1;const t=mi;return Yd(),mi=e,p6({kind:e.kind,name:e.name}),Gd(),t&&(t.kind!==e.kind||t.name!==e.name)&&t.disconnect().catch(()=>{}),!0}function lD(e){return Ci++,Zd(e)}async function Xf(){Ci++;const e=mi;Yd(),p6(null),Gd(),e&&await e.disconnect().catch(()=>{})}function cD(e){mi?.address===e&&(Ci++,Yd(),Gd())}function RN(){return Yc}function uD(e){if(Yc=e,!mi||g6(mi.address))return;const t=mi;Ci++,Yd(),Gd(),t.disconnect().catch(()=>{})}function y6(e){const t={kind:"standard",name:e.wallet.name,address:e.address,provider:e.provider,disconnect:e.disconnect};return Zd(t)?(Wg=YB(e.wallet,n=>{n.includes(e.address)||cD(e.address)}),t):null}async function w6(e){const t=++Ci,n=await o6(e);if(!n||t!==Ci)return null;const i=y6(n);if(!i)throw m6(n.wallet.name);return i}async function fD(){if(mi)return mi.address;const e=Wd;if(!e)return null;if(e.kind==="standard")return(await w6(e.name))?.address??null;const t=++Ci,n=await h6();if(t!==Ci)return Zg(n),null;if(!Zd(n))throw n.disconnect().catch(()=>{}),m6(n.name);return n.address}let Lf=null;function dD(){return Lf||(Lf=(async()=>{const e=Wd;if(!e||mi)return;const t=Ci;try{if(e.kind==="standard"){if(!await GB(e.name,iD)||t!==Ci)return;const n=await o6(e.name,{silent:!0});n&&(t!==Ci||!y6(n))&&Zg({name:n.wallet.name,disconnect:n.disconnect})}else{const i=await(await Dn(()=>import("./walletConnect-B-KVLXv3.js"),__vite__mapDeps([0,1,2]))).restoreWalletConnect();i&&(t!==Ci||!Zd(i))&&Zg(i)}}catch{}})(),Lf)}let Jg=null;function ng(e){Jg=e}function CN(){const e=Zc();if(e)return e.provider;if(Yg())return null;if(Jg?.isConnected)return Jg;const t=window;return t.phantom?.solana??t.solana??null}function b6(){const e=Me.useSyncExternalStore(Px,Zc),t=Me.useSyncExternalStore(Px,Yg);Me.useEffect(()=>{dD()},[]);const{isConnected:n}=Ds(),i=IB(),{disconnect:o}=Q2(),{open:l}=mB(),{solana:u,isAvailable:f}=TB(),h=Me.useMemo(()=>!i||i.length===0?null:i.find(k=>k.addressType===Ct.solana)?.address??i[0]?.address??null,[i]);Me.useEffect(()=>(ng(n&&f?u:null),()=>ng(null)),[n,f,u]);const y=Me.useCallback(async()=>{const L=Zc();return L?L.address:Yg()?fD():n&&h?h:(l(),null)},[l,n,h]),_=Me.useCallback(async()=>{await Xf();try{await o()}catch{}ng(null)},[o]),A=Me.useCallback(async L=>u.signMessage(L),[u]),D=Me.useCallback(async L=>
46{if(e?.provider.signMessage)return e.provider.signMessage(L);if(t)throw new Error(`Connect ${t.name} first.`);return A(L)},[A,e,t]),U={isConnected:!!n&&!!h,address:h,signMessage:A};return e?{isConnected:!0,phantomAddress:e.address,connect:y,disconnect:_,signMessage:D,walletName:e.name,isExternal:!0,phantom:U}:t?{isConnected:!1,phantomAddress:null,connect:y,disconnect:_,signMessage:D,walletName:t.name,isExternal:!0,phantom:U}:{isConnected:U.isConnected,phantomAddress:h,connect:y,disconnect:_,signMessage:D,walletName:"Phantom",isExternal:!1,phantom:U}}const hD="Too many requests â wait a few seconds and try again.",pD="Too many sign-in attempts. Wait a moment and try again.";function gD(e,t){return e===429?hD:(t.trim().startsWith("<")?"":t.trim()).slice(0,200)||`HTTP ${e}`}function Hx(e){return e===429?pD:`Sign-in failed (HTTP ${e})`}function xd(e,t,n=gD){try{const i=JSON.parse(t);if(i!==null&&typeof i=="object")return{json:!0,body:i}}catch{}return{json:!1,body:{success:!1,error:n(e,t)}}}const v6=[2e3,4e3,6e3];function mD(e,t){return e===401?{verdict:"invalid"}:e>=200&&e<300&&t.success&&t.data?{verdict:"valid",user:t.data}:{verdict:"unknown"}}async function yD(e,t,n=v6,i=()=>!1){for(let o=0;;o++){const{status:l,body:u}=await e(),f=mD(l,u);if(f.verdict!=="unknown"||o>=n.length||i())return f;if(await t(n[o]),i())return{verdict:"unknown"}}}const ll=1e4,wD=(1n<<64n)-1n,Vx=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<=ll;function H1(e){if(!e||typeof e!="object")return null;const t=e,n=t.fee_bps!==void 0?t.fee_bps:t.fee_base_bps;if(!Vx(n))return null;const i=t.fee_discount_bps,o=t.discount_active===!0&&Vx(i)&&i<=n;return{feeBps:n,discountActive:o,discountBps:o?i:null}}function MN(e,t){return t&&e.discountActive&&e.discountBps!=null?e.discountBps:e.feeBps}function x6(e){if(!Number.isInteger(e)||e<0)throw new RangeError(`Invalid fee rate: ${e}`);return BigInt(Math.min(e,ll))}function E6(e){if(e<0n)throw new RangeError("Amount must not be negative");return e}function V1(e,t){return E6(e)*x6(t)/BigInt(ll)}function bD(e,t){return e-V1(e,t)}function vD(e,t){const n=x6(t);if(E6(e),n>=BigInt(ll))return null;const i=BigInt(ll)-n;let o=(e*BigInt(ll)+i-1n)/i;for(;o>0n&&bD(o-1n,t)>=e;)o-=1n;return o>wD?null:o}function xD(e,t){if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`Not a whole lamport amount: ${e}`);return Number(V1(BigInt(e),t))}const ED=168*3600;function Fx(e,t=Number.MAX_SAFE_INTEGER){if(!Array.isArray(e))return[];const n=e.filter(i=>typeof i=="number"&&Number.isSafeInteger(i)&&i>0&&i<=t);return[...new Set(n)].sort((i,o)=>i-o)}function BN(e){return{delayWindowsSecs:Fx(e?.payout_delay_windows_secs,ED),standardSizesLamports:Fx(e?.standard_withdrawal_sizes_lamports)}}const F1=890880;function DN(e){const t=e?.min_sol_payout_lamports;return typeof t=="number"&&Number.isSafeInteger(t)&&t>0?t:F1}function SD(e){const t=(n,i)=>`${n} ${i}${n===1?"":"s"}`;return e%86400===0&&e>2*86400?t(e/86400,"day"):e%3600===0?t(e/3600,"hour"):e%60===0?t(e/60,"minute"):t(e,"second")}function ON(e){return e>0?`Random within ${SD(e)}`:"Now"}function K1(e,t){if(!Number.isSafeInteger(e)||e<0||!Number.isInteger(t)||t<0)return 1/0;const n=vD(BigInt(e),t);return n===null?1/0:Number(n)}const q1=1e3,S6=1e6;function A6(e,t=F1){return Math.max(S6,K1(t,e))}function AD(e,t=S6){return e>q1&&e<t}function NN(e,t,n,i=A6(n)){return!Number.isSafeInteger(t)||t<=0?[]:e.filter(o=>{const l=K1(o,n);if(!(l<=t))return!1;const u=t-l;return u>0&&u<=q1?n>0:!AD(u,i)})}const _D="Leaves too little to withdraw later. Pick another amount or withdraw all.";function kN(e,t,n,i,o){const l=y=>({claimLamports:0,feeLamports:0,netLamports:0,remainderLamports:0,error:y});if(!Number.isSafeInteger(e)||e<=0)return l("Nothing to claim.");if(!Number.isSafeInteger(t)||t<=0)return l("Enter an amount.");if(!Number.isInteger(n)||n<0)return l("Fee not loaded.");let u=Math.min(t,e);e-u<=q1&&(u=e);const f=xD(u,n),h={claimLamports:u,feeLamports:f,netLamports:u-f,remainderLamports:e-u};if(h.netLamports<i){const y=K1(i,n);return{...h,error:Number.isFinite(y)?`At least ${ID(y)}.`:"Too small to send."}}return h.remainderLamports>0&&h.remainderLamports<o?{...h,error:_D}:{...h,error:null}}const rg=e=>typeof e=="number"&&Number.isInteger(e)&&e>=0&&e<1e4;function UN(e,t,n,i=F1){const o=e.fee_prepaid===!0,l=rg(e.fee_bps)?e.fee_bps:o?0:t;if(l===null||!rg(l))return null;const u=typeof e.amount_lamports=="number"&&Number.isSafeInteger(e.amount_lamports)?e.amount_lamports:Math.round(e.amount_sol*1e9);if(!Number.isSafeInteger(u)||u<0)return null;const f=e.discount_fee_bps,h=!o&&n.qualifying&&!n.baseOnly&&rg(f)&&f<l,y=typeof e.min_payout_lamports=="number"&&e.min_payout_lamports>0?e.min_payout_lamports:i,_=typeof e.min_remainder_lamports=="number"&&e.min_remainder_lamports>0?e.min_remainder_lamports:A6(l,y);return{totalLamports:u,baseBps:l,bps:h?f:l,discounted:h,prepaid:o,minPayoutLamports:y,minRemainderLamports:_}}function jN(e){return/Review it and confirm again|FEE_CHANGED|\$FLEX|discount proof/i.test(e)}function ID(e){return`${e/1e9} SOL`}const TD=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function _6(e,t=new Date){const n=new Date(e*1e3),i=`${String(n.getHours()).padStart(2,"0")}
46:${String(n.getMinutes()).padStart(2,"0")}`;return n.toDateString()===t.toDateString()?i:`${TD[n.getDay()]} ${i}`}const RD=120,CD=600;function I6(e,t=new Date){return!!e&&e*1e3-t.getTime()<=RD*1e3}function T6(e,t=new Date){return!!e&&t.getTime()-e*1e3>CD*1e3}function MD(e,t=new Date){return T6(e,t)?"Checking the payoutâ¦":I6(e,t)?"Sending now. This can take a minute.":e?`Scheduled. Arrives by ~${_6(e,t)}.`:"Scheduled."}function LN(e,t=new Date){return T6(e,t)?"Checkingâ¦":I6(e,t)?"Sending now":e?`Scheduled · by ${_6(e,t)}`:"Scheduled"}function R6(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);if(typeof e=="string"&&e){const t=Date.parse(e);if(Number.isFinite(t))return Math.floor(t/1e3)}return null}const BD="The payout failed. Keep your note and contact support.";class DD extends Error{constructor(){super(BD),this.name="PayoutFailedError"}}function zN(e,t){const n=e[t];if(e.status==="failed"||typeof n=="string"&&n.startsWith("FAILED"))throw new DD;if(e.status==="scheduled")return{state:"scheduled",payoutId:typeof e.payout_id=="string"&&e.payout_id?e.payout_id:null,notBefore:R6(e.not_before)};if(typeof n=="string"&&n)return{state:"sent",signature:n};throw new Error("The server did not confirm the payout. Check its status before trying again.")}const OD=["scheduled","executing","paid","uncertain","failed"];function ND(e){const t=e,n=t&&t.success===!0?t.data:null;return!n||typeof n!="object"||typeof n.status!="string"||!OD.includes(n.status)?null:{state:n.status,notBefore:R6(n.not_before),signature:typeof n.signature=="string"&&n.signature?n.signature:null}}function PN(e){return e==="paid"||e==="uncertain"||e==="failed"}function HN(e,t=new Date){switch(e.state){case"scheduled":return MD(e.notBefore,t);case"executing":return"Sending nowâ¦";case"paid":return"Sent.";case"uncertain":return"On hold: the payout may already be sent. Contact support. Do not retry.";default:return"The payout failed. Contact support."}}const C6=5e3,kD=890880,UD=2039280,jD=["pay_relay","pay_token","pay_zk","receive_relay","receive_zk"],LD=e=>typeof e=="string"&&jD.includes(e),Qf=e=>e==="pay_zk"||e==="receive_zk",$1=e=>e.startsWith("pay_");function zD(e){return Qf(e)?[1,3]:[2,3]}const ig="Your SOL is safe. Finish or return it from Receive.",PD="The fee changed. Check it and confirm again.",HD="The balance changed. Check it and confirm again.",VD="You have an unfinished payment to this address. Finish or return it in Receive.",VN="Token payments use Stealth relay.",FN="Price moved too much. Your SOL is safe: finish or return it from Receive.",KN="Couldn't back up the key. Try again.",qN="Flex didn't send the swap, so nothing was sent. Try again.";function $N(e,t){return t>=2?"stop":e==="wallet_changed"||e==="not_built"?"wallet_sends":e==="expired"?"rebuild":"stop"}const FD=["quoted","sent","settled","queued","paid","expired","held","payout_failed","payout_uncertain"],KD=["basis_lamports","fee_lamports","source_lamports","pool_lamports","payout_lamports","network_lamports","rent_lamports","reserve_lamports","reserve_min_lamports","total_lamports","net_lamports","min_lamports","funding_swap_network_max_lamports","funding_swap_temp_rent_lamports"];function qD(e){if(typeof e=="number")return Number.isSafeInteger(e)&&e>=0?e:null;if(typeof e=="string"&&/^\d{1,16}$/.test(e)){const t=Number(e);return Number.isSafeInteger(t)?t:null}return null}function Kx(e){return typeof e=="string"&&/^\d{1,20}$/.test(e)?BigInt(e).toString():typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?String(e):null}const sg=e=>typeof e=="number"&&Number.isInteger(e)&&e>0&&e<1e4?e:null,zf=(...e)=>e.reduce((t,n)=>t+BigInt(n),0n);function W1(e){if(!e||typeof e!="object")return null;const t=e;if(!LD(t.kind))return null;const n=t.kind,i={};for(const k of KD){const j=qD(t[k]);if(j===null)return null;i[k]=j}const o=sg(t.fee_bps);if(o===null)return null;const l=t.fee_base_bps===void 0?o:sg(t.fee_base_bps);if(l===null)return null;const u=t.fee_discount_bps==null?null:sg(t.fee_discount_bps);if(t.fee_discount_bps!=null&&u===null)return null;const f=t.discounted===!0;if(f?u!==o:o!==l)return null;const h=t.hops,[y,_]=zD(n);if(typeof h!="number"||!Number.isInteger(h)||h<y||h>_)return null;let A=null,D=null;const U=t.ata_missing===!0;if(n==="pay_token"&&(A=Kx(t.in_amount),D=Kx(t.max_in),A===null||D===null||BigInt(A)<=0n||BigInt(A)>BigInt(D)||BigInt(A)!==BigInt(i.basis_lamports))||i.fee_lamports<=0||BigInt(i.fee_lamports)!==V1(BigInt(i.basis_lamports),o))return null;const L=BigInt(C6);if($1(n)){if(BigInt(n==="pay_token"?A:i.net_lamports)+zf(i.fee_lamports,i.network_lamports,i.rent_lamports,i.reserve_lamports)!==BigInt(i.total_lamports)||BigInt(i.source_lamports)+L!==BigInt(i.total_lamports))return null}else if(zf(i.net_lamports,i.fee_lamports,i.network_lamports)!==BigInt(i.basis_lamports)||i.source_lamports!==i.basis_lamports)return null;switch(n){case"pay_relay":if(i.net_lamports!==i.basis_lamports||i.pool_lamports!==i.fee_lamports||zf(i.basis_lamports,i.fee_lamports)+BigInt(h)*L!==BigInt(i.source_lamports)||i.rent_lamports!==0||i.reserve_lamports!==0)return null;break;case"pay_token":if(i.pool_lamports!==i.fee_lamports||i.rent_lamports!==(U?UD:0)||i.reserve_lamports<i.reserve_min_lamports)return null;break;case"pay_zk":if(i.net_lamports!==i.basis_lamports||BigInt(i.pool_lamports)+L!==BigInt(i.source_lamports)||BigInt(i.pool_lamports)<=zf(i.basis_lamports,i.fee_lamports)||i.rent_lamports!==0||i.reserve_lamports!==0)return null;break;
46case"receive_relay":if(i.pool_lamports!==i.fee_lamports)return null;break;case"receive_zk":if(BigInt(i.pool_lamports)+L!==BigInt(i.basis_lamports))return null;break}return n!=="pay_token"&&i.net_lamports<i.min_lamports?null:{kind:n,fee_bps:o,fee_base_bps:l,fee_discount_bps:u,discount_active:t.discount_active===!0,discounted:f,hops:h,...i,in_amount:A,max_in:D,ata_missing:n==="pay_token"?U:!1}}function $D(e){const t=W1(e);if(!t)return null;const n=e;if(typeof n.id!="string"||!n.id||typeof n.pool_address!="string"||!/^[1-9A-HJ-NP-Za-km-z]{32,44}$/.test(n.pool_address))return null;const i=typeof n.expires_at=="string"?n.expires_at:typeof n.expires_at=="number"?String(n.expires_at):"";return{...t,id:n.id,pool_address:n.pool_address,expires_at:i}}function WD(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return Math.floor(e);if(typeof e=="string"&&e){const t=Date.parse(e);if(Number.isFinite(t))return Math.floor(t/1e3)}return null}const ag=e=>typeof e=="string"&&e?e:null;function M6(e){if(!e||typeof e!="object")return null;const t=e;return typeof t.status!="string"||!FD.includes(t.status)?null:{status:t.status,last_outcome:ag(t.last_outcome),fund_sig:ag(t.fund_sig),payout_id:ag(t.payout_id),not_before:WD(t.not_before)}}function WN(e,t){return e.kind!==t.kind||e.hops!==t.hops||e.fee_lamports>t.fee_lamports?!1:$1(e.kind)?e.total_lamports<=t.total_lamports:e.net_lamports>=t.net_lamports}function GN(e,t){const n=$1(e);switch(t.status){case"sent":return{next:"wait"};case"settled":return Qf(e)?{next:"wait"}:{next:"done"};case"queued":case"paid":case"payout_failed":case"payout_uncertain":return Qf(e)?{next:"done"}:{next:"stop",message:ig};case"quoted":return t.last_outcome==="failed"?{next:"stop",message:n?ig:"The transfer failed. Nothing was charged; claim again."}:{next:"resign"};case"expired":return{next:"expired"};case"held":return Qf(e)?{next:"stop",message:"This payment is on hold for a check. Contact support."}:{next:"stop",message:ig}}}function YN(e){return!!e&&/expired before it was sent/i.test(e)}function GD(e){return`${jB(BigInt(e),9,9)} SOL`}function YD(e){return`Flex fee (${Gc(e.fee_bps)}${e.discounted?", $FLEX":""})`}function ZN(e,t={}){const n=e.kind==="pay_token",i=[n?{key:"recipient",label:"Recipient gets",lamports:Number(e.in_amount),approx:"â",display:t.tokenText,part:!0}:{key:"recipient",label:"Recipient gets",lamports:e.net_lamports,part:!0},{key:"fee",label:YD(e),lamports:e.fee_lamports,part:!0},{key:"network",label:"Network",lamports:e.network_lamports,...n?{approx:"up to"}:{},part:!0}];e.rent_lamports>0&&i.push({key:"rent",label:"Token account",lamports:e.rent_lamports,note:"Opens the recipient's account.",part:!0}),e.reserve_lamports>0&&i.push({key:"reserve",label:"Returned to you",lamports:e.reserve_lamports,approx:"â",note:`At least ${GD(e.reserve_min_lamports)}, a few minutes after.`,part:!0});const o=t.funding;return i.push({key:"total",label:"You pay",lamports:e.total_lamports,...o?.amountText?{display:`â ${o.amountText} ${o.symbol}`}:{},part:!1}),o&&(i.push({key:"swap_network",label:"Swap network",lamports:e.funding_swap_network_max_lamports,approx:"up to",part:!1}),i.push({key:"swap_rent",label:"Temporary account (returned)",lamports:e.funding_swap_temp_rent_lamports,part:!1})),i}function JN(e=Math.random){return e()<.5?2:3}function XN(e=Math.random){return Math.min(Math.floor(e()*3),2)+1}const ZD=e=>crypto.getRandomValues(new Uint8Array(e));function QN(e=ZD){const t=e(32);if(t.length!==32)throw new Error("Bad random source");return Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function B6(e,t){if(!Number.isSafeInteger(e)||!Number.isInteger(t)||t<1)return null;const n=e-t*C6;return n>=kD?n:null}const qx=e=>{const t=Date.parse(e.updatedAt??e.createdAt??"");return Number.isFinite(t)?t:0};function ek(e,t){const n=new Map;for(const i of[...e,...t]){if(!i||typeof i.pubkey!="string"||!i.pubkey)continue;const o=n.get(i.pubkey);if(!o){n.set(i.pubkey,i);continue}const l=qx(o),u=qx(i);n.set(i.pubkey,u>l?i:u<l?o:{...i,...o})}return[...n.values()]}function tk(e,t){const n=i=>t instanceof Map?t.get(i):t[i];return e.filter(i=>n(i.pubkey)===0).map(i=>i.pubkey)}const JD=36e5;function nk(e,t,n){return e.filter(i=>t.get(i.pubkey)===0&&n-(Date.parse(i.createdAt)||n)>JD).map(i=>i.pubkey)}function rk(e,t){return e.kind==="own"?"own":e.first?e.feePaid?"own":t==="sent"?"checking":"not_sent":"unfinished"}function ik(e,t){for(let n=Math.min(3,Math.max(1,Math.floor(t)));n>=1;n--)if(B6(e,n)!==null)return n;return null}function sk(e,t){return e.opKind==="pay_zk"?!1:e.token?!0:B6(t,Math.max(1,e.hopsLeft??2))!==null}
46class ak extends Error{constructor(t){super(PD),this.plan=t,this.name="FeeChangedError"}plan}class ok extends Error{constructor(){super(HD),this.name="BalanceChangedError"}}class lk extends Error{constructor(t){super(VD),this.entry=t,this.name="UnfinishedPaymentError"}entry}class ck extends Error{constructor(t="This payment expired before it was sent."){super(t),this.name="ExpiredOpError"}}const G1="/api/v1";let jc=localStorage.getItem("flexprivacy_token");function Dc(e){jc=e,e?localStorage.setItem("flexprivacy_token",e):localStorage.removeItem("flexprivacy_token")}function XD(){return jc}async function $t(e,t="GET",n=null,{timeoutMs:i}={}){const o=jc,l={method:t,headers:{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}}};n&&(l.body=JSON.stringify(n));const u=i?new AbortController:null,f=u?setTimeout(()=>u.abort(),i):null;u&&(l.signal=u.signal);try{const h=await fetch(`${G1}${e}`,l),{json:y,body:_}=xd(h.status,await h.text());return h.status===401&&jc===o&&(jc=null,localStorage.removeItem("flexprivacy_token")),{ok:h.ok&&y,status:h.status,data:_,json:y}}catch(h){return{ok:!1,status:0,data:{success:!1,error:u?.signal.aborted?"The server took too long to answer":h instanceof Error?h.message:"Network error"},json:!1}}finally{f&&clearTimeout(f)}}let Ic=null;function Rl(e={}){if(Ic&&!e.fresh)return Ic;const t=fetch("/api/v1/config").then(n=>{if(!n.ok)throw new Error(`HTTP ${n.status}`);return n.json()}).then(n=>{if(!n||typeof n!="object")throw new Error("Bad config");return n}).catch(()=>(Ic===t&&(Ic=null),{}));return Ic=t,t}async function uk(e){return $t(`/offramp/wallet-balance?address=${encodeURIComponent(e)}`)}async function fk(e){const{ok:t,data:n}=await $t("/offramp/send-transaction","POST",{transaction:e});if(t&&n.success&&n.data?.signature)return n.data.signature;throw new Error(n.error||"Failed to broadcast transaction")}async function dk(){const{ok:e,data:t}=await $t("/offramp/blockhash","GET");if(e&&t.success&&t.data?.blockhash)return{blockhash:t.data.blockhash,lastValidBlockHeight:t.data.lastValidBlockHeight??0};throw new Error(t.error||"Failed to fetch blockhash")}async function hk(e,t=!1,n){return $t("/offramp/init-send","POST",{amount_sol:e,privacy_delay:t,...n?{sender_pubkey:n}:{}})}async function pk(){return O6("/vault/receive-keys")}async function gk(e,t){return N6("/vault/receive-keys",e,t)}async function mk(e,t,n){return $t("/offramp/confirm-send","POST",{claim_token:e,tx_signature:t,...n?{zk_commitment:n}:{}})}async function yk(e){return $t(`/offramp/claim-preview?token=${encodeURIComponent(e)}`,"GET")}function Y1(e){const t={};return e?.delay_window_secs&&(t.delay_window_secs=e.delay_window_secs),e?.standard_size_lamports&&(t.standard_size_lamports=e.standard_size_lamports),t}async function wk(e,t,n,i,o,l){return $t("/offramp/claim","POST",{claim_token:e,destination_address:t,...n!==void 0?{amount_sol:n}:{},...i??{},...Y1(o),...rO(l)})}async function bk(e){return $t(`/defi/swap/claim-link/${encodeURIComponent(e)}`)}async function vk(e){return $t(`/defi/swap/shield-claim/${encodeURIComponent(e)}`)}async function xk(e){return $t(`/defi/swap/status/${encodeURIComponent(e)}`)}async function Ek(e){const{delay_window_secs:t,...n}=e;return $t("/defi/swap/claim-spl","POST",{...n,...Y1({delay_window_secs:t})})}async function Sk(e){return QD(e)}async function Ak(e){return $t("/offramp/withdraw-multihop","POST",e)}async function _k(e){return $t("/offramp/deposit-denom-spl","POST",e)}async function Ik(e){const{delay_window_secs:t,...n}=e;return $t("/offramp/denom-withdraw-spl","POST",{...n,...Y1({delay_window_secs:t})})}async function Tk(e){try{const t=await fetch(`${G1}/offramp/payout-status?id=${encodeURIComponent(e)}`,{credentials:"omit"});return ND(JSON.parse(await t.text()))}catch{return null}}async function Rk(e){return $t(`/streams/${encodeURIComponent(e)}/status`)}async function QD(e){return $t(`/offramp/merkle-path?commitment=${encodeURIComponent(e)}`)}async function Ck(e,t,n){const i=new URLSearchParams({input_mint:e,output_mint:t,amount:String(n)});return $t(`/pay/quote?${i}`)}async function Mk(e){return $t("/pay/swap-tx","POST",e)}async function Bk(){const{ok:e,data:t}=await $t("/pay/sol-price"),n=e&&t.success?t.data?.usd:void 0;return typeof n=="number"&&n>0?n:null}async function Z1(e,t="GET",n=null){try{const i=await fetch(`${G1}${e}`,{method:t,credentials:"omit",headers:n?{"Content-Type":"application/json"}:void 0,body:n?JSON.stringify(n):void 0}),{json:o,body:l}=xd(i.status,await i.text()),u=o&&typeof l.success!="boolean"?{success:i.ok,data:l}:l;return{ok:i.ok&&o,status:i.status,data:u}}catch(i){return{ok:!1,status:0,data:{success:!1,error:i instanceof Error?i.message:"Network error"}}}}async function eO(e){return Z1("/flex/register-commitment","POST",e)}async function Dk(){return Z1("/flex/status?commitment=0")}async function tO(){return Z1("/flex/discount-tree")}async function nO(e){return $t("/flex/reserve-discount","POST",e)}function rO(e){const t={};return e?.expected_fee_bps!==void 0&&(t.expected_fee_bps=e.expected_fee_bps),e?.discount&&(t.discount_proof=e.discount.discount_proof,t.discount_signals=e.discount.discount_signals),t}async function Ok(e){return $t("/offramp/withdraw-solana","POST",e)}async function Nk(){return $t("/offramp/balance")}async function kk(e,t){return $t("/offramp/deposit","POST",e,{timeoutMs:t})}async function Uk(e){return $t(`/offramp/verify-solana-tx?sig=${encodeURIComponent(e)}`)}
46async function jk(e){return $t(`/offramp/deposit-status?tx_hash=${encodeURIComponent(e)}`)}async function Lk(){return $t("/offramp/deposit-intent","POST",{})}async function zk(e){return $t("/offramp/vault/quote","POST",e)}async function Pk(){return $t("/offramp/vault/refunds")}async function Hk(e){return $t("/offramp/vault/refund","POST",e)}const D6="Couldn't read the fee. Try again.";async function Vk(e){const t=new URLSearchParams({kind:e.kind,hops:String(e.hops)});e.amount_lamports!==void 0&&t.set("amount_lamports",String(e.amount_lamports)),e.token_mint&&t.set("token_mint",e.token_mint),e.token_amount&&t.set("token_amount",e.token_amount),e.recipient&&t.set("recipient",e.recipient),e.discounted&&t.set("discounted","true");const{ok:n,data:i}=await $t(`/pay/fee-preview?${t}`);if(n&&i.success){const o=W1(i.data);return o?{plan:o}:{error:D6}}return{error:i.error||i.message||"Couldn't get the fee. Try again."}}async function Fk(e){const{ok:t,status:n,data:i}=await $t("/pay/ops","POST",e);if(t&&i.success){const o=$D(i.data);return o?{op:o}:{error:D6}}if(n===409){const o=W1(i.data);if(o)return{feeChanged:o}}return{error:i.error||i.message||"Couldn't start. Nothing was charged; try again."}}async function Kk(e,t){const{ok:n,status:i,data:o}=await $t(`/pay/ops/${encodeURIComponent(e)}/fund`,"POST",{signed_tx:t});if(n&&o.success){const u=M6(o.data);return u?{state:u}:{error:"No clear answer from the server.",unknown:!0}}if(i===409)return{balanceChanged:!0};const l=i===0||i>=500;return{error:o.error||o.message||"No answer from the server.",...l?{unknown:l}:{}}}async function qk(e){const{ok:t,data:n}=await $t(`/pay/ops/${encodeURIComponent(e)}`);return t&&n.success?M6(n.data):null}const Xg=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0?e:null;async function O6(e){const{ok:t,data:n}=await $t(e,"GET");if(!t||!n.success)return null;const i=n.data??{};return{ciphertext:typeof i.ciphertext=="string"&&i.ciphertext?i.ciphertext:null,version:Xg(i.version)}}async function N6(e,t,n){const i=n===null?{ciphertext:t}:{ciphertext:t,expected_version:n},{ok:o,status:l,data:u}=await $t(e,"PUT",i);if(o&&u.success)return{ok:!0,version:Xg(u.data?.version)??(n===null?null:n+1)};if(l===409){const f=u.data??u;return{conflict:!0,version:Xg(f.version)}}return{error:u.error||u.message||"Could not save"}}async function $k(){return O6("/vault/transit-keys")}async function Wk(e,t){return N6("/vault/transit-keys",e,t??0)}async function Gk(){return $t("/banking/accounts")}async function Yk(){return $t("/banking/transfers")}async function Zk(e){return $t("/banking/withdraw","POST",e)}function iO({toasts:e,onRemove:t}){return w.jsx("div",{className:"toast-stack",children:e.map(n=>w.jsxs("div",{className:`toast${n.type==="error"?" is-err":n.type==="info"?" is-info":""}`,onClick:()=>t(n.id),role:"alert",children:[w.jsx("span",{style:{display:"flex",alignItems:"center",flexShrink:0},children:n.type==="success"?w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.2",width:"14",height:"14","aria-hidden":"true",children:w.jsx("path",{d:"M2.5 8l3.5 3.5 7-7",strokeLinecap:"round",strokeLinejoin:"round"})}):n.type==="error"?w.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2.2",width:"14",height:"14","aria-hidden":"true",children:w.jsx("path",{d:"M3 3l10 10M13 3L3 13",strokeLinecap:"round"})}):w.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.8",width:"14",height:"14","aria-hidden":"true",children:[w.jsx("circle",{cx:"8",cy:"8",r:"6"}),w.jsx("line",{x1:"8",y1:"6",x2:"8",y2:"8"}),w.jsx("line",{x1:"8",y1:"10",x2:"8",y2:"11"})]})}),w.jsx("span",{children:n.message})]},n.id))})}const k6="flexprivacy_settings",og={privacyDelay:!0,autoProof:!0,zkCompression:!1,network:"mainnet",pushNotifs:!0,txAlerts:!0,streamAlerts:!1,darkMode:!0,haptics:!0};function J1(){try{const e=localStorage.getItem(k6);return e?{...og,...JSON.parse(e)}:{...og}}catch{return{...og}}}function sO(e){try{localStorage.setItem(k6,JSON.stringify(e))}catch{}}function aO(e){document.documentElement.setAttribute("data-theme",e?"dark":"light")}function Jk(e,t=12){if(e)try{navigator.vibrate?.(t)}catch{}}function oO(e){aO(e.darkMode)}
46async function Xk(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;try{return await Notification.requestPermission()==="granted"}catch{return!1}}const Ed=["zkard_notes_v1","zkard_stealth_keys_v2","zkard_onetime_receive_v1","zkard_onetime_receive_v2","zkard_denom_notes","zkard_stream_notes","zkard_cashout_notes_v1","zkard_pending_sol_deposits_v1","zkard_transit_keys_v1"],lO=["zkard_defi_notes","zkard_held_outputs_"],cO=["zkard_flex_discount_v1","zkard_flex_discount_tree_v1"];function uO(){const e=[];try{for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&lO.some(i=>n.startsWith(i))&&e.push(n)}}catch{}return e}function U6(e){try{return localStorage.getItem(e)}catch{return null}}function fO(){const e={_exportedAt:new Date().toISOString(),_app:"Flex Privacy",settings:J1()};for(const t of[...Ed,...uO()]){const n=U6(t);n!=null&&(e[t]=n)}return e}function Qk(){const e=fO(),t=Object.keys(e).filter(l=>l.startsWith("zkard_")).length,n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),i=URL.createObjectURL(n),o=document.createElement("a");return o.href=i,o.download=`flex-privacy-export-${Date.now()}.json`,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i),t}function eU(){return Ed.filter(e=>U6(e)!=null).length}function tU(){let e=0;for(const t of[...Ed,...cO])try{if(localStorage.getItem(t)==null)continue;localStorage.removeItem(t),Ed.includes(t)&&e++}catch{}return e}function nU(){const[e,t]=Me.useState(J1),n=Me.useCallback((i,o)=>{t(l=>{const u={...l,[i]:o};return sO(u),u})},[]);return{settings:e,update:n}}const dO={flex:w.jsxs("g",{children:[w.jsx("path",{d:"M6 6h12L6 18h12"}),w.jsx("circle",{cx:"12",cy:"12",r:"9.2",strokeOpacity:"0.35"})]}),shield:w.jsx("path",{d:"M12 3l8 3v5c0 4.6-3.4 8.7-8 10-4.6-1.3-8-5.4-8-10V6l8-3z"}),shieldCheck:w.jsxs("g",{children:[w.jsx("path",{d:"M12 3l8 3v5c0 4.6-3.4 8.7-8 10-4.6-1.3-8-5.4-8-10V6l8-3z"}),w.jsx("path",{d:"M8.5 12l2.5 2.5L15.5 10"})]}),shieldLock:w.jsxs("g",{children:[w.jsx("path",{d:"M12 3l8 3v5c0 4.6-3.4 8.7-8 10-4.6-1.3-8-5.4-8-10V6l8-3z"}),w.jsx("rect",{x:"9",y:"11",width:"6",height:"5",rx:"1"}),w.jsx("path",{d:"M10.2 11V9.5a1.8 1.8 0 013.6 0V11"})]}),lock:w.jsxs("g",{children:[w.jsx("rect",{x:"4.5",y:"11",width:"15",height:"10",rx:"2"}),w.jsx("path",{d:"M8 11V7.5a4 4 0 018 0V11"})]}),unlock:w.jsxs("g",{children:[w.jsx("rect",{x:"4.5",y:"11",width:"15",height:"10",rx:"2"}),w.jsx("path",{d:"M8 11V7.5a4 4 0 017.7-1.4"})]}),eye:w.jsxs("g",{children:[w.jsx("path",{d:"M2.5 12s3.5-7 9.5-7 9.5 7 9.5 7-3.5 7-9.5 7-9.5-7-9.5-7z"}),w.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),eyeOff:w.jsxs("g",{children:[w.jsx("path",{d:"M3 3l18 18"}),w.jsx("path",{d:"M10.6 6.1c.45-.07.92-.1 1.4-.1 6 0 9.5 6 9.5 6-.5.86-1.16 1.7-1.93 2.46"}),w.jsx("path",{d:"M6.5 7.5C4.1 9.2 2.5 12 2.5 12s3.5 7 9.5 7c1.7 0 3.2-.45 4.5-1.2"}),w.jsx("path",{d:"M9.7 9.8a3 3 0 004.5 4.4"})]}),home:w.jsx("path",{d:"M3 11l9-7 9 7v8a2 2 0 01-2 2h-3v-7H8v7H5a2 2 0 01-2-2v-8z"}),send:w.jsxs("g",{children:[w.jsx("path",{d:"M22 2L11 13"}),w.jsx("path",{d:"M22 2l-7 20-4-9-9-4 20-7z"})]}),receive:w.jsxs("g",{children:[w.jsx("path",{d:"M12 4v14"}),w.jsx("path",{d:"M5 11l7 7 7-7"})]}),swap:w.jsxs("g",{children:[w.jsx("path",{d:"M7 3v18"}),w.jsx("path",{d:"M3 7l4-4 4 4"}),w.jsx("path",{d:"M17 21V3"}),w.jsx("path",{d:"M21 17l-4 4-4-4"})]}),card:w.jsxs("g",{children:[w.jsx("rect",{x:"2.5",y:"5",width:"19",height:"14",rx:"2.5"}),w.jsx("path",{d:"M2.5 10h19"}),w.jsx("path",{d:"M6 15h3"})]}),cards:w.jsxs("g",{children:[w.jsx("rect",{x:"2.5",y:"6.5",width:"19",height:"13",rx:"2"}),w.jsx("rect",{x:"5.5",y:"3.5",width:"13",height:"2.5",rx:"1",opacity:"0.5"}),w.jsx("path",{d:"M2.5 11h19"})]}),bank:w.jsxs("g",{children:[w.jsx("path",{d:"M3 9l9-6 9 6"}),w.jsx("path",{d:"M4 9v11"}),w.jsx("path",{d:"M20 9v11"}),w.jsx("path",{d:"M8 13v4"}),w.jsx("path",{d:"M12 13v4"}),w.jsx("path",{d:"M16 13v4"}),w.jsx("path",{d:"M3 20h18"})]}),more:w.jsx("circle",{cx:"12",cy:"12",r:"1.5"}),grid:w.jsxs("g",{children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]}),list:w.jsxs("g",{children:[w.jsx("path",{d:"M8 6h13"}),w.jsx("path",{d:"M8 12h13"}),w.jsx("path",{d:"M8 18h13"}),w.jsx("circle",{cx:"4",cy:"6",r:"0.8"}),w.jsx("circle",{cx:"4",cy:"12",r:"0.8"}),w.jsx("circle",{cx:"4",cy:"18",r:"0.8"})]}),search:w.jsxs("g",{children:[w.jsx("circle",{cx:"11",cy:"11",r:"7"}),w.jsx("path",{d:"M21 21l-4.3-4.3"})]}),scan:w.jsxs("g",{children:[w.jsx("path",{d:"M3 8V5a2 2 0 012-2h3"}),w.jsx("path",{d:"M16 3h3a2 2 0 012 2v3"}),w.jsx("path",{d:"M21 16v3a2 2 0 01-2 2h-3"}),w.jsx("path",{d:"M8 21H5a2 2 0 01-2-2v-3"}),w.jsx("path",{d:"M3 12h18"})]}),arrowUp:w.jsxs("g",{children:[w.jsx("path",{d:"M12 19V5"}),w.jsx("path",{d:"M5 12l7-7 7 7"})]}),arrowDown:w.jsxs("g",{children:[w.jsx("path",{d:"M12 5v14"}),w.jsx("path",{d:"M5 12l7 7 7-7"})]}),arrowLeft:w.jsxs("g",{children:[w.jsx("path",{d:"M19 12H5"}),w.jsx("path",{d:"M12 19l-7-7 7-7"})]}),arrowRight:w.jsxs("g",{children:[w.jsx("path",{d:"M5 12h14"}),w.jsx("path",{d:"M12 5l7 7-7 7"})]}),chevronRight:w.jsx("path",{d:"M9 6l6 6-6 6"}),chevronLeft:w.jsx("path",{d:"M15 6l-6 6 6 6"}),chevronDown:w.jsx("path",{d:"M6 9l6 6 6-6"}),chevronUp:w.jsx("path",{d:"M6 15l6-6 6 6"}),plus:w.jsxs("g",{children:[w.jsx("path",{d:"M12 5v14"}),w.jsx("path",{d:"M5 12h14"})]}),minus:w.jsx("path",{d:"M5 12h14"}),close:w.jsxs("g",{children:[w.jsx("path",{d:"M18 6L6 18"}),w.jsx("path",{d:"M6 6l12 12"})]}),check:w.jsx("path",{d:"M5 13l4 4L19 7"}),copy:w.jsxs("g",{children:[w.jsx("rect",{x:"8",y:"8",width:"13",height:"13",rx:"2"}),w.jsx("path",{d:"M16 8V5a2 2 0 00-2-2H5a2 2 0 00-2 2v9a2 2 0 002 2h3"})]}),clock:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M12 7v5l3 3"})]}),zap:w.jsx("path",{d:"M13 2L4 14h7l-1 8 9-12h-7l1-8z"}),flame:w.jsxs("g",{children:[w.jsx("path",{d:"M12 2s1 3 1 5c0 2-2 3-2 5s2 3 2 5-1 5-1 5"}),w.jsx("path",{d:"M12 22c-4.4 0-8-3.4-8-7.5 0-2.5 1.5-4.5 3-6 1.5-1.5 3-3 3-5 0-1 1 .5 1 .5s3 2.5 3 6c0 1.5-1 2-1 3.5s4.5 1 4.5 5C17.5 19.5 15.4 22 12 22z"})]}),globe:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M3 12h18"}),w.jsx("path",{d:"M12 3a14 14 0 010 18"}),w.jsx("path",{d:"M12 3a14 14 0 000 18"})]}),sparkle:w.jsxs("g",{children:[w.jsx("path",{d:"M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z"}),w.jsx("path",{d:"M19 14l.7 2.3L22 17l-2.3.7L19 20l-.7-2.3L16 17l2.3-.7L19 14z"})]}),fingerprint:w.jsxs("g",{children:[w.jsx("path",{d:"M12 11c0 4.5-1 8-3 11"}),w.jsx("path",{d:"M16 11c0 5-2 8-4 11"}),w.jsx("path",{d:"M8 11c0 4-1 7-3 9"}),w.jsx("path",{d:"M20 13c0-4-3-9-8-9s-8 5-8 9c0 1 0 2 .3 3"}),w.jsx("path",{d:"M12 7c2 0 4 1.5 4 4"})]}),key:w.jsxs("g",{children:[w.jsx("circle",{cx:"8",cy:"15",r:"4"}),w.jsx("path",{d:"M11 12l9-9"}),w.jsx("path",{d:"M17 6l3 3"}),w.jsx("path",{d:"M15 8l2 2"})]}),ceremony:w.jsxs("g",{children:[w.jsx("path",{d:"M12 3l7 2.6v4.6c0 4.2-3 7.8-7 8.8-4-1-7-4.6-7-8.8V5.6L12 3z"}),w.jsx("circle",{cx:"12",cy:"10.2",r:"1.7"}),w.jsx("path",{d:"M12 11.9V14.2"})]}),settings:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"3"}),w.jsx("path",{d:"M19.4 15a1.6 1.6 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.6 1.6 0 00-1.8-.3 1.6 1.6 0 00-1 1.5V21a2 2 0 01-4 0v-.1
46a1.6 1.6 0 00-1-1.5 1.6 1.6 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.6 1.6 0 00.3-1.8 1.6 1.6 0 00-1.5-1H3a2 2 0 010-4h.1a1.6 1.6 0 001.5-1 1.6 1.6 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.6 1.6 0 001.8.3h.1a1.6 1.6 0 001-1.5V3a2 2 0 014 0v.1a1.6 1.6 0 001 1.5 1.6 1.6 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.6 1.6 0 00-.3 1.8v.1a1.6 1.6 0 001.5 1H21a2 2 0 010 4h-.1a1.6 1.6 0 00-1.5 1z"})]}),bell:w.jsxs("g",{children:[w.jsx("path",{d:"M6 8a6 6 0 0112 0c0 7 3 9 3 9H3s3-2 3-9"}),w.jsx("path",{d:"M10.3 21a1.94 1.94 0 003.4 0"})]}),user:w.jsxs("g",{children:[w.jsx("path",{d:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2"}),w.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),logout:w.jsxs("g",{children:[w.jsx("path",{d:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4"}),w.jsx("path",{d:"M16 17l5-5-5-5"}),w.jsx("path",{d:"M21 12H9"})]}),info:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M12 8v.01"}),w.jsx("path",{d:"M11 12h1v4h1"})]}),help:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M9.5 9a2.5 2.5 0 015 0c0 2-2.5 2-2.5 4"}),w.jsx("circle",{cx:"12",cy:"17",r:"0.6",fill:"currentColor"})]}),doc:w.jsxs("g",{children:[w.jsx("path",{d:"M14 3H6a2 2 0 00-2 2v14a2 2 0 002 2h12a2 2 0 002-2V9l-6-6z"}),w.jsx("path",{d:"M14 3v6h6"}),w.jsx("path",{d:"M8 13h8"}),w.jsx("path",{d:"M8 17h6"})]}),book:w.jsxs("g",{children:[w.jsx("path",{d:"M4 19.5A2.5 2.5 0 016.5 17H20"}),w.jsx("path",{d:"M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z"})]}),external:w.jsxs("g",{children:[w.jsx("path",{d:"M15 3h6v6"}),w.jsx("path",{d:"M10 14L21 3"}),w.jsx("path",{d:"M21 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h6"})]}),download:w.jsxs("g",{children:[w.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),w.jsx("path",{d:"M7 10l5 5 5-5"}),w.jsx("path",{d:"M12 15V3"})]}),refresh:w.jsxs("g",{children:[w.jsx("path",{d:"M3 12a9 9 0 019-9 9 9 0 016.4 2.6L21 8"}),w.jsx("path",{d:"M21 3v5h-5"}),w.jsx("path",{d:"M21 12a9 9 0 01-9 9 9 9 0 01-6.4-2.6L3 16"}),w.jsx("path",{d:"M3 21v-5h5"})]}),pause:w.jsxs("g",{children:[w.jsx("rect",{x:"6",y:"4",width:"4",height:"16",rx:"1"}),w.jsx("rect",{x:"14",y:"4",width:"4",height:"16",rx:"1"})]}),play:w.jsx("path",{d:"M5 3l16 9-16 9V3z"}),trash:w.jsxs("g",{children:[w.jsx("path",{d:"M3 6h18"}),w.jsx("path",{d:"M8 6V4a2 2 0 012-2h4a2 2 0 012 2v2"}),w.jsx("path",{d:"M19 6l-1 14a2 2 0 01-2 2H8a2 2 0 01-2-2L5 6"})]}),plug:w.jsxs("g",{children:[w.jsx("path",{d:"M9 2v6"}),w.jsx("path",{d:"M15 2v6"}),w.jsx("path",{d:"M6 8h12v4a6 6 0 11-12 0V8z"}),w.jsx("path",{d:"M12 18v4"})]}),filter:w.jsxs("g",{children:[w.jsx("path",{d:"M3 5h18"}),w.jsx("path",{d:"M6 12h12"}),w.jsx("path",{d:"M10 19h4"})]}),phantom:w.jsx("g",{fill:"currentColor",stroke:"none",children:w.jsx("path",{d:"M21 12c0 5-4.5 9-10 9-1.5 0-3-.3-4.3-1l1.4-2.2c.9.4 2 .7 3 .7 4 0 7-2.5 7-6.5 0-2.4-1.6-4.4-4-4.4-2.2 0-4 1.6-4 3.8 0 1 .4 1.8 1 2.3-.4.7-1.1 1.2-2 1.2-1.4 0-2.4-1.2-2.4-3 0-3.4 2.8-6.2 6.7-6.2C18 5.7 21 8.5 21 12z"})}),wallet:w.jsxs("g",{children:[w.jsx("path",{d:"M3 7a2 2 0 012-2h13l3 4v9a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"}),w.jsx("path",{d:"M16 14h3"}),w.jsx("path",{d:"M3 11h18"})]}),qr:w.jsxs("g",{children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"5",y:"5",width:"3",height:"3"}),w.jsx("rect",{x:"16",y:"5",width:"3",height:"3"}),w.jsx("rect",{x:"5",y:"16",width:"3",height:"3"}),w.jsx("path",{d:"M14 14h3v3"}),w.jsx("path",{d:"M21 14v3"}),w.jsx("path",{d:"M17 21h4"}),w.jsx("path",{d:"M14 21v-4"})]}),stream:w.jsxs("g",{children:[w.jsx("path",{d:"M3 8c4 0 4 4 8 4s4-4 8-4"}),w.jsx("path",{d:"M3 16c4 0 4-4 8-4s4 4 8 4"})]}),drop:w.jsx("path",{d:"M12 2.5s7 8 7 12.5a7 7 0 01-14 0c0-4.5 7-12.5 7-12.5z"}),chart:w.jsxs("g",{children:[w.jsx("path",{d:"M3 21V3"}),w.jsx("path",{d:"M3 21h18"}),w.jsx("path",{d:"M7 16l4-5 3 3 5-7"})]}),trendUp:w.jsxs("g",{children:[w.jsx("path",{d:"M3 17l6-6 4 4 8-8"}),w.jsx("path",{d:"M14 7h7v7"})]}),network:w.jsxs("g",{children:[w.jsx("circle",{cx:"6",cy:"6",r:"2.5"}),w.jsx("circle",{cx:"18",cy:"6",r:"2.5"}),w.jsx("circle",{cx:"6",cy:"18",r:"2.5"}),w.jsx("circle",{cx:"18",cy:"18",r:"2.5"}),w.jsx("circle",{cx:"12",cy:"12",r:"2.5"}),w.jsx("path",{d:"M8 7l3 4"}),w.jsx("path",{d:"M16 7l-3 4"}),w.jsx("path",{d:"M8 17l3-4"}),w.jsx("path",{d:"M16 17l-3-4"})]}),star:w.jsx("path",{d:"M12 2l3 7h7l-5.5 4.5L18.5 21 12 16.7 5.5 21l2-7.5L2 9h7l3-7z"}),bolt:w.jsx("path",{d:"M13 2L4 14h7l-1 8 9-12h-7l1-8z"}),bookmark:w.jsx("path",{d:"M19 21l-7-5-7 5V5a2 2 0 012-2h10a2 2 0 012 2v16z"}),hash:w.jsxs("g",{children:[w.jsx("path",{d:"M4 9h16"}),w.jsx("path",{d:"M4 15h16"}),w.jsx("path",{d:"M10 3L8 21"}),w.jsx("path",{d:"M16 3l-2 18"})]}),link:w.jsxs("g",{children:[w.jsx("path",{d:"M10 14a5 5 0 007 0l3-3a5 5 0 00-7-7l-1 1"}),w.jsx("path",{d:"M14 10a5 5 0 00-7 0l-3 3a5 5 0 007 7l1-1"})]}),share:w.jsxs("g",{children:[w.jsx("path",{d:"M4 12v7a2 2 0 002 2h12a2 2 0 002-2v-7"}),w.jsx("path",{d:"M16 6l-4-4-4 4"}),w.jsx("path",{d:"M12 2v13"})]}),layers:w.jsxs("g",{children:[w.jsx("path",{d:"M12 2l10 6-10 6L2 8l10-6z"}),w.jsx("path",{d:"M2 16l10 6 10-6"}),w.jsx("path",{d:"M2 12l10 6 10-6"})]}),pin:w.jsxs("g",{children:[w.jsx("path",{d:"M12 21s-7-7-7-12a7 7 0 0114 0c0 5-7 12-7 12z"}),w.jsx("circle",{cx:"12",cy:"9",r:"2.5"})]}),upload:w.jsxs("g",{children:[w.jsx("path",{d:"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"}),w.jsx("path",{d:"M7 9l5-5 5 5"}),w.jsx("path",{d:"M12 4v12"})]}),sun:w.jsxs("g",{children:[w.jsx("circle",{cx:"12",cy:"12",r:"4"}),w.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41
46M17.66 6.34l1.41-1.41"})]}),moon:w.jsx("path",{d:"M21 12.8A9 9 0 1111.2 3a7 7 0 009.8 9.8z"}),zk:w.jsxs("g",{children:[w.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"5"}),w.jsx("path",{d:"M8 8.5h4L8 15.5h4"}),w.jsx("path",{d:"M15 8.5v7"}),w.jsx("path",{d:"M15 12l3-3.5"}),w.jsx("path",{d:"M15 12l3 3.5"})]}),vibrate:w.jsxs("g",{children:[w.jsx("rect",{x:"8",y:"4",width:"8",height:"16",rx:"2"}),w.jsx("path",{d:"M3.5 9.5v5"}),w.jsx("path",{d:"M20.5 9.5v5"})]})};function es({name:e,size:t=24,className:n="",style:i}){const o=dO[e];return o?w.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:n,style:i,"aria-hidden":"true",children:o}):null}var hO=sE();const Jo=12,$x=300,Pf=8;function cl({label:e,children:t,size:n=16,className:i=""}){const[o,l]=Me.useState(!1),[u,f]=Me.useState(null),h=Me.useRef(null),y=Me.useRef(null),_=Me.useId(),A=Me.useCallback(()=>l(!1),[]);return Me.useLayoutEffect(()=>{if(!o){f(null);return}const D=()=>{const L=h.current;if(!L)return;const k=L.getBoundingClientRect(),j=window.innerWidth,M=window.innerHeight,W=Math.min($x,j-2*Jo),K=k.left+k.width/2,se=Math.min(Math.max(K-W/2,Jo),j-W-Jo),re=y.current?.offsetHeight??0,te=k.bottom+Pf+re>M-Jo&&k.top-Pf-re>Jo,pe=te?k.top-Pf-re:k.bottom+Pf;f({top:pe,left:se,width:W,arrow:Math.min(Math.max(K-se,14),W-14),above:te})};D();const U=requestAnimationFrame(D);return()=>cancelAnimationFrame(U)},[o]),Me.useEffect(()=>{if(!o)return;const D=L=>{const k=L.target;h.current?.contains(k)||y.current?.contains(k)||A()},U=L=>{L.key==="Escape"&&(A(),h.current?.focus())};return document.addEventListener("pointerdown",D,!0),document.addEventListener("keydown",U),window.addEventListener("scroll",A,!0),window.addEventListener("resize",A),()=>{document.removeEventListener("pointerdown",D,!0),document.removeEventListener("keydown",U),window.removeEventListener("scroll",A,!0),window.removeEventListener("resize",A)}},[o,A]),w.jsxs(w.Fragment,{children:[w.jsx("button",{ref:h,type:"button",className:"info-tip-btn"+(o?" is-open":"")+(i?" "+i:""),"aria-label":`More info: ${e}`,"aria-expanded":o,"aria-controls":o?_:void 0,onClick:D=>{D.preventDefault(),D.stopPropagation(),l(U=>!U)},children:w.jsxs("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[w.jsx("circle",{cx:"12",cy:"12",r:"9.25"}),w.jsx("path",{d:"M12 11v5.5"}),w.jsx("circle",{cx:"12",cy:"7.75",r:"0.6",fill:"currentColor"})]})}),o&&hO.createPortal(w.jsxs("div",{ref:y,id:_,role:"status",className:"info-tip-panel"+(u?.above?" is-above":""),style:u?{top:u.top,left:u.left,width:u.width,"--info-tip-arrow":`${u.arrow}px`}:{visibility:"hidden",top:0,left:0,width:Math.min($x,window.innerWidth-2*Jo)},children:[w.jsx("div",{className:"info-tip-title",children:e}),w.jsx("div",{className:"info-tip-body",children:t})]}),document.body)]})}function rU({left:e,title:t,right:n,transparent:i}){return w.jsxs("header",{className:"nav",style:i?{background:"transparent",borderBottom:0}:void 0,children:[w.jsx("div",{className:"nav-side",children:e}),w.jsx("div",{className:"nav-title",children:t}),w.jsx("div",{className:"nav-side nav-side--right",children:n})]})}function iU({onClick:e,label:t}){return w.jsxs("button",{className:"nav-back",onClick:e,"aria-label":"Back",title:"Back",children:[w.jsx(es,{name:"chevronLeft",size:22}),t?w.jsx("span",{children:t}):null]})}function sU({icon:e,onClick:t,accent:n,label:i,ariaLabel:o}){return i?w.jsx("button",{className:"nav-btn nav-btn--accent",onClick:t,children:i}):w.jsx("button",{className:"nav-btn"+(n?" nav-btn--accent":""),onClick:t,"aria-label":o??e,title:o,children:w.jsx(es,{name:e,size:20})})}const Hf=[{key:"home",label:"Home",icon:"home"},{key:"send",label:"Send",icon:"send"},{key:"swap",label:"Swap",icon:"swap"},{key:"claim",label:"Claim",icon:"drop"},{key:"more",label:"More",icon:"grid"}];
46function pO({active:e,onChange:t}){const[n,i]=Me.useState(!1),o=Hf.find(l=>l.key===e)??Hf[0];return Me.useEffect(()=>{if(!n)return;const l=u=>{u.key==="Escape"&&i(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[n]),w.jsxs("nav",{className:"fab-nav"+(n?" is-open":""),"aria-label":"Main menu",children:[n&&w.jsx("div",{className:"fab-nav__backdrop",onClick:()=>i(!1),"aria-hidden":"true"}),w.jsx("div",{className:"fab-nav__menu",id:"fab-nav-menu",role:"menu",hidden:!n,children:Hf.map((l,u)=>w.jsxs("button",{role:"menuitem",className:"fab-nav__item"+(e===l.key?" is-active":""),style:{animationDelay:`${(Hf.length-1-u)*25}ms`},onClick:()=>{i(!1),t(l.key)},children:[w.jsx("span",{className:"fab-nav__label",children:l.label}),w.jsx("span",{className:"fab-nav__icon",children:w.jsx(es,{name:l.icon,size:22})})]},l.key))}),w.jsx("button",{className:"fab-nav__btn","aria-expanded":n,"aria-controls":"fab-nav-menu","aria-label":n?"Close menu":`Menu (${o.label})`,onClick:()=>i(l=>!l),children:w.jsx(es,{name:n?"close":o.icon,size:24})})]})}const lg=e=>w.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{width:17,height:17,flexShrink:0},"aria-hidden":"true",children:e.split("|").map((t,n)=>w.jsx("path",{d:t},n))}),gO=[{key:"home",label:"Home",view:"home",tab:"home",icon:lg("M3 9.5L12 3l9 6.5|M5 10v10h14V10")},{key:"send",label:"Send",view:"send",tab:"send",icon:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,style:{width:17,height:17,flexShrink:0},"aria-hidden":"true",children:[w.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),w.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})},{key:"pay",label:"Flex Pay",view:"pay",icon:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,style:{width:17,height:17,flexShrink:0},"aria-hidden":"true",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),w.jsx("line",{x1:"14",y1:"4",x2:"21",y2:"4"}),w.jsx("line",{x1:"14",y1:"8",x2:"18",y2:"8"}),w.jsx("line",{x1:"14",y1:"14",x2:"21",y2:"14"}),w.jsx("line",{x1:"14",y1:"18",x2:"21",y2:"18"}),w.jsx("line",{x1:"3",y1:"14",x2:"10",y2:"14"}),w.jsx("line",{x1:"3",y1:"18",x2:"10",y2:"18"})]})},{key:"claim",label:"Claim",view:"claim",icon:lg("M12 2.7C12 2.7 5 9 5 14a7 7 0 0 0 14 0c0-5-7-11.3-7-11.3z")},{key:"swap",label:"Swap",view:"swap",tab:"swap",icon:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,style:{width:17,height:17,flexShrink:0},"aria-hidden":"true",children:[w.jsx("polyline",{points:"17 1 21 5 17 9"}),w.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),w.jsx("polyline",{points:"7 23 3 19 7 15"}),w.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]})},{key:"streams",label:"Streams",view:"streams",icon:lg("M4 3 Q4 8 8 10 Q12 12 8 16 Q4 20 8 22|M10 3 Q10 8 14 10 Q18 12 14 16 Q10 20 14 22|M16 3 Q16 8 20 10 Q24 12 20 16 Q16 20 20 22")},{key:"more",label:"More",view:"more",tab:"more",icon:w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,style:{width:17,height:17,flexShrink:0},"aria-hidden":"true",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1.5"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1.5"})]})}];function mO({view:e,onTab:t,go:n,address:i,onSwitchWallet:o,onDisconnect:l}){const u=i?`${i.slice(0,4)}â¦${i.slice(-4)}`:"Connected",[f,h]=Me.useState(!1),y=Me.useRef(null);Me.useEffect(()=>{if(!f)return;const A=U=>{y.current&&!y.current.contains(U.target)&&h(!1)},D=U=>{U.key==="Escape"&&h(!1)};return document.addEventListener("mousedown",A),window.addEventListener("keydown",D),()=>{document.removeEventListener("mousedown",A),window.removeEventListener("keydown",D)}},[f]);const _=!!(o||l);return w.jsxs("aside",{className:"app-sidebar","aria-label":"Sidebar",children:[w.jsxs("div",{className:"app-sidebar-brand",children:[w.jsx("img",{src:"/flex-privacy/assets/flex-mark.png",alt:"",className:"app-sidebar-mark"}),w.jsxs("div",{className:"app-sidebar-word",children:[w.jsx("span",{className:"app-sidebar-flex",children:"FLEX"}),w.jsx("span",{className:"app-sidebar-priv",children:"PRIVACY"})]})]}),w.jsx("nav",{className:"app-sidebar-nav",children:gO.map(A=>w.jsxs("button",{className:"nav-link"+(e===A.view?" active":""),onClick:()=>A.tab?t(A.tab):n(A.view),children:[A.icon,w.jsx("span",{children:A.label})]},A.key))}),w.jsxs("a",{className:"app-sidebar-social",href:"https://x.com/FlexPrivacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Follow Flex Privacy on X",children:[w.jsx("svg",{viewBox:"0 0 24 24",width:"15",height:"15",fill:"currentColor","aria-hidden":"true",children:w.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24h-6.66l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),w.jsx("span",{children:"@FlexPrivacy"})]}),w.jsxs("div",{className:"app-sidebar-foot",ref:y,children:[f&&_&&w.jsxs("div",{className:"wallet-menu",role:"menu",children:[o&&w.jsxs("button",{className:"wallet-menu-item",role:"menuitem",onClick:()=>{h(!1),o()},children:[w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[w.jsx("polyline",{points:"17 1 21 5 17 9"}),w.jsx("path",{d:"M3 11V9a4 4 0 0 1 4-4h14"}),w.jsx("polyline",{points:"7 23 3 19 7 15"}),w.jsx("path",{d:"M21 13v2a4 4 0 0 1-4 4H3"})]}),"Switch wallet"]}),l&&w.jsxs("button",{className:"wallet-menu-item wallet-menu-item--danger",role:"menuitem",onClick:()=>{h(!1),l()},children:[w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[w.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),w.jsx("polyline",{points:"16 17 21 12 16 7"}),w.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Disconnect"]})]}),w.jsxs("button",{type:"button",className:"app-sidebar-wallet"+(_?" app-sidebar-wallet--btn":"")+(f?" is-open":""),onClick:_?()=>h(A=>!A):void 0,disabled:!_,"aria-haspopup":_?"menu":void 0,"aria-expanded":_?f:void 0,children:[w.jsx("div",{className:"app-sidebar-avatar"}),w.jsxs("div",{className:"app-sidebar-wallet-meta",children:[w.jsx("div",{className:"app-sidebar-addr",children:u}),w.jsxs("div",{className:"app-sidebar-status",children:[w.jsx("span",{className:"dot"}),"Private"]})]}),_&&w.jsx("svg",{className:"app-sidebar-wallet-chev",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"15",height:"15","aria-hidden":"true",children:w.jsx("polyline",{points:"6 9 12 15 18 9"})})]})]})]})}function yO({title:e,onBell:t}){return w.jsxs("header",{className:"app-topbar",children:[w.jsx("h1",{className:"app-topbar-title",children:e}),w.jsxs("div",{className:"app-topbar-right",children:[w.jsxs("span",{className:"app-topbar-zk",children:[w.jsx("span",{className:"dot"}),"ZK Active"]}),w.jsx("button",{className:"app-topbar-bell",onClick:t,"aria-label":"Notifications",children:w.jsx(es,{name:"bell",size:17})})]})]})}
46function aU({header:e,headerLink:t,footer:n,info:i,children:o}){return w.jsxs(w.Fragment,{children:[e?w.jsxs("div",{className:"group-header",children:[i!=null?w.jsxs("span",{className:"with-info",children:[e,w.jsx(cl,{label:e,size:14,children:i})]}):w.jsx("span",{children:e}),t?w.jsxs("button",{className:"group-header-link",onClick:t.onClick,children:[t.label,t.showChev&&w.jsx(es,{name:"chevronRight",size:12})]}):null]}):null,w.jsx("div",{className:"group",children:o}),n?w.jsx("div",{className:"group-footer",children:n}):null]})}function oU({icon:e,iconClass:t="ri-violet",title:n,sub:i,trail:o,trailValue:l,trailIcon:u="chevronRight",button:f,onClick:h,customIcon:y,info:_,infoLabel:A}){const D=!!f&&_!=null,U=f&&!D?"button":"div",L=D?w.jsx("button",{type:"button",className:"stretch-btn",onClick:h,children:n}):n;return w.jsxs(U,{className:"row"+(f?" row--button":"")+(D?" row--stretch":""),onClick:D?void 0:h,children:[y||(e?w.jsx("span",{className:"row-icon "+t,children:w.jsx(es,{name:e})}):null),w.jsxs("div",{className:"row-main",children:[w.jsx("div",{className:"row-title",children:_!=null?w.jsxs("span",{className:"with-info",children:[L,w.jsx(cl,{label:A??(typeof n=="string"?n:"Details"),children:_})]}):L}),i?w.jsx("div",{className:"row-sub",children:i}):null]}),w.jsxs("div",{className:"row-trail",children:[l?w.jsx("span",{children:l}):null,o!==void 0?o:f&&u?w.jsx(es,{name:u,size:14,className:"chev"}):null]})]})}function lU({tile:e,title:t,info:n,onClick:i,className:o=""}){return w.jsxs("div",{className:"fh-item fh-item--stretch"+(o?" "+o:""),children:[e,w.jsx("span",{className:"fh-itxt",children:w.jsxs("span",{className:"with-info",children:[w.jsx("button",{type:"button",className:"fh-it stretch-btn",onClick:i,children:t}),n!=null?w.jsx(cl,{label:t,children:n}):null]})}),w.jsx("span",{className:"fh-chev","aria-hidden":"true",children:"âº"})]})}function cU({on:e,onChange:t}){return w.jsx("button",{className:"switch"+(e?" is-on":""),role:"switch","aria-checked":e,onClick:()=>t&&t(!e)})}function uU({options:e,value:t,onChange:n,block:i,label:o,disabled:l,stacked:u}){const f=e.map(y=>typeof y=="string"?y:y.value);function h(y){if(l)return;const _=Array.from(y.currentTarget.querySelectorAll('[role="tab"]')),A=_.indexOf(document.activeElement);if(A<0)return;const D=y.key==="ArrowRight"?(A+1)%_.length:y.key==="ArrowLeft"?(A-1+_.length)%_.length:y.key==="Home"?0:y.key==="End"?_.length-1:-1;D<0||(y.preventDefault(),_[D].focus())}return w.jsx("div",{role:"tablist","aria-label":o,className:"segmented"+(i?" segmented--block":"")+(u?" segmented--stacked":""),onKeyDown:h,children:e.map(y=>{const _=typeof y=="string"?y:y.value,A=typeof y=="string"?y:y.label,D=typeof y=="string"?void 0:y.icon,U=t===_;return w.jsxs("button",{type:"button",role:"tab","aria-selected":U,tabIndex:U||!f.includes(t)?0:-1,className:"seg"+(U?" is-active":""),onClick:()=>n(_),disabled:l,children:[D?w.jsx("span",{className:"seg-icon","aria-hidden":"true",children:D}):null,w.jsx("span",{className:"seg-label",children:A})]},_)})})}function fU({seed:e="",size:t=36,label:n}){const i=(()=>{let h=0;for(let y=0;y<e.length;y++)h=h*31+e.charCodeAt(y)>>>0;return h})(),o=[["#a8e90c","#13b87a"],["#FF6B9D","#FFB37E"],["#00C2FF","#4ADE80"],["#FFD60A","#FF6B35"],["#a8e90c","#EC4899"],["#0EA5E9","#b6f520"]],[l,u]=o[i%o.length],f=(n||e||"?").slice(0,1).toUpperCase();return w.jsx("span",{style:{width:t,height:t,borderRadius:"50%",display:"inline-flex",alignItems:"center",justifyContent:"center",background:`linear-gradient(135deg, ${l}, ${u})`,color:"white",fontWeight:700,fontSize:t*.42,flexShrink:0,letterSpacing:"-0.02em"},children:f})}function dU(e,t=4,n=4){return e?e.length<=t+n+1?e:e.slice(0,t)+"â¦"+e.slice(-n):""}function Jc({size:e=16}){return w.jsxs("svg",{width:e,height:e,viewBox:"0 0 16 16",style:{animation:"ringspin 0.8s linear infinite"},children:[w.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeOpacity:"0.25"}),w.jsx("path",{d:"M 8 2 A 6 6 0 0 1 14 8",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}let wO=0;function bO(){const[e,t]=Me.useState([]),n=Me.useCallback((o,l="info",u=3500)=>{const f=++wO;t(h=>[...h,{id:f,message:o,type:l}]),setTimeout(()=>{t(h=>h.filter(y=>y.id!==f))},u)},[]),i=Me.useCallback(o=>{t(l=>l.filter(u=>u.id!==o))},[]);return{toasts:e,toast:n,removeToast:i}}let Tc=null;async function j6(){if(Tc)return Tc;Tc=(async()=>{const{buildPoseidon:e}=await z1(()=>Dn(()=>import("./main-C77D1zRs.js"),__vite__mapDeps([3,1])));return e()})();try{return await Tc}catch(e){throw Tc=null,e}}async function X1(e){const t=await j6(),n=t(e.map(i=>BigInt(i)));return t.F.toObject(n).toString()}const Wx=512;function Gx(){const e=new Uint8Array(31);return crypto.getRandomValues(e),Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}function vO(e){return BigInt("0x"+e)}const L6=BigInt("21888242871839275222246405745257275088548364400416034343698204186575808495617");function Yx(e){return(vO(e)%L6).toString()}async function hU(e){const t=Gx(),n=Gx(),i=Yx(t),o=Yx(n),l=await X1([o,i,e]);return{nullifier:i,secret:o,commitment:l,amount_cents:e,created_at:new Date().toISOString()}}async function pU(e,t,n){const i=await X1([e.nullifier,e.secret]),o={root:n.root,nullifier_hash:i,recipient:t,amount_pub:"0",secret:e.secret,nullifier:e.nullifier,amount:e.amount_cents.toString(),path_elements:n.elements,path_indices:n.indices},{proof:l,publicSignals:u}=await snarkjs.groth16.fullProve(o,"/zk/transfer.wasm","/zk/transfer_final.zkey");return{proof:l,publicSignals:u,nullifier_hash:i,root:n.root}}function gU(e){const t="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";let n=BigInt(0);for(const i of e){const o=t.indexOf(i);if(o<0)throw new Error(`Invalid base58 char: ${i}`);n=n*BigInt(58)+BigInt(o)}return(n%L6).toString()}async function mU(e,t){const{memo:n,...i}=e,o=((n??"")+"\0".repeat(Wx)).slice(0,Wx),l={...i,_m:btoa(o)},u=new TextEncoder().encode(JSON.stringify(l));{const f=new Uint8Array(32);crypto.getRandomValues(f);const h=await crypto.subtle.importKey("raw",f,{name:"AES-GCM"},!1,["encrypt"]),y=new Uint8Array(12);crypto.getRandomValues(y);const _=new Uint8Array(await crypto.subtle.encrypt({name:"AES-GCM",iv:y},h,u)),A=new Uint8Array(45+_.length);return A[0]=1,A.set(f,1),A.set(y,33),A.set(_,45),btoa(String.fromCharCode(...A)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}}async function xO(e,t){const n=Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/")),i=>i.charCodeAt(0));try{const i=new TextDecoder().decode(n),o=JSON.parse(i);if(o._m){try{o.memo=atob(o._m).replace(/\x00+$/,"")||void 0}catch{}delete o._m}return o}catch{}if(n[0]===1){const i=n.slice(1,33),o=n.slice(33,45),l=n.slice(45),u=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"}
46,!1,["decrypt"]),f=await crypto.subtle.decrypt({name:"AES-GCM",iv:o},u,l),h=JSON.parse(new TextDecoder().decode(f));if(h._m){try{h.memo=atob(h._m).replace(/\x00+$/,"")||void 0}catch{}delete h._m}return h}throw new Error("Note is encrypted but no viewing secret provided")}async function yU(e){const t=async f=>{const h=new TextEncoder().encode(e+f),y=await crypto.subtle.digest("SHA-256",h);return Array.from(new Uint8Array(y),_=>_.toString(16).padStart(2,"0")).join("")},n=await t("zkard_ivk_v1"),i=await t("zkard_ovk_v1"),o=new TextEncoder().encode(n+i+"zkard_fvk_v1"),l=await crypto.subtle.digest("SHA-256",o),u=Array.from(new Uint8Array(l),f=>f.toString(16).padStart(2,"0")).join("");return{ivk:n,ovk:i,fvk:u}}async function wU(e=400,t=3200){const n=new Uint32Array(1);crypto.getRandomValues(n);const i=e+n[0]%(t-e);await new Promise(o=>setTimeout(o,i))}const EO="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function SO(e){let t=0;for(const o of e){if(o!==0)break;t++}let n=0n;for(const o of e)n=n*256n+BigInt(o);let i="";for(;n>0n;)i=EO[Number(n%58n)]+i,n/=58n;return"1".repeat(t)+i}async function AO(e,t){const n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,t,!1);const i=await crypto.subtle.importKey("raw",new TextEncoder().encode(e),"HKDF",!1,["deriveKey"]),o=await crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new TextEncoder().encode("zkard_child_addr_v1"),info:n},i,{name:"AES-GCM",length:256},!0,["encrypt"]),l=new Uint8Array(await crypto.subtle.exportKey("raw",o));return"zkca1"+SO(l)}async function bU(e,t){return Promise.all(Array.from({length:t},(n,i)=>AO(e,i)))}const Zx=/^[1-9A-HJ-NP-Za-km-z]{32,44}$/;function _O(e){const t=(e??"").trim();if(!t)return null;if(t.toLowerCase().startsWith("solana:")){const n=t.slice(7),i=n.indexOf("?"),o=decodeURIComponent(i===-1?n:n.slice(0,i));if(!Zx.test(o))return null;const l=new URLSearchParams(i===-1?"":n.slice(i+1)),u=l.get("amount"),f=u!=null?parseFloat(u):void 0;return{recipient:o,amount:f!=null&&!Number.isNaN(f)&&f>0?f:void 0,splToken:l.get("spl-token")??void 0,label:l.get("label")??void 0,message:l.get("message")??void 0}}return Zx.test(t)?{recipient:t}:null}function IO(){const e=window;return!!(e.phantom?.solana??e.solana)}function vU(){try{return L1()&&!IO()}catch{return!1}}function TO(e,t,n){const i=new URLSearchParams;t&&i.set("amount",t),n&&i.set("spl-token",n);const o=i.toString();return`solana:${e}${o?`?${o}`:""}`}function xU(e,t,n){const i=TO(e,t,n),o=`${window.location.origin}/#/pay/${encodeURIComponent(i)}`;return W2("flexpay",o)}function RO(){const e=decodeURIComponent(window.location.hash).match(/^#\/pay\/(\S+)/);if(!e)return null;try{return _O(decodeURIComponent(e[1]))}catch{return null}}const CO=21888242871839275222246405745257275088548364400416034343698204186575808495617n,MO=20,BO="Flex Privacy $FLEX discount key v1. Only sign this on flexprivacy.net.";function DO(e){return"zkard:flex-discount-register:v1:"+e}const z6=e=>new TextEncoder().encode(e);function Q1(e){let t="";for(const n of e)t+=n.toString(16).padStart(2,"0");return(BigInt("0x"+(t||"0"))%CO).toString()}function OO(e,t){return Q1(ou(z6("flex-fee:v1:"+e+":"+t)))}function NO(e){return Q1(ou(z6(e)))}function kO(e){const t=Q1(ou(e));return t==="0"?"1":t}function UO(e,t,n){if(!Number.isInteger(t)||t<0||t>=e.length)throw new RangeError("Leaf is not in the tree");let i="0",o=e.slice(),l=t;const u=[],f=[];for(let h=0;h<MO;h++){const y=l^1;u.push(y<o.length?o[y]:i),f.push(l&1),l=Math.floor(l/2);const _=[];for(let A=0;A<o.length;A+=2)_.push(n(o[A],A+1<o.length?o[A+1]:i));o=_,i=n(i,i)}return{root:o[0],pathElements:u,pathIndices:f}}function jO(e,t,n,i,o,l){return{discount_tree_root:n,discount_nullifier:l,claim_token_hash_field:t,wallet_secret:e,path_elements:i,path_indices:o}}const em="zkard_flex_discount_v1",tm="zkard_flex_discount_tree_v1",LO="This wallet can't make a stable discount key.",zO="This wallet was registered with another key.",EU="The $FLEX discount is off right now.",PO="Could not check your $FLEX discount. Try again.",HO=7*36e5,VO=[5e3,12e4],FO=6*36e5,Jx=30*6e4,Sd=e=>typeof e=="string"&&/^\d{1,80}$/.test(e);function P6(e){try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function H6(e,t){try{return localStorage.setItem(e,JSON.stringify(t)),!0}catch{return!1}}function nm(){const e=P6(em);return!e||typeof e.wallet!="string"||!Sd(e.secret)||!Sd(e.commitment)?null:{wallet:e.wallet,secret:e.secret,commitment:e.commitment}}function V6(e){const t=e;return!t||!Sd(t.root)||typeof t.created_at!="string"||!Number.isSafeInteger(t.leaf_count)||!Number.isSafeInteger(t.min_holders)||!Array.isArray(t.leaves)||t.leaves.length!==t.leaf_count||!t.leaves.every(Sd)?null:{root:t.root,created_at:t.created_at,leaf_count:t.leaf_count,min_holders:t.min_holders,leaves:t.leaves}}function F6(){return V6(P6(tm))}function K6(e,t){const n=Date.parse(e.created_at);return Number.isFinite(n)&&t-n<HO}function KO(e,t,n,i){const o={feeBps:e?.feeBps??null,discountBps:e?.discountBps??null};return e?.discountActive?t?!!n&&K6(n,i)&&n.leaves.includes(t.commitment)?n.leaf_count<n.min_holders?{...o,active:!0,qualifying:!1,status:"too_few_holders"}:{...o,active:!0,qualifying:!0,status:"qualifying"}:{...o,active:!0,qualifying:!1,status:"waiting"}:{...o,active:!0,qualifying:!1,status:"unregistered"}:{...o,active:!1,qualifying:!1,status:"off"}}async function SU(){const e=H1(await Rl());return KO(e,nm(),F6(),Date.now())}const qO={commit:e=>X1([e,0]),register:eO}
46,Xx=e=>new TextEncoder().encode(e);function $O(e,t){return e.length===t.length&&e.every((n,i)=>n===t[i])}async function AU(e,t,n=qO){const i=Xx(BO),o=new Uint8Array((await e(i)).signature),l=new Uint8Array((await e(i)).signature);if(o.length===0||!$O(o,l))throw new Error(LO);const u=kO(o),f=await n.commit(u),{signature:h}=await e(Xx(DO(f))),y=await n.register({commitment:f,wallet_pubkey:t,signature:t6(new Uint8Array(h))});if(!y.ok||!y.data.success||y.data.data?.registered!==!0){const A=y.data.error||y.data.message||`Registration failed (HTTP ${y.status})`;throw new Error(/different commitment/i.test(A)?zO:A)}const _={wallet:t,secret:u,commitment:f};if(!H6(em,_))throw new Error("Couldn't save the key on this device.");return G6(),_}function _U(){Ms&&clearTimeout(Ms),Ms=null;for(const e of[em,tm])try{localStorage.removeItem(e)}catch{}}async function WO(){const e=await tO(),t=e.ok&&e.data.success?V6(e.data.data):null;return t&&H6(tm,t),t}let Ms=null,cg=!1;function q6(e,t){const n=new Uint32Array(1);return crypto.getRandomValues(n),e+n[0]/2**32*(t-e)}async function $6(){return!!H1(await Rl())?.discountActive&&!!nm()}async function W6(){if(Ms=null,!!await $6()){try{await WO()}catch{}Ms||(Ms=setTimeout(W6,FO+q6(-Jx,Jx)))}}function G6(){Ms||cg||(cg=!0,$6().then(e=>{e&&!Ms&&(Ms=setTimeout(W6,q6(...VO)))}).catch(()=>{}).finally(()=>{cg=!1}))}const GO={config:async()=>H1(await Rl()),identity:nm,tree:F6,now:()=>Date.now(),hash2:async()=>{const e=await j6();return(t,n)=>e.F.toObject(e([BigInt(t),BigInt(n)])).toString()},prove:async e=>{if(typeof snarkjs>"u")throw new Error("snarkjs not loaded");return snarkjs.groth16.fullProve(e,"/zk/flex_discount.wasm","/zk/flex_discount_final.zkey")}};async function IU(e,t=GO){try{if(!(await t.config())?.discountActive)return null;const n=t.identity();if(!n)return null;const i=t.tree();if(!i||!K6(i,t.now())||i.leaf_count<i.min_holders)return null;const o=i.leaves.indexOf(n.commitment);if(o<0)return null;const l=await t.hash2(),u=UO(i.leaves,o,l);if(u.root!==i.root)return null;const f="claimToken"in e?NO(e.claimToken):OO(e.kind,e.reference),h=l(n.secret,f),y=jO(n.secret,f,i.root,u.pathElements,u.pathIndices,h),{proof:_,publicSignals:A}=await t.prove(y);return{discount_proof:JSON.stringify(_),discount_signals:A.map(String)}}catch{return null}}async function TU(e,t){const n=await nO({kind:"deposit",reference:e,...t}),i=n.data.data?.fee_bps;return n.ok&&n.data.success&&Number.isInteger(i)?{feeBps:i}:{refused:n.data.error||n.data.message||PO}}function Y6(){return Me.useSyncExternalStore(rD,d6)}function Z6({pairing:e,onCancel:t}){const[n,i]=Me.useState(!1),o=n==="failed"?"Couldn't copy":n?"Copied":"Copy link";async function l(u){try{await navigator.clipboard.writeText(u),i(!0)}catch{i("failed")}}return w.jsxs(w.Fragment,{children:[e?.uri?e.mobile?w.jsxs(w.Fragment,{children:[w.jsx("p",{className:"onb-modal-text",children:"Open your wallet app to connect."}),w.jsxs("div",{className:"onb-modal-actions",children:[w.jsx("a",{className:"onb-modal-btn onb-modal-btn--primary",href:e.uri,children:"Open wallet"}),w.jsx("button",{type:"button",className:"onb-modal-btn",onClick:()=>l(e.uri),children:o})]})]}):w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"onb-modal-qr",children:e.qr?w.jsx("img",{src:e.qr,alt:"WalletConnect QR code",width:220,height:220}):w.jsx(Jc,{})}),w.jsx("p",{className:"onb-modal-text onb-modal-text--center",children:"Scan with your phone wallet."})]}):w.jsxs("p",{className:"onb-modal-text onb-modal-wait",children:[w.jsx(Jc,{})," Startingâ¦"]}),w.jsx("div",{className:"onb-modal-actions",children:w.jsx("button",{type:"button",className:"onb-modal-btn",onClick:t,children:"Cancel"})})]})}function YO(){const e=Y6(),t=Me.useRef(null),n=e!==null&&!e.inline;return Me.useEffect(()=>{if(!n)return;const i=document.activeElement instanceof HTMLElement?document.activeElement:null;t.current?.focus();const o=l=>{l.key==="Escape"&&wa()};return window.addEventListener("keydown",o),()=>{window.removeEventListener("keydown",o),i?.focus()}},[n]),n?w.jsx("div",{className:"onb-modal onb-modal--app",onClick:wa,children:w.jsxs("div",{className:"onb-modal-card",role:"dialog","aria-modal":"true","aria-labelledby":"wc-prompt-title",onClick:i=>i.stopPropagation(),children:[w.jsxs("div",{className:"onb-modal-head",children:[w.jsx("span",{className:"onb-modal-title",id:"wc-prompt-title",children:"WalletConnect"}),w.jsx("button",{ref:t,type:"button",className:"onb-modal-close",onClick:wa,"aria-label":"Close",title:"Close",children:w.jsx(es,{name:"close",size:20})})]}),w.jsx(Z6,{pairing:e,onCancel:wa})]})}):null}function Qx(e){return e.name}function ug(e){return/user rejected|reject|cancel|denied|declin/i.test(e)}function ZO(e){if(e instanceof Uint8Array)return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("");if(/^[0-9a-fA-F]{128}$/.test(e))return e;try{const t=atob(e);return Array.from(t).map(n=>n.charCodeAt(0).toString(16).padStart(2,"0")).join("")}catch{return e}}function JO({onLogin:e}){const[t,n]=Me.useState(null),[i,o]=Me.useState(null),[l,u]=Me.useState(null),[f,h]=Me.useState(!1),[y,_]=Me.useState(""),[A,D]=Me.useState([]),[U,L]=Me.useState(void 0),[k,j]=Me.useState(!1),M=Y6(),W=Me.useRef(null),K=Me.useRef(null),[se,re]=Me.useState(!1),[te,pe]=Me.useState(!1),[we,X]=Me.useState({x:0,y:0}),Z=Me.useRef(e),ae=Me.useRef(null);Me.useEffect(()=>{Z.current=e},[e]);const{isConnected:ce,phantomAddress:N,connect:g,isExternal:v,phantom:E}=b6(),B=Me.useRef(!1),z=Me.useRef(0);Me.useEffect(()=>{new URLSearchParams(window.location.search).get("response_type")==="failure"&&(o("Social login failed. Try the Phantom extension."),window.history.replaceState(null,"",window.location.pathname))},[]),Me.useEffect(()=>{!ce||!N||v||B.current||(B.current=!0,Xf(),O(N,E.signMessage,"Phantom","phantom"))},[ce,N,v]),Me.useEffect(()=>{const Fe=()=>D(s6().map(qe=>({name:qe.name,icon:qe.icon})));return Fe(),a6(Fe)},[]),Me.useEffect(()=>{let Fe=!1;return Rl().then(qe=>{if(Fe)return;const Yt=qe.walletconnect_project_id;L(typeof Yt=="string"&&Yt.trim()?Yt.trim():null)}),()=>{Fe=!0}},[]);const G=l!==null;Me.useEffect(()=>{if(!G)return;const Fe=qe=>{qe.key==="Escape"&&m()};return window.addEventListener("keydown",Fe),()=>window.removeEventListener("keydown",Fe)},[G]);const J=l?.view;Me.useEffect(()=>{J&&W.current?.focus()},[J]),Me.useEffect(()=>()=>{d6()?.inline&&wa()},[]);function T(){K.current=document.activeElement instanceof HTMLElement?document.activeElement:null,u({view:"list"})}function m(){wa(),j(!1),u(null),K.current?.focus(),K.current=null}
46function b(Fe){const qe=Fe.provider.signMessage;return qe?O(Fe.address,Yt=>qe(Yt),Qx(Fe),"external"):(o("This wallet can't sign in."),B.current=!1,Promise.resolve())}async function O(Fe,qe,Yt,Wt){const H=z.current,S=()=>H!==z.current;n(Wt==="phantom"?"phantom":"other"),_(Yt),o(null),h(!0);try{const I=await fetch("/api/v1/auth/wallet/challenge",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pubkey:Fe})}),Y=xd(I.status,await I.text(),Hx).body;if(S())return;if(!I.ok||!Y.success||!Y.data){o(Y.error||"Couldn't start sign-in. Try again."),B.current=!1,h(!1),n(null);return}const{message:ge,nonce:be}=Y.data,Re=new TextEncoder().encode(ge);console.log(`[Flex Privacy auth] signMessage via ${Wt==="phantom"?"Phantom Connect":"another wallet"}, address:`,Fe);const{signature:ft}=await qe(Re);if(S())return;const dt=ZO(ft);console.log("[Flex Privacy auth] POST /api/v1/auth/wallet");const rt=await fetch("/api/v1/auth/wallet",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(tD(Wt,Fe,dt,ge,be))}),Zt=xd(rt.status,await rt.text(),Hx).body;if(console.log("[Flex Privacy auth] auth response:",rt.status,Zt.success===!0),S())return;if(rt.ok&&Zt.success&&Zt.data){const{token:pt,user:gn}=Zt.data;Dc(pt),Z.current(pt,gn);return}o(Zt.error||"Sign-in failed. Try again."),B.current=!1}catch(I){if(S())return;const Y=I instanceof Error?I.message:String(I);console.error("[Flex Privacy auth] error:",Y),ug(Y)?o(`Cancelled. Approve in ${Yt} to continue.`):o(Y||"Couldn't connect. Try again."),B.current=!1}h(!1),n(null)}async function P(){if(o(null),await Xf(),E.isConnected&&E.address&&!B.current){B.current=!0,await O(E.address,E.signMessage,"Phantom","phantom");return}try{await g()}catch(Fe){const qe=Fe instanceof Error?Fe.message:String(Fe);o(qe||"Couldn't open Phantom. Try again.")}}function ne(Fe){if(!ae.current)return;const qe=ae.current.getBoundingClientRect();X({x:Math.max(-1,Math.min(1,(Fe.clientX-qe.left-qe.width/2)/(qe.width/2))),y:Math.max(-1,Math.min(1,(Fe.clientY-qe.top-qe.height/2)/(qe.height/2)))})}function ue(){te||(pe(!0),setTimeout(()=>pe(!1),900))}function Te(){z.current++,B.current=!1,n(null),h(!1),o(null),Xf()}function ve(Fe){B.current||(B.current=!0,b(Fe))}async function Xe(Fe){m();const qe=z.current;o(null),n("other"),_(Fe),h(!1);try{const Yt=await w6(Fe);if(qe!==z.current)return;if(Yt){B.current||(B.current=!0,await b(Yt));return}}catch(Yt){if(qe!==z.current)return;const Wt=Yt instanceof Error?Yt.message:String(Yt);o(ug(Wt)?`Cancelled. Approve in ${Fe} to continue.`:Wt||`Couldn't connect ${Fe}. Try again.`)}n(null)}function mt(Fe){const qe=JB(Fe,A.map(Wt=>Wt.name),QB()),{name:Yt}=qd[Fe];switch(qe.kind){case"connect":Xe(qe.walletName);return;case"open":window.location.href=qe.url;return;case"copy":u({view:"note",title:Yt,note:qe.note,copyLink:qe.link});return;case"install":u({view:"note",title:Yt,note:qe.note,installUrl:qe.url})}}async function He(){if(U){o(null),j(!1),u({view:"wc"});try{const Fe=await h6({inline:!0});lD(Fe),u(null),B.current||(B.current=!0,await b(Fe))}catch(Fe){if(Fe instanceof Jf)return;const qe=Fe instanceof Error?Fe.message:String(Fe);u(null),o(ug(qe)?"Cancelled. Approve in your wallet to continue.":qe||"Couldn't connect. Try again.")}}}async function At(Fe){try{await navigator.clipboard.writeText(Fe),j(!0)}catch{j("failed")}}const tt=k==="failed"?"Couldn't copy":k?"Copied":"Copy link",Rt=t===null&&v&&ce?Zc():null,qn=t==="other"&&f?Zc():null,Bt=qn?.kind==="walletconnect"?qn:null,Ze=w.jsx("span",{className:"onb-chev","aria-hidden":"true",children:w.jsxs("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"none",stroke:"currentColor",strokeWidth:2.2,strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("path",{d:"M5 12h14"}),w.jsx("path",{d:"m13 6 6 6-6 6"})]})}),an=w.jsx("svg",{viewBox:"0 0 24 24",width:"17",height:"17",fill:"currentColor","aria-hidden":"true",children:w.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24h-6.66l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}),jt=w.jsxs("svg",{viewBox:"0 0 100 115",width:"26",height:"30",children:[w.jsx("path",{d:"M50 6 C22 6 10 27 10 50 L10 90 Q16.5 80 23 90 Q29.5 100 36 90 Q42.5 80 50 90 Q57.5 80 64 90 Q70.5 100 77 90 Q83.5 80 90 90 L90 50 C90 27 78 6 50 6 Z",fill:"#06140a"}),w.jsx("circle",{cx:"36",cy:"48",r:"6",fill:"#b6f520"}),w.jsx("circle",{cx:"64",cy:"48",r:"6",fill:"#b6f520"}),w.jsx("circle",{cx:"38",cy:"50",r:"3",fill:"#06140a"}),w.jsx("circle",{cx:"66",cy:"50",r:"3",fill:"#06140a"})]}),Lt=w.jsxs("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"#06140a",strokeWidth:2,strokeLinejoin:"round",children:[w.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6H18a1 1 0 0 0 0-2H6"}),w.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a1 1 0 0 0 1-1v-9a1 1 0 0 0-1-1H5"}),w.jsx("circle",{cx:"16.5",cy:"12.5",r:"1.5",fill:"#06140a",stroke:"none"})]}),jn=[{id:"solflare",name:"Solflare",grad:"linear-gradient(150deg,#13b87a,#0a6b42)",icon:w.jsx("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"#fff",children:w.jsx("path",{d:"M12 2l2.2 5.6L20 9l-4.4 3.4L17 18l-5-3-5 3 1.4-5.6L4 9l5.8-1.4z"})})},{id:"walletconnect",name:"WalletConnect",grad:"linear-gradient(150deg,#0e8f5e,#065a3a)",icon:w.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"#fff",strokeWidth:2,children:[w.jsx("path",{d:"M6.4 8.8a8 8 0 0 1 11.2 0"}),w.jsx("path",{d:"M4 11.2a11.6 11.6 0 0 1 16 0"}),w.jsx("circle",{cx:"12",cy:"16",r:"1.5",fill:"#fff",stroke:"none"})]})},{id:"metamask",name:"MetaMask",grad:"linear-gradient(150deg,#b6f520,#7fb806)",icon:w.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"#06140a",strokeWidth:2,children:[w.jsx("polygon",{points:"12 2 22 7 22 17 12 22 2 17 2 7"}),w.jsx("polyline",{points:"2 7 12 12 22 7"}),w.jsx("line",{x1:"12",y1:"12",x2:"12",y2:"22"})]})},{id:"jupiter",name:"Jupiter",grad:"linear-gradient(150deg,#a8e90c,#13b87a)",icon:w.jsxs("svg",{viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"#06140a",strokeWidth:2.2,children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("path",{d:"M8 12c0-4 8-4 8 0s-8 4-8 0z"}),w.jsx("circle",{cx:"17",cy:"8",r:"1.5",fill:"#06140a"})]})}];return w.jsxs("main",{className:"auth",children:[w.jsx("div",{className:"auth-bg"}),w.jsxs("div",{className:"auth-split",children:[w.jsxs("div",{className:"auth-left",children:[w.jsx("div",{className:"onb-plate",children:w.jsx("img",{src:"/flex-privacy/assets/flex-lockup.png",alt:"Flex Privacy"})}),w.jsxs("h1",{className:"onb-headline",children:["Send"," ",w.jsxs("span",{className:"with-info",children:[w.jsx("span",{className:"g",children:"Privately"}),w.jsx(cl,{label:"Send privately",size:20,children:"Zero-knowledge proofs keep payments private."})]})]}),w.jsxs("div",{ref:ae,className:"onb-orbit",onMouseEnter:()=>re(!0),onMouseLeave:()=>{re(!1),X({x:0,y:0})},onMouseMove:ne,onClick:ue,style:{cursor:"pointer"},children:[w.jsx("div",{className:"onb-ring onb-ring--1",children:w.jsx("span",{className:"onb-sat onb-sat--lime"})}),w.jsx("div",{className:"onb-ticks"}),w.jsx("div",{className:"onb-ring onb-ring--2"}),w.jsx("div",{className:"onb-ring onb-ring--3"}),w.jsx("div",{className:"onb-ring onb-ring--4"}),w.jsx("span",{className:"onb-sat onb-sat--mint"}),w.jsx("div",{className:"onb-hud-tl"}),w.jsx("div",{className:"onb-hud-tr"}),w.jsx("div",{className:"onb-hud-bl"}),w.jsx("div",{className:"onb-hud-br"}),w.jsx("div",{className:"onb-scan"}),w.jsx("span",{className:"onb-data-tag onb-data-tag--n",children:"ZK-SNARK"}),w.jsx("span",{className:"onb-data-tag onb-data-tag--s",children:"GROTH16"}),w.jsx("span",{className:"onb-data-tag onb-data-tag--w",children:"Ïâ¡0"}),w.jsx("span",{className:"onb-data-tag onb-data-tag--e",children:"BN254"}),te&&w.jsx("div",{className:"onb-pulse-ring"}),w.jsxs("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)",display:"flex",alignItems:"center",justifyContent:"center"},children:[w.jsx("div",{style:{position:"absolute",inset:-14,borderRadius:"50%",background:`radial-gradient(circle at ${50+we.x*15}% ${50+we.y*15}%,rgba(200,255,46,${se?".34":".24"}),transparent 72%)`,animation:se?"none":"orbglow 2.6s ease-in-out infinite",pointerEvents:"none"}}),w.jsx("div",{style:{position:"relative",width:54,height:54,borderRadius:"50%",background:`radial-gradient(circle at ${35-we.x*8}
46% ${30-we.y*8}%,#f2ff9e,#c8ff2e 42%,#1fe39a 82%)`,boxShadow:se?"0 0 0 6px rgba(200,255,46,.3),0 0 34px rgba(200,255,46,.85),0 0 70px rgba(31,227,154,.45)":"0 0 0 5px rgba(200,255,46,.2),0 0 26px rgba(200,255,46,.6),0 0 54px rgba(31,227,154,.3)",transition:"box-shadow .2s"},children:w.jsx("div",{style:{position:"absolute",width:18,height:18,borderRadius:"50%",background:"rgba(255,255,255,.55)",filter:"blur(5px)",top:`${16-we.y*6}%`,left:`${20-we.x*6}%`,transition:"top .06s, left .06s"}})})]}),w.jsx("div",{className:"onb-orb-status",children:"SHIELD ACTIVE"})]}),w.jsxs("div",{className:"onb-badges",children:[w.jsx("span",{className:"onb-badge",children:"Groth16 · BN254"}),w.jsx("span",{className:"onb-badge",children:"Circom"}),w.jsx("span",{className:"onb-badge",children:"Solana"})]})]}),w.jsxs("div",{className:"auth-right",children:[w.jsxs("div",{className:"auth-right-head",children:[w.jsx("h2",{children:"Connect wallet"}),w.jsx("p",{children:"We never get your private key."})]}),i&&w.jsx("div",{style:{width:"100%",maxWidth:540,margin:"0 0 14px",padding:"10px 14px",background:"rgba(255,69,58,0.12)",border:"1px solid rgba(255,69,58,0.3)",borderRadius:10,fontSize:"var(--fs-base)",color:"var(--neg)"},children:i}),w.jsxs("div",{className:"auth-bottom",children:[Rt&&w.jsxs("div",{className:"onb-wallet stretch-host",children:[w.jsx("span",{className:"onb-wicon",style:{background:"linear-gradient(150deg,#1fe39a,#0c8a5a)"},children:Lt}),w.jsx("span",{className:"onb-wtxt",children:w.jsx("span",{className:"onb-wtitle",children:w.jsxs("button",{type:"button",className:"stretch-btn",onClick:()=>ve(Rt),children:["Continue with ",Qx(Rt)]})})}),Ze]}),w.jsxs("div",{className:"onb-wallet onb-wallet--primary stretch-host",children:[w.jsx("span",{className:"onb-wicon",style:{background:"linear-gradient(150deg,#d4ff4a,#1fe39a)"},children:jt}),w.jsx("span",{className:"onb-wtxt",children:w.jsxs("span",{className:"onb-wtitle with-info",children:[w.jsx("button",{type:"button",className:"stretch-btn",onClick:P,disabled:t!==null,children:t==="phantom"?f?"Approve in Phantomâ¦":"Connectingâ¦":"Phantom"}),w.jsx(cl,{label:"Phantom",children:"Most popular Solana wallet."})]})}),t==="phantom"?w.jsx(Jc,{}):Ze]}),w.jsxs("div",{className:"onb-wallet stretch-host",children:[w.jsx("span",{className:"onb-wicon",style:{background:"linear-gradient(150deg,#1fe39a,#0c8a5a)"},children:Lt}),w.jsx("span",{className:"onb-wtxt",children:w.jsxs("span",{className:"onb-wtitle with-info",children:[w.jsx("button",{type:"button",className:"stretch-btn",onClick:T,disabled:t!==null,children:t==="other"?f?`Approve in ${y}â¦`:"Connectingâ¦":"Other wallets"}),w.jsx(cl,{label:"Other wallets",children:"Solflare, WalletConnect, MetaMask, Jupiter and other Solana wallets."})]})}),t==="other"?w.jsx(Jc,{}):Ze]}),t==="other"&&w.jsxs("div",{className:"onb-pending",children:[Bt&&w.jsx("span",{className:"onb-pending-text",children:Bt.openUrl||P1()?"Open your wallet app to approve.":"Approve on your phone."}),Bt?.openUrl&&w.jsx("a",{className:"onb-pending-btn",href:Bt.openUrl,...Bt.openUrl.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},children:"Open wallet"}),w.jsx("button",{type:"button",className:"onb-pending-btn",onClick:Te,children:"Cancel"})]}),w.jsx("p",{className:"onb-finep",children:"By connecting, you agree to use the Flex shielded pool."}),w.jsxs("a",{className:"onb-social",href:"https://x.com/FlexPrivacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Follow Flex Privacy on X",children:[an,w.jsx("span",{children:"Follow @FlexPrivacy"})]})]})]})]}),l&&w.jsx("div",{className:"onb-modal",onClick:m,children:w.jsxs("div",{className:"onb-modal-card",role:"dialog","aria-modal":"true","aria-labelledby":"onb-sheet-title",onClick:Fe=>Fe.stopPropagation(),children:[w.jsxs("div",{className:"onb-modal-head",children:[w.jsx("span",{className:"onb-modal-title",id:"onb-sheet-title",children:l.view==="list"?"Other wallets":l.view==="wc"?"WalletConnect":l.title}),w.jsx("button",{ref:W,type:"button",className:"onb-modal-close",onClick:m,"aria-label":"Close",title:"Close",children:w.jsx(es,{name:"close",size:20})})]}),l.view==="list"&&w.jsxs(w.Fragment,{children:[jn.map(Fe=>{const qe=Fe.id==="walletconnect"&&!U;return w.jsxs("button",{type:"button",className:"onb-modal-item",onClick:()=>Fe.id==="walletconnect"?He():mt(Fe.id),disabled:t!==null||qe,children:[w.jsx("span",{className:"onb-modal-icon",style:{background:Fe.grad},children:Fe.icon}),w.jsx("span",{className:"onb-modal-name",children:Fe.name}),Fe.id==="walletconnect"&&U===null?w.jsx("span",{className:"onb-modal-note",children:"Not set up yet."}):Ze]},Fe.id)}),XB(A.map(Fe=>Fe.name)).map(Fe=>{const qe=A.find(Yt=>Yt.name===Fe)?.icon;return w.jsxs("button",{type:"button",className:"onb-modal-item",onClick:()=>Xe(Fe),disabled:t!==null,children:[w.jsx("span",{className:"onb-modal-icon onb-modal-icon--img",children:qe&&w.jsx("img",{src:qe,alt:"",width:40,height:40})}),w.jsx("span",{className:"onb-modal-name",children:Fe}),Ze]},Fe)})]}),l.view==="note"&&w.jsxs(w.Fragment,{children:[w.jsx("p",{className:"onb-modal-text",children:l.note}),w.jsxs("div",{className:"onb-modal-actions",children:[l.installUrl&&w.jsx("a",{className:"onb-modal-btn onb-modal-btn--primary",href:l.installUrl,target:"_blank",rel:"noopener noreferrer",children:"Install"}),l.copyLink&&w.jsx("button",{type:"button",className:"onb-modal-btn onb-modal-btn--primary",onClick:()=>At(l.copyLink),children:tt}),w.jsx("button",{type:"button",className:"onb-modal-btn",onClick:()=>{j(!1),u({view:"list"})},children:"Back"})]})]}),l.view==="wc"&&w.jsx(Z6,{pairing:M,onCancel:()=>{wa(),u({view:"list"})}})]})})]})}class J6 extends iE.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error(`[${this.props.scope}] render error:`,t,n.componentStack),Kg(t)&&u6()}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}
46render(){if(!this.state.error)return this.props.children;const t=Kg(this.state.error);return w.jsx("div",{role:"alert",style:{minHeight:this.props.scope==="app"?"100vh":240,display:"flex",alignItems:"center",justifyContent:"center",padding:24,color:"var(--text-primary, #f4f4f5)"},children:w.jsxs("div",{style:{maxWidth:380,textAlign:"center"},children:[w.jsx("div",{style:{fontWeight:700,fontSize:20,marginBottom:8},children:"Something went wrong"}),w.jsx("p",{style:{margin:"0 0 18px",color:"var(--text-secondary, #a1a1aa)",lineHeight:1.5},children:t?"Flex was updated. Reload for the new version.":"Reloading usually fixes it."}),w.jsx("button",{onClick:c6,style:{padding:"12px 28px",borderRadius:12,border:"none",cursor:"pointer",fontWeight:700,fontSize:16,background:"var(--green-400, #a3e635)",color:"#0a0a0a"},children:"Reload"}),w.jsx("p",{style:{margin:"18px 0 0",fontSize:12,color:"var(--text-muted, #71717a)",wordBreak:"break-word"},children:this.state.error.message.slice(0,200)})]})})}}const XO={home:"Dashboard",send:"Send Privately",swap:"Swap",cards:"Cards",more:"More",claim:"Claim Funds",receive:"Receive",streams:"Streams",offramp:"Off-Ramp",banking:"Banking",proofs:"ZK Proofs",activity:"Activity",tx:"Activity",docs:"Docs",settings:"Settings",profile:"Profile",notifications:"Notifications",scan:"Scan",vault:"Private Vault",claimdenom:"Claim",pay:"Flex Pay",pools:"Liquidity Pools",ceremony:"Trusted Setup"};function Kn(e){return Me.lazy(()=>z1(e))}const eE=Kn(()=>Dn(()=>import("./Dashboard-8lB-xNUa.js"),__vite__mapDeps([4,5,6,7,8])).then(e=>({default:e.Dashboard}))),QO=Kn(()=>Dn(()=>import("./PrivateSend-D0vosNmc.js"),__vite__mapDeps([9,10,11,12,7,13,8,14,15])).then(e=>({default:e.PrivateSend}
46))),e9=Kn(()=>Dn(()=>import("./ClaimFunds-aSvr7GOn.js"),__vite__mapDeps([16,14,15,13,8,17])).then(e=>({default:e.ClaimFunds}))),t9=Kn(()=>Dn(()=>import("./Streams-D8z2QHam.js"),__vite__mapDeps([18,10,17,14])).then(e=>({default:e.Streams}))),n9=Kn(()=>Dn(()=>import("./Cards-B3ki-rAv.js"),__vite__mapDeps([19,20,11])).then(e=>({default:e.Cards}))),r9=Kn(()=>Dn(()=>import("./OffRamp-DOxl9M12.js"),__vite__mapDeps([21,10,22,8,17,13,14])).then(e=>({default:e.OffRamp}))),i9=Kn(()=>Dn(()=>import("./Transactions-DcjPbIwX.js"),[]).then(e=>({default:e.Transactions}))),s9=Kn(()=>Dn(()=>import("./Banking-CMwimUOu.js"),__vite__mapDeps([23,20])).then(e=>({default:e.Banking}))),a9=Kn(()=>Dn(()=>import("./ZKProofs-D1uWw-hd.js"),[]).then(e=>({default:e.ZKProofs}))),o9=Kn(()=>Dn(()=>import("./Ceremony-YwfZNq_U.js"),__vite__mapDeps([24,5])).then(e=>({default:e.Ceremony}))),l9=Kn(()=>Dn(()=>import("./Docs-D_xotZxo.js"),[]).then(e=>({default:e.Docs}))),c9=Kn(()=>Dn(()=>import("./DeFiSwap-CPAQGjaC.js"),__vite__mapDeps([25,10,14,15,13,8,6,7,17,22,26,27])).then(e=>({default:e.DeFiSwap}))),u9=Kn(()=>Dn(()=>import("./LiquidityPools-Cy_DxROV.js"),__vite__mapDeps([28,7,8])).then(e=>({default:e.LiquidityPools}))),f9=Kn(()=>Dn(()=>import("./DenomVault-DROeH09V.js").then(e=>e.b),__vite__mapDeps([12,10,7,13,8,14,15])).then(e=>({default:e.DenomVault}))),d9=Kn(()=>Dn(()=>import("./ClaimDenom-CnEsvbhz.js"),__vite__mapDeps([29,12,10,7,13,8,14,15])).then(e=>({default:e.ClaimDenom}))),h9=Kn(()=>Dn(()=>import("./ScreenMore-D2tA-u_A.js"),[]).then(e=>({default:e.ScreenMore}))),p9=Kn(()=>Dn(()=>import("./ScreenReceive-0hDlpoQD.js"),__vite__mapDeps([30,2,31,32,27,8,17,13])).then(e=>({default:e.ScreenReceive}))),g9=Kn(()=>Dn(()=>import("./ScreenSettings-D974tv-b.js"),__vite__mapDeps([33,17,31])).then(e=>({default:e.ScreenSettings}))),m9=Kn(()=>Dn(()=>import("./ScreenProfile-BRexka9N.js"),[]).then(e=>({default:e.ScreenProfile}))),y9=Kn(()=>Dn(()=>import("./ScreenNotifications-8erfms-A.js"),[]).then(e=>({default:e.ScreenNotifications}))),w9=Kn(()=>Dn(()=>import("./ScreenScan-Cjwhqy7c.js"),[]).then(e=>({default:e.ScreenScan}))),b9=Kn(()=>Dn(()=>import("./ScreenPay-Fsjg026E.js"),__vite__mapDeps([34,17,32,27,31,26])).then(e=>({default:e.ScreenPay}))),v9=Kn(()=>Dn(()=>import("./ScreenTxDetail-BnaqJxs-.js"),[]).then(e=>({default:e.ScreenTxDetail}))),fg={id:"",username:"",email:"",zk_commitment:"",created_at:""},x9=6e3,E9=3e4,S9=["home","send","swap","claim","more"],tE=["claimdenom","claim","pay"];function nE(){return w.jsxs("div",{className:"content",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10,minHeight:240,color:"var(--text-secondary)",fontSize:"var(--fs-base)",letterSpacing:"0.01em"},role:"status","aria-live":"polite",children:[w.jsx(Jc,{size:16}),w.jsx("span",{children:"Loadingâ¦"})]})}async function A9(){const t=decodeURIComponent(window.location.hash).match(/^#\/claim\/([^|\s]+)(?:\|(\S+))?/);if(!t)return null;let n=null;if(t[2])try{n=await xO(t[2])}catch{}return{token:t[1],note:n}}function _9(){const[e,t]=Me.useState(XD()),[n,i]=Me.useState(null),o=Me.useRef(0),[l,u]=Me.useState(),[f,h]=Me.useState(),[y,_]=Me.useState(),[A,D]=Me.useState(),[U,L]=Me.useState(null),[k,j]=Me.useState("https://api.mainnet-beta.solana.com"),[M,W]=Me.useState({name:"auth"}),[K,se]=Me.useState([]),re=Me.useCallback((ve,Xe)=>{W(mt=>(se(He=>[...He,mt]),{name:ve,arg:Xe}))},[]),te=Me.useCallback(()=>{se(ve=>{if(ve.length===0)return ve;const Xe=ve[ve.length-1];return W(Xe),ve.slice(0,-1)})},[]),pe=S9.includes(M.name)?M.name:null,we=ve=>{const Xe=ve==="home"?"home":ve;se([]),W({name:Xe})},{toasts:X,toast:Z,removeToast:ae}=bO(),{isConnected:ce,phantomAddress:N,connect:g,disconnect:v,walletName:E,isExternal:B}=b6();Me.useEffect(()=>{const ve=document.documentElement;ve.setAttribute("data-accent","solana"),ve.setAttribute("data-density","comfortable"),ve.setAttribute("data-direction","aurora"),oO(J1())},[]),Me.useEffect(()=>{uD(nD(n?.email))},[n]),Me.useEffect(()=>{G6()},[]),Me.useEffect(()=>{const ve=RO();if(ve){D(ve),re("pay"),window.history.replaceState(null,"",window.location.pathname);return}const Xe=decodeURIComponent(window.location.hash).match(/^#\/claim-denom\/(\S+)/);if(Xe){_(Xe[1]),re("claimdenom"),window.history.replaceState(null,"",window.location.pathname);return}A9().then(mt=>{mt&&(u(mt.token),mt.note&&h(mt.note),re("claim"),window.history.replaceState(null,"",window.location.pathname))})},[re]),Me.useEffect(()=>{if(!e)return;let ve=!1;return T(()=>ve),()=>{ve=!0}},[]);const z=Me.useRef(null),G=Me.useRef(!1),J=Me.useRef(0);Me.useEffect(()=>{n!==fg||M===z.current||G.current||Date.now()-J.current<E9||(G.current=!0,J.current=Date.now(),T(()=>!1,!0).finally(()=>{G.current=!1}))},[M]),Me.useEffect(()=>{if(!ce||!N){L(null);return}Rl().then(ve=>{if(!ve.solana_network)throw new Error("config unavailable");const Xe=ve.solana_network==="devnet"?"https://api.devnet.solana.com":"https://api.mainnet-beta.solana.com";return j(Xe),fetch(Xe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBalance",params:[N]})})}).then(ve=>ve.json()).then(ve=>{const Xe=ve.result?.value??0;L(Xe/1e9)}
46).catch(()=>{})},[ce,N]);async function T(ve,Xe=!1){const mt=o.current,He=()=>ve()||o.current!==mt,At=await yD(async()=>{const{status:tt,data:Rt}=await $t("/auth/me","GET",null,{timeoutMs:x9});return{status:tt,body:Rt}},tt=>new Promise(Rt=>setTimeout(Rt,tt)),Xe?[]:v6,He);if(!He())if(At.verdict==="valid")i(tt=>tt===null||tt===fg?At.user:tt),W(tt=>tt.name==="auth"?{name:"home"}:tt);else if(At.verdict==="unknown"){if(Xe)return;const tt={name:"home"};z.current=tt,i(Rt=>Rt??fg),W(Rt=>Rt.name==="auth"?tt:Rt)}else Dc(null),t(null),i(null),W(tt=>tE.includes(tt.name)?tt:{name:"auth"}),se(tt=>tE.includes(M.name)?tt:[])}function m(ve,Xe){o.current++,Dc(ve),t(ve),i(Xe),W({name:"home"}),Z("Welcome back! ZK system active.","success")}async function b(){try{await $t("/auth/logout","POST",{})}catch{}}async function O(){o.current++,await v(),await b(),Dc(null),t(null),i(null),W({name:"auth"}),se([]),Z("Signed out on all devices. Stay private.","info")}async function P(){o.current++;const ve=!B;if(await v(),ve)try{await g()}catch{}await b(),Dc(null),t(null),i(null),se([]),W({name:"auth"})}const ne=!!n&&!!pe,ue=!!n&&M.name!=="auth";let Te=null;return M.name==="claimdenom"?Te=w.jsx(d9,{go:re,back:te,toast:Z,encoded:y}):!n&&e?Te=w.jsx(nE,{}):!n||M.name==="auth"?Te=w.jsx(JO,{onLogin:m}):M.name==="home"?Te=w.jsx(eE,{go:re,walletSolBalance:U,walletAddress:N,isConnected:ce,username:n.username,toast:Z,onNavigate:ve=>re(ve)}):M.name==="send"?Te=w.jsx(QO,{go:re,back:te,toast:Z}):M.name==="swap"?Te=w.jsx(c9,{go:re,back:te,toast:Z,walletAddress:N,solanaRpcUrl:k,arg:M.arg}):M.name==="pools"?Te=w.jsx(u9,{go:re,back:te,toast:Z,walletAddress:N}):M.name==="vault"?Te=w.jsx(f9,{go:re,back:te,toast:Z,walletAddress:N}):M.name==="cards"?Te=w.jsx(n9,{go:re,back:te,toast:Z,username:n.username}):M.name==="more"?Te=w.jsx(h9,{go:re,onSignOut:O}):M.name==="claim"?Te=w.jsx(e9,{go:re,back:te,toast:Z,prefillToken:M.arg??l,prefillNote:f}):M.name==="receive"?Te=w.jsx(p9,{go:re,back:te,addr:N??n.username,solanaRpcUrl:k,toast:Z}):M.name==="streams"?Te=w.jsx(t9,{go:re,back:te,toast:Z}):M.name==="offramp"?Te=w.jsx(r9,{go:re,back:te,toast:Z,walletSolBalance:U}):M.name==="banking"?Te=w.jsx(s9,{go:re,back:te,toast:Z}):M.name==="proofs"?Te=w.jsx(a9,{go:re,back:te,toast:Z}):M.name==="ceremony"?Te=w.jsx(o9,{back:te}):M.name==="activity"?Te=w.jsx(i9,{go:re,back:te}):M.name==="tx"?Te=w.jsx(v9,{go:re,back:te,txId:M.arg}):M.name==="docs"?Te=w.jsx(l9,{go:re,back:te}):M.name==="settings"?Te=w.jsx(g9,{go:re,back:te,toast:Z}):M.name==="profile"?Te=w.jsx(m9,{go:re,back:te,addr:N??n.username,walletName:E,username:n.username,onSignOut:O}):M.name==="notifications"?Te=w.jsx(y9,{go:re,back:te}):M.name==="scan"?Te=w.jsx(w9,{go:re,back:te}):M.name==="pay"?Te=w.jsx(b9,{go:re,back:te,toast:Z,prefill:A}):Te=w.jsx(eE,{go:re,walletSolBalance:U,walletAddress:N,isConnected:ce,username:n.username,toast:Z,onNavigate:ve=>re(ve)}),w.jsxs("div",{className:"app-shell"+(ue?" app-shell--with-sidebar":"")+(M.name==="auth"?" app-shell--auth":""),"data-screen-label":M.name,children:[ue&&w.jsx(mO,{view:M.name,onTab:we,go:ve=>re(ve),address:N??void 0,onSwitchWallet:P,onDisconnect:O}),w.jsxs("div",{className:"app-frame"+(ne?" app-frame--with-tabs":"")+(ue?" app-frame--chrome":""),children:[ue&&w.jsx(yO,{title:XO[M.name]??"Flex Privacy",onBell:()=>re("notifications")}),w.jsx(J6,{scope:"screen",resetKey:M.name,children:w.jsx(Me.Suspense,{fallback:w.jsx(nE,{}),children:Te})}),ne&&w.jsx(pO,{active:pe,onChange:we})]}),w.jsx(iO,{toasts:X,onRemove:ae}),w.jsx(YO,{})]})}const I9={};window.Buffer=Tt.Buffer;const T9="ffae80a8-4875-4fb4-8e77-b8ee608dcbaa",R9="/auth/callback",rE=window.location.hash;function C9(){const e=I9??{};return{appId:e.VITE_PHANTOM_APP_ID||T9,redirectUrl:e.VITE_PHANTOM_REDIRECT_URL??`${window.location.origin}${R9}`}}async function M9(){const e=await Rl(),t={};return e.phantom_app_id&&(t.appId=String(e.phantom_app_id)),e.phantom_redirect_url&&(t.redirectUrl=String(e.phantom_redirect_url)),t}function B9(){rE&&window.history.replaceState(null,"",window.location.pathname+window.location.search+rE)}function D9(){const[e,t]=Me.useState(C9);Me.useEffect(()=>{let i=!1;return M9().then(o=>{i||!o||t(l=>{const u=o.appId??l.appId,f=o.redirectUrl??l.redirectUrl;return u===l.appId&&f===l.redirectUrl?l:(B9(),{appId:u,redirectUrl:f})})}),()=>{i=!0}},[]);const n=Me.useMemo(()=>({providers:e.appId?["injected","google","apple"]:["injected"],appId:e.appId,addressTypes:[Ct.solana],authOptions:{redirectUrl:e.redirectUrl}}),[e.appId,e.redirectUrl]);return w.jsx(_B,{config:n,theme:Wc,appName:"Flex Privacy",appIcon:`${window.location.origin}/flex-privacy/assets/flex-mark.png`,children:w.jsx(_9,{})},`${e.appId}|${e.redirectUrl}`)}f5.createRoot(document.getElementById("root")).render(w.jsx(iE.Str
46ictMode,{children:w.jsx(J6,{scope:"app",children:w.jsx(D9,{})})}));export{zB as $,HN as A,R6 as B,kN as C,I6 as D,PN as E,yk as F,aU as G,xO as H,cl as I,MD as J,Sk as K,gU as L,pU as M,rU as N,wk as O,Ut as P,jN as Q,H1 as R,Jc as S,lU as T,jB as U,j6 as V,XD as W,MN as X,EN as Y,yl as Z,_2 as _,Rl as a,cU as a$,TN as a0,t6 as a1,Rk as a2,oU as a3,QD as a4,Ak as a5,bU as a6,uU as a7,Bk as a8,Uk as a9,_k as aA,Hk as aB,NN as aC,ON as aD,eM as aE,Vk as aF,GD as aG,rk as aH,ik as aI,sk as aJ,B6 as aK,qk as aL,XN as aM,JN as aN,YD as aO,C6 as aP,_6 as aQ,ak as aR,HD as aS,ok as aT,PD as aU,F1 as aV,DN as aW,BN as aX,Tk as aY,Dk as aZ,nU as a_,Lk as aa,zr as ab,SO as ac,Ok as ad,kk as ae,jk as af,Gk as ag,Yk as ah,Nk as ai,Zk as aj,LN as ak,V1 as al,bN as am,vN as an,SN as ao,bk as ap,Tt as aq,vk as ar,xk as as,Ek as at,zN as au,Ik as av,DD as aw,Pk as ax,BD as ay,zk as az,$t as b,fN as b$,Jk as b0,Xk as b1,aO as b2,Qk as b3,eU as b4,tU as b5,fU as b6,dU as b7,Xc as b8,L1 as b9,PB as bA,ek as bB,gk as bC,pk as bD,Wk as bE,$k as bF,nk as bG,tk as bH,KN as bI,SU as bJ,EU as bK,AU as bL,TU as bM,_U as bN,kd as bO,j3 as bP,Ng as bQ,iN as bR,aN as bS,sd as bT,Nd as bU,co as bV,yR as bW,hl as bX,dN as bY,uN as bZ,hN as b_,Ck as ba,ZN as bb,VN as bc,vU as bd,_O as be,lk as bf,VD as bg,xU as bh,Yf as bi,ig as bj,Kk as bk,YN as bl,ck as bm,GN as bn,Qf as bo,QN as bp,IU as bq,Fk as br,WN as bs,UD as bt,FN as bu,Mk as bv,$N as bw,qN as bx,_N as by,IN as bz,sU as c,_R as c0,Qg as c1,E1 as c2,m2 as c3,Zi as c4,ou as c5,oN as c6,sN as c7,AR as c8,TR as c9,cN as ca,lN as cb,xs as cc,Zo as cd,Yo as ce,Bf as cf,Mf as cg,IR as ch,O3 as ci,Qa as cj,ad as ck,au as cl,pN as cm,LR as cn,ax as co,gN as cp,Lx as cq,$B as cr,RN as cs,Zc as ct,P1 as cu,cD as cv,e1 as cw,qE as cx,o2 as cy,KA as cz,AN as d,es as e,Gc as f,iU as g,ID as h,xD as i,w as j,hk as k,hU as l,yU as m,CN as n,dk as o,xN as p,ml as q,Me as r,md as s,wU as t,b6 as u,fk as v,uk as w,mk as x,mU as y,UN as z};
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.